sscanf problem
#1

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.
Reply
#2

Oh I see. Should it be A or I then?
Reply
#3

Got it, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)