Here's the dcmd_login
Код:
dcmd_login(playerid,params[]) {
if(LoggedIn[playerid]) {
SendClientMessage(playerid,COLOUR_RED,"Error: You are already logged in to your account!");
return 1;
}
if(!mDoesAccExist(playerid)) {
SendClientMessage(playerid,COLOUR_RED,"Error: This account doesn't exist, please /register it first");
return 1;
}
if(!strlen(params)) {
SendClientMessage(playerid,COLOUR_RED,"Usage: /login [password]");
return 1;
}
if(mCheckPass(playerid,params)) {
LoggedIn[playerid] = 1;
new ip[20];
GetPlayerIp(playerid,ip,20);
mPlayerUpdateS(playerid,"ip",ip);
mPlayerUpdateI(playerid,"online",1);
XP[playerid] = mPlayerGetI(playerid,"XP");
XLevel[playerid] = mPlayerGetI(playerid,"Level");
Adminlevel[playerid] = mPlayerGetI(playerid,"Adminlevel");
Kills[playerid] = mPlayerGetI(playerid,"kills");
Deaths[playerid] = mPlayerGetI(playerid,"deaths");
PmsSent[playerid] = mPlayerGetI(playerid,"pms_sent");
ChatLines[playerid] = mPlayerGetI(playerid,"Textsent");
PlayerJoins[playerid] = mPlayerGetI(playerid,"player_joins");
CommandsUsed[playerid] = mPlayerGetI(playerid,"commands_used");
Raceswon[playerid] = mPlayerGetI(playerid,"Raceswon");
PlayerMoney[playerid] = mPlayerGetI(playerid,"cash");
//Bank[playerid] = mPlayerGetI(playerid,"Bank");
//Reactionswon[playerid] = mPlayerGetI(playerid,"Reactionswon");
TogglePlayerControllable(playerid,1);
format(string,sizeof(string),"Logged in: Welcome back %s(Account id: %d) - [XP: %d | Level: %d ] - Admin Level: %d",ReturnName(playerid),mPlayerGetI(playerid,"id"),mPlayerGetI(playerid,"XP"),mPlayerGetI(playerid,"level"),mPlayerGetI(playerid,"Adminlevel"));
SendClientMessage(playerid,COLOUR_IVORY,string);
return 1;
}
//printf("[MySQL Reg]: Warning: Player %s(%d) attempted login with incorrect password",ReturnName(playerid),playerid);
//SendClientMessage(playerid,0xAA0000FF,"You have been kicked from the server (Incorrect Password)");
//Kick(playerid);
return 1;
}
But it displays NOTHING after you logged in :/