Car system
#1

Im just wondering. when i buy a car on my server it turns into a state car. i know the issue is because of the ids of the cars. they are like 1-2-3-4-5

How can i change the ids of the cars? like when i buy a car the id is not 1-2-3- but starts from like 900 and goes up?

Hope to get a quick answer. i am also open for pms

if you want to help my skype is Jim-Christersli

Thank you.
Reply
#2

I tried this and vehicle ids when i was driving a vehicle were like 422, 126, 130:
pawn Код:
CMD:vid(playerid, params[])
{
    new id, vehid=GetPlayerVehicleID(playerid), str[128];
    if (sscanf(params, "d", id))
    {
        format(str, sizeof(str), "vehicle id: %d", vehid);
        SendClientMessage(playerid, 0x00FF00AA, str);
    }
    return 1;
}
Adding 1 more if, ids change to: (id+900), pretty simple:

pawn Код:
CMD:vid(playerid, params[])
{
    new id, vehid=GetPlayerVehicleID(playerid), str[128];
    if (sscanf(params, "d", id))
    {
        if (vehid<900)
        {
            vehid=vehid+900;
            format(str, sizeof(str), "vehicle id: %d", vehid);
            SendClientMessage(playerid, 0x00FF00AA, str);
        }
    }
    return 1;
}
I hope you use zcmd and sscanf so you can try this fast.
Reply
#3

thanks. ill try it out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)