19.02.2011, 17:16
Hey so I need a code which sets every car's license plate to LS-%d, %d is the number between 1000 and 9999, any help?
public OnVehicleSpawn(vehicleid) { new string[32]; if(vehicleid >= 0 && vehicleid <= 2000) { new randnumb = 1000 + random(9999); format(string, sizeof(string),"LS - %d",randnumb); SetVehicleNumberPlate(vehicleid, string); SetVehicleToRespawn(vehicleid); } }
public OnVehicleSpawn(vehicleid)
{
new string[32];
if(vehicleid >= 0 && vehicleid <= 2000)
{
new randnumb = 1000 + random(8999);
format(string, sizeof(string),"LS - %d",randnumb);
SetVehicleNumberPlate(vehicleid, string);
SetVehicleToRespawn(vehicleid);
}
}
public OnGameModeInit()
{
// Create a new static vehicle during GameModeInit
new vehicleid = AddStaticVehicleEx(Model, X, Y, Z, Rotation, C1, C2, SpawnDelay);
new string[32];
new randnumb = 1000 + random(8999);
format(string, sizeof(string),"LS - %d",randnumb);
SetVehicleNumberPlate(vehicleid, string);
SetVehicleToRespawn(vehicleid);
}