20.08.2012, 10:47
Try this:
Edit: I forgot this.
PHP код:
if(strcmp(cmdtext, "/elegy", true) == 0)
{
new Float: X, Float: Y, Float: Z, Float: A;
new vehicleid[MAX_PLAYERS], vehspawned[MAX_PLAYERS];
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are driving a vehicle.");
if(vehspawned[playerid] == 1)
{
DestroyVehicle(vehicleid[playerid]);
vehspawned[playerid] = 0;
}
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
vehicleid[playerid] = CreateVehicle(562, X, Y, Z, A, 0, 0, 0);
vehspawned[playerid] = 1;
PutPlayerInVehicle(playerid, vehicleid[playerid], 0);
return 1;
}