22.08.2012, 08:46
You may like to look https://sampwiki.blast.hk/wiki/IsValidVehicle
pawn Код:
native IsValidVehicle(vehicleid);
// Count vehicles
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext,"/countvehicles",true))
{
new
count,
msg[60];
for(new i; i < MAX_VEHICLES; i++)
{
if(IsValidVehicle(i)) count++;
}
format(msg, sizeof(msg), "* There are %d valid spawned vehicles on this server.", count);
SendClientMessage(playerid, 0x33CCCCFF, msg);
return 1;
}
return 0;
}