07.06.2009, 10:05
Hi all,
I got a problem with my super hardcore command. I don't know how to get rest from sscanf.
Here comes the code that will make you understand
I commented the lines that I have problem with.
Thanks in advance,
madmade
I got a problem with my super hardcore command. I don't know how to get rest from sscanf.
Here comes the code that will make you understand

I commented the lines that I have problem with.
Код:
dcmd_note(playerid, params[])
{
new typ[64], giveplayer, price;
if (sscanf(params, "usd", giveplayer, typ, price))
{
SendClientMessage(playerid,SZARY,"USAGE: /note [id] [something] [price]");
return 1;
}
if(price < 0)
{
SendClientMessage(playerid,SZARY,"Zbyt niska price.");
return 1;
}
if(!strcmp(typ,"thing",true))
{
SendClientMessage(playerid, COLOR_GRAD2, "Success!");
return 1;
}
if(!strcmp(typ,"onemore",true))
{
new onemorething;
if(sscanf(/*there should be rest from 'params' but i don't know how to do it*/,"d",onemorething))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /note [id] [something] [price] [more]");
return 1;
}
format(string1, sizeof(string1), "Success! One more value is %d!", onemorething);
SendClientMessage(playerid, COLOR_GRAD2, string1);
return 1;
}
if(!strcmp(typ,"twomore",true))
{
new onemorething, secondmorething;
if(sscanf(/*there should be rest from 'params' but i don't know how to do it*/,"dd",onemorething, secondmorething))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /note [id] [something] [price] [more] [more2]");
return 1;
}
format(string1, sizeof(string1), "Success! One more value is %d and second one is %d!", onemorething, secondmorething);
SendClientMessage(playerid, COLOR_GRAD2, string1);
return 1;
} else return 1;
}
madmade


.