27.02.2014, 22:04
Then you haven't anything to the 'else' statement.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(IsPlayerInAnyVehicle(playerid))
{
new str[150], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name)), car = GetPlayerVehicleID(playerid);
format(str, sizeof(str), "%s(%d) [CAR]: %s", name, playerid, text);
for(new i = 0; i < MAX_PLAYERS; i++) //Foreach recommended.
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInVehicle(i, car)) continue;
SendClientMessage(i, 0xFFFF00FF, str);
}
}
else return 1;
return 0;
}