Hallo,
ich möchte gerne, dass man auf meinem Server, wenn man /bikedm eingibt. Man in der Bikedm Arena auf einem Bike spawnt.
if (strcmp("/bikedm", cmdtext, true) == 0)
{
if(bikedmon[playerid] ==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 28, 100000);
bikedmon[playerid] = 1;
SetPlayerPos(playerid, 1965.5140,-2343.9841,13.5469);
SetPlayerBikedmSpawn(playerid);
GameTextForPlayer(playerid,"~g~Du bist nun im Bike Deathmatch. Um Bike Deathmatch zu verlassen /abbrechen." ,5000,5);
SetPlayerColor(playerid, 0);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
bike = CreateVehicle(522, X+5,Y,Z+1, 0.0, -1, -1, 60000);
PutPlayerInVehicle(playerid, bike, 0);
}
else
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 28, 100000);
bikedmon[playerid] = 1;
SetPlayerPos(playerid, 1965.5140,-2343.9841,13.5469);
SetPlayerBikedmSpawn(playerid);
GameTextForPlayer(playerid,"~g~Du bist nun im Bike Deathmatch. Um Bike Deathmatch zu verlassen /abbrechen." ,5000,5);
SetPlayerColor(playerid, 0);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
bike = CreateVehicle(522, X+5,Y,Z+1, 0.0, -1, -1, 60000);
PutPlayerInVehicle(playerid, bike, 0);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du kannst dich jetzt nicht porten! /abbrechen um zu verlassen.");
}
return 1;
}
new Float:gRandomBikedmSpawns[3][3] = {
{1552.7448,-2474.3591,13.1257},
{1861.3868,-2481.7458,13.5547},
{2049.3540,-2490.7275,13.5469}
};
forward SetPlayerBikedmSpawn(playerid);
new bikedmon[MAX_PLAYERS];
public SetPlayerBikedmSpawn(playerid)
{
new rand = random(sizeof(gRandomBikedmSpawns));
SetPlayerPos(playerid, gRandomBikedmSpawns[rand][0], gRandomBikedmSpawns[rand][1], gRandomBikedmSpawns[rand][2]);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(bikedmon[playerid] == 1)
{
ResetPlayerWeapons(playerid);
SetPlayerBikedmSpawn(playerid);
GivePlayerWeapon(playerid, 28, 100000);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
bike = CreateVehicle(522, X+5,Y,Z+1, 0.0, -1, -1, 60000);
PutPlayerInVehicle(playerid, bike, 0);
}
}
Immer wenn man /bikedm eingibt spawnt man, aber dort wo man grade steht mit nem Motorrad.