SA-MP Forums Archive
sscanf problem - 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 problem (/showthread.php?tid=354681)



sscanf problem - MP2 - 27.06.2012

I'm making a function to create vehicle spawnpoints, which will store multiple (up to 50) models that may appear at said spawnpoint to randomize it a bit.

stock CreateVehicleSpawn(models[], Float:x, Float:y, Float:z, Float:angle, color1, color2)

models is a string of models like "400 401 402". I'm using the sscanf array specifier to process it:

pawn Код:
stock CreateVehicleSpawn(models[], Float:x, Float:y, Float:z, Float:angle, color1, color2)
{
new model[50];
if(sscanf(models, "a<i>[50]", model)) return print("[WARNING] A static vehicle has a corrupt model format and won't be created.");
But it is printing the
[WARNING] A static vehicle has a corrupt model format and won't be created.
error.

Any ideas why? This is the function that causes the warning above:

CreateVehicleSpawn("411 403 522", 0.0, 0.0, 3.0, 0.0, -1, -1);

I also printed out the string passed, and as you can see it's fine:

[17:16:50] 411 403 522
[17:16:50] [WARNING] A static vehicle has a corrupt model format and won't be created.


Re: sscanf problem - MP2 - 27.06.2012

Oh I see. Should it be A or I then?


Re: sscanf problem - MP2 - 27.06.2012

Got it, thanks.