23.03.2013, 19:25
I got an issue with bank system.
Here is the code
The command /createbank works fully and you can enter the password etc. It makes your bank account but the /banklogin wont work. For example:
/banklogin shows this SendClientMessage(playerid, COLOR_RED, "Usage: /banklogin [pin]");
But when you for example type your pin
Ex:
/banklogin 1234 it says "Unknown command"
Here is the code
Код:
COMMAND:banklogin(playerid, params[]) { if( PlayerInfo[playerid][BankLogged] == 1 ) return SendClientMessage(playerid, COLOR_RED, "You're already logged in! "); if( !fexist( BankPath(playerid) ) ) { SendClientMessage(playerid, COLOR_RED, "You dont have a bank account yet, please use /registerbank to register it! "); return 0; } else if( fexist( BankPath(playerid) ) ) { if( !strlen( params ) ) return SendClientMessage(playerid, COLOR_RED, "Usage: /banklogin [pin]"); if( strlen( params ) < 4 || strlen( params ) > 4 ) return SendClientMessage(playerid, COLOR_RED, "A pin has 4 numbers, please use numbers only! "); if( !isnumeric( params ) ) return SendClientMessage(playerid, COLOR_RED, "Numbers only please! "); if( !strcmp( params, PlayerInfo[playerid][BankPassword], true ) ) { PlayerInfo[playerid][BankLogged] = 1; SendClientMessage(playerid, COLOR_YELLOW, "Thank you for logging in to your bank account! "); } else { SendClientMessage(playerid, COLOR_RED, "Wrong pin! Please try again. "); return 0; } return 1; } return 1; }
The command /createbank works fully and you can enter the password etc. It makes your bank account but the /banklogin wont work. For example:
/banklogin shows this SendClientMessage(playerid, COLOR_RED, "Usage: /banklogin [pin]");
But when you for example type your pin
Ex:
/banklogin 1234 it says "Unknown command"