SA-MP Forums Archive
sscanf /veh cmd help - 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: sscanf /veh cmd help (/showthread.php?tid=514496)



sscanf /veh cmd help - DamonD - 21.05.2014

if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) {
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /veh [model name/ID] [color 1] [color 2]");
}

Okay, I have this code for my /veh(Vehicle Spawn(ing)) command, - and I don't know how what specifier to use so that it can be an integer, or a string(for the vehicle name). Thanks.


Re: sscanf /veh cmd help - SickAttack - 21.05.2014

You can use "s" so that you can type the name of the vehicle as well.

pawn Код:
new iVehicle[128];
if(sscanf(params, "s[128]ii", iVehicle, iColors[0], iColors[1]))
To get the id of the vehicle by the name, create a stock witch does that.