20.08.2012, 10:23
Hey guys. I tired many times to construct that command but it don't work.
When i spawn the elegy everything is ok, i make the command for all players.
But when i exit the vehicle and type /elegy again, it gets spawned again.
I wanna make the command when anyone type /elegy again the other car gets destroyed and let spawn new car.
Here is the command.
+REP for the dude who help me.
When i spawn the elegy everything is ok, i make the command for all players.
But when i exit the vehicle and type /elegy again, it gets spawned again.
I wanna make the command when anyone type /elegy again the other car gets destroyed and let spawn new car.
Here is the command.
pawn Код:
if (strcmp("/elegy", cmdtext, true, 10) == 0)
{
new Float: X, Float: Y, Float: Z, Float: A;
new vehicleid[MAX_PLAYERS];
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are driving a vehicle.");
if(vehicleid[playerid])
{
DestroyVehicle(vehicleid[playerid]);
}
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
vehicleid[playerid] = CreateVehicle(562, X, Y, Z, A, 0, 0, 0);
PutPlayerInVehicle(playerid, vehicleid[playerid], 0);
return 1;
}