01.06.2012, 12:11
Ok so,i coded this little /eject command,but it works only if i want eject id 0.
What's wrong?
pawn Код:
CMD:ej(playerid,params[])
{
if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ej [Player/ID]");
new string[128];
new string2[128];
new DestName[24];
new Destinationid;
new name[24];
GetPlayerName(playerid, name, 24);
GetPlayerName(Destinationid, DestName, 24);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerInVehicle(Destinationid, GetPlayerVehicleID(playerid)))
{
if(IsPlayerConnected(Destinationid) && playerid != Destinationid)
{
format(string2, 128, "You have ejected %s (%i) from your vehicle.", DestName, Destinationid);
SendClientMessage(playerid, orange, string2);
GameTextForPlayer(playerid,"~r~Player ejected from vehicle!",3000,5);
format(string, 128, "You got ejected from %s's (%d) vehicle.", name, playerid);
SendClientMessage(playerid, orange, string);
RemovePlayerFromVehicle(Destinationid);
GameTextForPlayer(Destinationid,"~r~You have been ejected!",3000,5);
}
}
return true;
}