19.10.2013, 21:41
Hello i made a bank system and i have those following errors
my code:
Errors:
my code:
pawn Код:
switch( dialogid )
{
case DIALOG_BANK:
{
if(!response) return 0;
if(response)
{
if(listitem == 0)
{
new str[128];
format(str,sizeof(str),"Your Curret Balance Is : $%d\nEnter The Amount You Want To Deposit Below :",pInfo[playerid][pBank]);
ShowPlayerDialog(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit",str, "Deposit", "Back");
}
if(listitem == 1)
{
new str[128];
format(str,sizeof(str),"Your Curret Balance Is : $%d\nEnter The Amount You Want To Withdraw Below :",pInfo[playerid][pBank]);
ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw",str, "Withdraw", "Back");
}
if(listitem == 2)
{
new str[128];
format(str,sizeof(str),"Your Current Balance Is : $%d\nEnter The Player ID You Want To Transfer To Below :",pInfo[playerid][pBank]);
ShowPlayerDialog(playerid,DIALOG_TRANSFER1,DIALOG_STYLE_INPUT,"Transfer",str,"Next","Back");
}
if(listitem == 3)
{
new str[128];
format(str, sizeof(str), "Your current bank balance is: $%d", pInfo[playerid][pBank]);
ShowPlayerDialog(playerid, DIALOG_BALANCE, DIALOG_STYLE_MSGBOX, "Bank account", str, "Back", "");
}
}
}
case DIALOG_DEPOSIT:
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
else if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount!");
else if(!IsNumeric(inputtext))
{
new str[128];
format(str,sizeof(str),"Your Curret Balance Is : $%d\nEnter The Amount You Want To Deposit Below :",pInfo[playerid][pBank]);
ShowPlayerDialog(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit",str, "Deposit", "Back");
SendClientMessage(playerid,COLOR_RED,"Please Use Numbers");
}
else
{
new str[128];
new inputext = strval(inputtext);
pInfo[playerid][pBank] += inputext;
pInfo[playerid][Money] -= inputext;
format(str, sizeof(str), "You have deposited $%d into your account. New balance: $%d", inputext, pInfo[playerid][pBank]);
SendClientMessage(playerid, 0x008000FF, str);
}
}
case DIALOG_WITHDRAW:
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
else if(strval(inputtext) > pInfo[playerid][pBank]) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount in your bank");
else if(!IsNumeric(inputtext))
{
new str[128];
format(str,sizeof(str),"Your Curret Balance Is : $%d\nEnter The Amount You Want To Withdraw Below :",pInfo[playerid][pBank]);
ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw",str, "Withdraw", "Back");
SendClientMessage(playerid,COLOR_RED,"Please Use Numbers");
}
else
{
new str[128];
new inputext = strval(inputtext);
pInfo[playerid][pBank] -= inputext;
pInfo[playerid][Money] += inputext;
format(str, sizeof(str), "You have withdrawn $%d out of your account. New balance: $%d", inputext, pInfo[playerid][pBank]);
SendClientMessage(playerid, 0x008000FF, str);
}
}
case DIALOG_TRANSFER1:
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
else if(strval(inputtext) == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Not Online");
else if(!IsNumeric(inputtext))
{
new str[128];
format(str,sizeof(str),"Your Current Balance Is : $%d\nEnter The Player ID You Want To Transfer To Below :", pInfo[playerid][pBank]);
ShowPlayerDialog(playerid,1130,DIALOG_STYLE_INPUT,"Transfer",str,"Next","Back");
SendClientMessage(playerid,COLOR_RED,"Please Use ID Not Name");
}
else
{
chosenpid = strval(inputtext);
new str[128];
format(str,sizeof(str),"Balance : %d\nChosen Player ID : %d\nNow Enter The Amount You Want To Transfer",pInfo[playerid][pBank],chosenpid);
ShowPlayerDialog(playerid,DIALOG_TRANSFER2,DIALOG_STYLE_INPUT,"Transfer",str,"Transfer","Back");
}
}
case DIALOG_TRANSFER2:
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
else if(strval(inputtext) > PlayerInfo[playerid][pBank]) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount In Bank To Transfer");
else if(!IsNumeric(inputtext))
{
new str[128];
format(str,sizeof(str),"Chosen Player ID : %d\nNow Enter The Amount You Want To Transfer",chosenpid);
ShowPlayerDialog(playerid,1131,DIALOG_STYLE_INPUT,"Transfer",str,"Transfer","Back");
SendClientMessage(playerid,COLOR_RED,"Please Use Numbers");
}
else
{
pInfo[playerid][pBank] -= strval(inputtext);
pInfo[chosenpid][pBank] += strval(inputtext);
new str[128];
format(str,sizeof(str),"You Transfered $%d To ID %d's Bank Account",strval(inputtext),chosenpid);
SendClientMessage(playerid, 0x008000FF, str);
new str2[128];
format(str2,128,"Your New Balance Is : $%d",PlayerInfo[playerid][pBank]);
SendClientMessage(playerid,0x008000FF,str2);
new str3[128];
format(str3,128,"ID : %d Transfered $%d To Your Bank Account",playerid,strval(inputtext));
SendClientMessage(chosenpid,0x008000FF,str3);
new str4[128];
format(str4, 128, "Your New Balance : $%d", PlayerInfo[chosenpid][pBank]);
SendClientMessage(chosenpid, 0x008000FF, str4);
ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel");
}
}
case DIALOG_BALANCE:
{
if(response)
{
ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
}
}
}
Код:
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2414) : error 017: undefined symbol "IsNumeric" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2435) : error 017: undefined symbol "IsNumeric" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2456) : error 017: undefined symbol "IsNumeric" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2465) : error 017: undefined symbol "chosenpid" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2467) : error 017: undefined symbol "chosenpid" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2475) : error 017: undefined symbol "IsNumeric" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2478) : error 017: undefined symbol "chosenpid" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2485) : error 017: undefined symbol "chosenpid" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2487) : error 017: undefined symbol "chosenpid" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2494) : error 017: undefined symbol "chosenpid" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2496) : error 017: undefined symbol "chosenpid" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2497) : error 017: undefined symbol "chosenpid" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 12 Errors.