SA-MP Forums Archive
Script Error - 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: Script Error (/showthread.php?tid=456668)



Script Error - Pk93 - 06.08.2013

Solved Thanks for all help


Re: Script Error - Konstantinos - 06.08.2013

pawn Код:
if(sscanf(params,"ud",id,amount,price))
2 specifiers and 3 variables to store to.

Change to "udd".


Re: Script Error - Pk93 - 06.08.2013

Solved


Re: Script Error - Konstantinos - 06.08.2013

No, no.. on the /sellsteel command, replace:
pawn Код:
if(sscanf(params,"ud",id,amount,price)) return SyntaxMSG(playerid, "/sellsteel [playerid/PartOfName] [amount] [price]");
with:
pawn Код:
if(sscanf(params,"udd",id,amount,price)) return SyntaxMSG(playerid, "/sellsteel [playerid/PartOfName] [amount] [price]");
You forgot to add the last "d" specifier so price stays 0.


Re: Script Error - Pk93 - 06.08.2013

Solved


Re: Script Error - Pk93 - 06.08.2013

alright worked alot better but now i have another problem when i type /teststeel [playerid][amount][price]

I get a message "you have sent a steel request to "playername" works fine
and the other player that i offer gets a message "Playername" offers you steels for "price". (accept steel if yo uwant it.


when i type /accept steel it says you have not been offered any steel


Re: Script Error - Konstantinos - 06.08.2013

pawn Код:
if(id == 0) return SCM(playerid, COLOR_INFO, "You have not been offered any steel.");
If the playerid is 0 returns error. This should not be happen. When resetting, set to INVALID_PLAYER_ID not to 0.

And then check:
pawn Код:
if(id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_INFO, "You have not been offered any steel.");



Re: Script Error - Pk93 - 06.08.2013

Solved


Re: Script Error - Pk93 - 06.08.2013

Thanks for the help! was alot usefull!