07.12.2008, 12:25
I am having problems with this script.
Here is my code:
/bankregister works, but after I use the command it says SERVER : Unknown Command
/banklogin doesn't work, it keeps saying invalid password...
Help?
This is an freakin annoying bug.. thx for helping
NOTE : This is not my script's identation... lol
Here is my code:
Код:
if(strcmp(cmd,"/bankregister",true)==0) { new tmp[256]; new playername[256]; new string[256]; tmp=strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,DarkGreen,"USAGE : /bankregister [password]"); return 1; } if(!PlayerToPoint(3.0,playerid,2316.6160,-7.5284,26.7422)) return SendClientMessage(playerid,AdminRed,"Must be near the bank counter!"); if(PlayerStats[playerid][BankLogged]==1) return SendClientMessage(playerid,AdminRed,"You're already logged in!"); GetPlayerName(playerid,playername,sizeof(playername)); new fstring[50]; format(fstring,50,"%s.xcu",udb_encode(playername)); new create=pBank_CreateBankAccount(fstring,-100,tmp); if(create == -1) { SendClientMessage(playerid,DarkGreen,"You have already registered a bank account under this name!"); SendClientMessage(playerid,DarkGreen,"Use /banklogin [password] to login into your bank account!"); return 1; } format(string,sizeof(string),"You are now bankregistered under playername %s and password %s!",playername,tmp); SendClientMessage(playerid,DarkGreen,string); printf("%s registered a bank account with password %s",playername,tmp); return 1; } if(strcmp(cmd,"/banklogin",true)==0) { new tmp[256]; new playername[256]; tmp=strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,DarkGreen,"USAGE : /banklogin [password]"); return 1; } if(!PlayerToPoint(3.0,playerid,2316.6160,-7.5284,26.7422)) return SendClientMessage(playerid,AdminRed,"Must be near the bank counter!"); if(PlayerStats[playerid][BankLogged]==1) return SendClientMessage(playerid,AdminRed,"You're already logged in!"); GetPlayerName(playerid,playername,sizeof(playername)); new fstring[50]; format(fstring,50,"%s.xcu",udb_encode(playername)); new login=pBank_LoginPlayerToBank(fstring,tmp); if(login==-1) { SendClientMessage(playerid,DarkGreen,"Invalid Password!"); return 1; } if(login==0) { SendClientMessage(playerid,DarkGreen,"You have not registered a bank account yet under this name!"); SendClientMessage(playerid,DarkGreen,"Use /bankregister [password] to create a bank account!"); return 1; } PlayerStats[playerid][BankLogged]=1; SendClientMessage(playerid,DarkGreen,"You have successfully logged in into your bank account!"); return 1; }
/banklogin doesn't work, it keeps saying invalid password...
Help?
This is an freakin annoying bug.. thx for helping
NOTE : This is not my script's identation... lol