SA-MP Forums Archive
Help with a command - 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: Help with a command (/showthread.php?tid=300703)



Help with a command - LiamM - 01.12.2011

Hey guys i'm making a command to create a business. For some reason though when typing the Name of the business... depending on what 'Category' I put it under.. it changes the 2nd character of the name.. any ideas?
Here is the code that is making it do that, I just can't figure out what part.
pawn Код:
if(sscanf(params,"sii", BuzName, BuzCategory, BusPrice)) return SendClientMessage(playerid,-1,"USAGE: /createbus <Category 1-5> <price> <Name>");

format(BusInfo[id][BusName], 24, BuzName);

dini_Set(File2, "BusName", BusInfo[id][BusName]);
Any ideas? Thanks


Re: Help with a command - park4bmx - 01.12.2011

pawn Код:
if(sscanf(params,"iis", BuzCategory, BusPrice,BuzName)) return SendClientMessage(playerid,-1,"USAGE: /createbus <Category 1-5> <price> <Name>");
is iis becouse your want 1-5 , price ,name so that means that Category 1-5 is a variable so its an I
then same with the price and the Name is a Sting
you got them in the wrong order


Re: Help with a command - LiamM - 01.12.2011

What order should it be in?


Re: Help with a command - SmiT - 01.12.2011

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
is iis becouse your want 1-5 , price ,name so that means that Category 1-5 is a variable so its an I
If it's a variable it doesn't mean it should stand for "i", perhaps you mean integer.


Re: Help with a command - park4bmx - 01.12.2011

Quote:
Originally Posted by SmiT
Посмотреть сообщение
If it's a variable it doesn't mean it should stand for "i", perhaps you mean integer.
integer is what i ment yes sorry ;X


Re: Help with a command - LiamM - 01.12.2011

So what exactly is wrong with it?? It seems to change the 2nd character to some weird character depending on what category I choose... so I think something is happening with the sscanf....