19.08.2012, 08:59
Hey guys. I own a command, who spawns elegy when you type /elegy .
The problem is when another player types it, mine get destroyed or i think the command spawn only one elegy.
Can anyone please give a look at this?
Here is the code.
+Rep for the dude who help me.
The problem is when another player types it, mine get destroyed or i think the command spawn only one elegy.
Can anyone please give a look at this?
Here is the code.
Код:
if (strcmp("/elegy", cmdtext, true, 10) == 0)
{
new Float: X, Float: Y, Float: Z, Float: A;
static vehicleid;
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are driving a vehicle.");
if(vehicleid)
{
DestroyVehicle(vehicleid);
}
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
PutPlayerInVehicle(playerid, (vehicleid = CreateVehicle(562, X, Y, Z, A, 0, 0, 0)), 0);
return 1;
}


