04.08.2010, 10:07
Aiiight, ok, I want to check if a player is in a RC vehicle, if he is, admins get a message, but the problem is, also if you are in an Airplane you see it, hope you can help me:
pawn Код:
if(strcmp(cmd, "/whoisrc", true) == 0)
{
if(xxxxxx[playerid][xxxx] >= 1 || IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, COLOR_GREEN,"Players in a RC vehicle");
new found, playername[MAX_PLAYER_NAME];
for(new i=0; i <= GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, playername, MAX_PLAYER_NAME);
new bool:searched = false;
if(searched != true)
{
if(IsPlayerInAnyVehicle(i))
{
if(GetVehicleModel(GetPlayerVehicleID(i) == 441 || 464 || 465 || 501 || 564 || 594))
{
found++;
format(string,sizeof(string),"Player: %s(%d) - RC Vehicle: %s", playername, i, VehNames[GetVehicleModel(GetPlayerVehicleID(i))-400]);
SendClientMessage(playerid, COLOR_GREEN,string);
searched = true;
}
else searched = false;
}
}
}
}
if(found == 0) SendClientMessage(playerid, COLOR_GREEN, "There are no players in a RC vehicle");
}
else return 0;
return 1;
}