31.05.2012, 22:16
Hello,i made this code:
I dont get any errors while compiling,but ingame it doesnt eject passengers,what's wrong?
pawn Код:
CMD:ejall(playerid,params[])
{
new pCar;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerInVehicle(playerid, GetPlayerVehicleID(playerid)))
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && GetPlayerVehicleID(i) == pCar)
{
new string[128];
format(string, sizeof(string), "%s (%d) has ejected all passengers from his vehicle!", pNick(playerid), playerid);
SendClientMessage(playerid, COLOR_WHITE, "Passengers ejected from your vehicle!");
GameTextForPlayer(playerid,"~r~Players ejected from vehicle!",3000,5);
SendClientMessage(i, 0x00FFFFFF, string);
RemovePlayerFromVehicle(i);
GameTextForPlayer(i,"~r~Ejected from vehicle!",3000,5);
}
}
return true;
}