How can i create a plate system global?
#1

I want for example car id 1 to have LS 0001 , and car id 10 LS 0010 , ok ? how can i do something like these?.. every car to have plate.. ?
Reply
#2

pawn Код:
CMD:plate(playerid, params[])
{
    new vehicleid;
    vehicle = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, 0x00FF00AA, "You're in a vehicle.");
    if(sscanf(params,"i", Plate)) return SendClientMessage(playerid, -1, "{15FF00}Usage: {FF0000}/Plate [Number Plate]");
    SetVehicleNumberPlate(vehicleid, Plate);
    return 1;
}
Reply
#3

UP T_T .. this time somebody who can REALLY help me?
Reply
#4

pawn Код:
CMD:plates(playerid, params[])
{
    for(new i; i != MAX_VEHICLES; i++)
    {
        new string[89];
        new plates = 1 + random(500);
        format(string, sizeof(string), "LS 00%d", plates);
        SetVehicleNumberPlate(i, string);
    }    
    return 1;
}
Reply
#5

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    new plate[32];
    format(plate, sizeof(plate), "LS-%04d", vehicleid);
    SetVehicleNumberPlate(vehicleid, plate); // before calling this, make sure vehicle has a plate as the Wiki states
    SetVehicleToRespawn(vehicleid);
    return 1;
}
Simples.
Reply
#6

Done , thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)