I made a vehicle-counter Filterscript today . It has some more functions such as model counter and warnings.
And It's written easier without respawning cars or even touching them in any way!! And So u can even use it with all VehicleSlots Used!
DOWNLOAD HERE KLICK
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/carcheck", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xFFFF00AA, "Carcheck introduced!");
new Models[211]=0;
new cars=0;
new mods=0;
for(new i; i<=MAX_VEHICLES;i++)
{
if(400<=GetVehicleModel(i)<=611)
{
cars++;
Models[GetVehicleModel(i)-400]=1;
}
}
for(new o;o<=210;o++)
{
if(Models[o]==1) mods++;
}
new message[256];
format(message, sizeof(message), "%d cars with %d different models!", cars, mods);
if(cars>=550)
{
new message2[256];
new message21[256];
format(message2, sizeof(message2), "Remember you only have %d cars left", 700-cars);
format(message21, sizeof(message21), "And only around %d stable.", 650-mods);
SendClientMessage(playerid, 0xFF6347AA, message2);
SendClientMessage(playerid, 0xFF6347AA, message21);
}
if(mods>=50)
{
new message3[256];
new message31[256];
format(message3, sizeof(message3), "Remember you only have %d models left", 70-mods);
format(message31, sizeof(message31), "And only around %d stable.", 65-mods);
SendClientMessage(playerid, 0xFF6347AA, message3);
SendClientMessage(playerid, 0xFF6347AA, message31);
}
SendClientMessage(playerid, 0xFFFF00AA, message);
return 1;
}
return 0;
}
NOTE: this is part of a filterscript. If u wanna use it directly in your gamemode, u have to change the returns at OnPlayerCommandText!