12.11.2018, 07:38
I have already did that, here is everywhere i put pLogged:
Then in OnPlayerRequestClass:
Then in OnPlayerConnect:
Then in OnDialogResponse
DIALOG_REGISTER
This is it.
Where should remove something? Add something. Those are the places where pLogged exists
Код:
new pLogged[MAX_PLAYERS];
Код:
if(pLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREEN, "Please, enter your password!"); return 0; }
Код:
pLogged[playerid] = 0;
Then in OnDialogResponse
DIALOG_REGISTER
Код:
switch( dialogid ) { case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit"); new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Password",udb_hash(inputtext)); INI_WriteInt(File,"Cash",0); INI_WriteInt(File,"Admin",0); INI_WriteInt(File,"Kills",0); INI_WriteInt(File,"Deaths",0); INI_Close(File); SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0); pLogged[playerid] = 1; new stringl[128]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(stringl, sizeof(stringl), "Porsh: {FFFFFF}You've successfully registered the name ({F2D82C}%s{FFFFFF}) with the password ({F2D82C}%s{FFFFFF})", name, inputtext); SendClientMessage(playerid, COLOR_GREEN, stringl); } }
This is it.
Where should remove something? Add something. Those are the places where pLogged exists