Bank problem - 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: Bank problem (
/showthread.php?tid=424812)
Bank problem -
Squirrel - 23.03.2013
I got an issue with bank system.
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"
Re: Bank problem -
Squirrel - 23.03.2013
Anyone?
Re: Bank problem -
dusk - 23.03.2013
Try returning 1. But does it work? Or it says unkown command AND doesn't work?
Re: Bank problem -
Squirrel - 23.03.2013
Nope doesnt work.
It doesnt say Unknown command for the command itself. It just says unknown command when you type for example
/banklogin 1234
It basically says unknown command when you type the password