21.02.2009, 10:44
pawn Код:
if(strcmp(cmd, "/getcarid", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
new Float:x,Float:y,Float:z;
for(new c = 0; c < sizeof(CarInfo); c++)
{
GetVehiclePos(CarInfo[c][cID], x, y, z);
if(PlayerToPoint(3, playerid, x, y, z))
{
format(string, sizeof(string), "Car ID: %d", CarInfo[c][cID]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
}
SendClientMessage(playerid, COLOR_RED, "You are not near any Car Ownership vehicle.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Only admins with Adm Level 4 can use this command.");
return 1;
}
}
return 1;
}
Also I moved floats x, y and z outside the loop, so it won't create them again and again. Saves time.