17.12.2014, 13:41
This is Public OnPlayerRegister
Код:
public OnPlayerRegister(playerid, password[]) // { if(IsPlayerConnected(playerid)) { MySQLCheckConnection(); new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); new newaccountsqlid = MySQLCreateAccount(playername3, password, playerid); if (newaccountsqlid != 0) { new loginstring[128]; PlayerData[playerid][pSQLID] = newaccountsqlid; strmid(PlayerData[playerid][pKey], password, 0, strlen(password), 255); OnPlayerUpdateEx(playerid); format(loginstring,sizeof(loginstring),"Bine ai venit, %s\nAcest nick este inregistrat.\nTe rog logheaza-te:",playername3); ShowPlayerDialog(playerid,12346,DIALOG_STYLE_PASSWORD,"{1E90FF}L{FFFFFF}ogheaza-te",loginstring,"Login","Exit"); return 1; } else { gPlayerAccount[playerid] = 0; new regstring[128]; new regname[64]; GetPlayerName(playerid,regname,sizeof(regname)); format(regstring,sizeof(regstring),"Bine ai venit, %s\nNu ai cont.\nTe rog inregistreaza-te:",regname); ShowPlayerDialog(playerid,12345,DIALOG_STYLE_PASSWORD,"{1E90FF}I{FFFFFF}nregistreaza-te",regstring,"Register","Exit"); } } return 0; }