Problem with GetPlayerMoney and dini_IntSet - 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 GetPlayerMoney and dini_IntSet (
/showthread.php?tid=324877)
Problem with GetPlayerMoney and dini_IntSet -
Reklez - 11.03.2012
hi i'm current making my script.
the problem is i get some error at this part
pawn Код:
//This is from OnDialogResponse
/* DIALOG_BANKW */
if(GetPlayerMoney(playerid) > inputtext) return SendClientMessage(playerid, -1, "You do not have enough cash to withdraw that cash!"); //the problem is here
dini_IntSet(file, "WithDraw", inputtext); //the problem is here too!
error
Код:
error 033: array must be indexed (variable "inputtext")
error 035: argument type mismatch (argument 3)
help ASAP.
Re: Problem with GetPlayerMoney and dini_IntSet -
Andi_Evandy - 11.03.2012
Try:
pawn Код:
if(GetPlayerMoney(playerid) > strval(inputtext)) return SendClientMessage(playerid, -1, "You do not have enough cash to withdraw that cash!");
dini_IntSet(file, "WithDraw", strval(inputtext));
Re: Problem with GetPlayerMoney and dini_IntSet -
Shabi RoxX - 11.03.2012
Quote:
Originally Posted by Reklez
hi i'm current making my script.
the problem is i get some error at this part
pawn Код:
//This is from OnDialogResponse
/* DIALOG_BANKW */
if(GetPlayerMoney(playerid) > inputtext) return SendClientMessage(playerid, -1, "You do not have enough cash to withdraw that cash!"); //the problem is here dini_IntSet(file, "WithDraw", inputtext); //the problem is here too!
error
Код:
error 033: array must be indexed (variable "inputtext")
error 035: argument type mismatch (argument 3)
help ASAP.
|
inputtext is a string and you are trying to save string with dini_setint, you must first convert string to integar with strval()... This means u r checking if int is greater than string : hope u understand .
Try this
pawn Код:
new money = strval(inputtext);//convert string to int
if(GetPlayerMoney(playerid) < money) return SendClientMessage(playerid, -1, "You do not have enough cash to withdraw that cash!");
dini_IntSet(file, "WithDraw", money);
Re: Problem with GetPlayerMoney and dini_IntSet -
Reklez - 11.03.2012
thanks Shabi and Andi rep+ both for you