Car system - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car system (
/showthread.php?tid=424592)
Car system -
Jamch - 22.03.2013
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.
Re: Car system -
HurtLocker - 23.03.2013
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.
Re: Car system -
Jamch - 23.03.2013
thanks. ill try it out.