12.01.2015, 19:25
what is wrong with this command?
it dosen't send message to the players who is in a plane.
Thanks for helping.
pawn Код:
CMD:pilotradio(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pilotradio [text]");
else format(string, sizeof(string), "(( %s: %s ))", NORPN(playerid), params);
SendPlaneMessage(COLOR_GREEN, string);
return 1;
}
pawn Код:
stock SendPlaneMessage(color, string[])
{
new carid = GetVehicleModel(carid);
new playerid;
foreach(Player, i)
{
if(IsPlayerLoggedIn(i) && IsModelAPlane(carid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SendClientMessage(i, color, string);
}
}
return 1;
}
Thanks for helping.