21.12.2009, 15:46
wooo guys i am so angry , i had zcmd + ''OnPlayerReciveCommand'' but it works great but it save all make file etc etc but when i type /login it login me but under that says ''SERVER Unknown Command'' and its anyoing same for /register this is realy crap and i was trying to fix and nothing work ... can u help me guys ?
here is now the command
here are the commands , i dont use OnPlayerCommandText Yet cuz i must make /register and /login first ... all is ok but when i type /login or /register all works ok but than it says udner messages ''SERVER Unknown Command'' ... crap,can u help please ?
ty for any help
here is now the command
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { return 0; } public OnPlayerCommandReceived(playerid, cmdtext[]) { dcmd(register, 8, cmdtext); dcmd(login, 5, cmdtext); return 0; } dcmd_register(playerid,params[]) { // The command shouldn't work if we already are authed if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid,0xFF9900AA,"[Account]:You Already Have Account"); // The command shouldn't work if an account with this // nick already exists if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid,0xFF9900AA,"[Account]:Account Already Exist, Use /login password"); // Did he forgot the password? if (strlen(params)==0) return SendClientMessage(playerid,0xFF9900AA,"USAGE:/register [password]"); // We save the money to the accstate if (udb_Create(PlayerName(playerid),params)) { dUserSetINT(PlayerName(playerid)).("money",500); dUserSetINT(PlayerName(playerid)).("score",0); return SendClientMessage(playerid,0x33CCFFAA,"[Account]:Account Successfully Created! Use /login [password]"); } return true; } dcmd_login(playerid,params[]) { // The command shouldn't work if we already are authed if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid,0xFF9900AA,"[Account]:You Are Already Loged In!"); // The command shouldn't work if an account with this // nick does not exists if (!udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid,0xFF9900AA,"[Account]:Account Doesn't Exist, Use /register [password] To Create A New Account!"); // Did he forgot the password? if (strlen(params)==0) return SendClientMessage(playerid,0xFF9900AA,"USAGE:/register [password]"); if (udb_CheckLogin(PlayerName(playerid),params)) { // Login was correct // Following thing is the same like the missing SetPlayerCommand GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid)); SetPlayerScore(playerid,dUserINT(PlayerName(playerid)).("score")-GetPlayerScore(playerid)); PLAYERLIST_authed[playerid]=true; return SendClientMessage(playerid,0x33CCFFAA,"[Account]:You Are Now Loged In! Have Fun With Playing!"); } // Login was incorrect return SendClientMessage(playerid,0xFF9900AA,"[Account]:Login Faild! (Wrong Password)"); }
ty for any help