Problem with sscanf & house system */createhouse - 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: Problem with sscanf & house system */createhouse (
/showthread.php?tid=585173)
Problem with sscanf & house system */createhouse -
[LvZ]Free - 11.08.2015
Hello, im trying to make a house system. In create house command i currently have this:
PHP код:
if(sscanf(params,"si",HousePrice,HouseName)) return SendClientMessage(playerid,-1,"USAGE: /createhouse [price] [Name]");
Are the parameters written propertly? (i havent scripted in a long time, i dont renember), however i tried vice versa.
When im trying to save the house name, im doing this
PHP код:
INI_WriteString(File,"Name",HouseName);
but it gives me: error 035 argument type mismatch (argument 3)
I must type it as integer but, its not integer.
Why is that? Maybe im doing something wrong?
AW: Problem with sscanf & house system */createhouse -
Macronix - 11.08.2015
Could you show your full code?
Re: Problem with sscanf & house system */createhouse -
Stev - 11.08.2015
Код:
if(sscanf(params,"si",HousePrice,HouseName))
Im assuming you have a variable like "new HouseName[32]", Or what ever size you have.
You got them the wrong way around..
Код:
new HouseName[32];
if(sscanf(params,"is[32]",HousePrice,HouseName))