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



Problems - Alienwar3 - 04.06.2013

Hello friends, well I have a problem with inputtext, but rather several problems. I leave the lines look.
pawn Код:
if (inputtext > PlayerInfo[playerid][pAccount] || inputtext < 1) return Message(playerid, COLOR_GRAD2, "Cantidad incorrecta");
           {
           new string[164],curfunds;
           Earn(playerid,inputtext);
           SaveAccounts();
           curfunds = PlayerInfo[playerid][pAccount];
           PlayerInfo[playerid][pAccount]-=inputtext;
           FMB -= inputtext;
           Message(playerid, COLOR_WHITE, "|___ ESTADO BANCARIO ___|");
           format(string, sizeof(string), "  Antiguo Balance: $%d", curfunds);
           Message(playerid, COLOR_GRAD2, string);
           format(string, sizeof(string), "  Extrajo: $%d",inputtext);
           Message(playerid, COLOR_GRAD4, string);
           Message(playerid, COLOR_GRAD6, "|-----------------------------------------|");
           format(string, sizeof(string), "  Nuevo Balance: $%d", PlayerInfo[playerid][pAccount]);
           Message(playerid, COLOR_WHITE, string);
           format(string, sizeof(string), "* %s coloca su contraseсa [***] y retira el dinero.", PlayerName(playerid));
           ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
           TextDrawHideForPlayer(playerid, TextdrawBank1[playerid]);
           CheckBankDin(playerid);
           return 1;
           }
    }
    if(dialogid == DIALOG_CUENTA_BANCARIA_DEPOSITAR && response == 1)
    {
           if (inputtext > GetPlayerMoney(playerid) || inputtext < 1) return Message(playerid, COLOR_GRAD2, "Cantidad incorrecta");
           {
           new string[64],curfunds;
           Bought(playerid,inputtext);
           curfunds = PlayerInfo[playerid][pAccount];
           PlayerInfo[playerid][pAccount]+=inputtext;
and errors:
Quote:

C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19134) : error 033: array must be indexed (variable "inputtext")
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19136) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19137) : error 035: argument type mismatch (argument 2)
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19140) : error 033: array must be indexed (variable "inputtext")
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19141) : error 033: array must be indexed (variable "inputtext")
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19158 ) : error 033: array must be indexed (variable "inputtext")
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19160) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19161) : error 035: argument type mismatch (argument 2)
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19163) : error 033: array must be indexed (variable "inputtext")
C:\Users\Agustin\Desktop\Agustin\Z-Alienware Rp\gamemodes\CR-RPv1.pwn(19164) : error 033: array must be indexed (variable "inputtext")




Re: Problems - [KHK]Khalid - 04.06.2013

Well, 'inputtext' is a string not an integer so to get the value of it use strval:

pawn Код:
strval(inputtext); // remove the semi-colon in if/else statements