Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2020
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.50 KB | None | 0 0
  1. forward onPlayerLogin(playerid);
  2. public onPlayerLogin(playerid){
  3.     switch(cache_num_rows()){
  4.         case 0: Dialog_Show(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ">> Autentificare", "Parola introdusa nu este corecta, te rugam sa incerci din nou.", "Login", "Cancel");
  5.         case 1:{
  6.             new str[64], result[256];
  7.             PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "id");
  8.             PlayerInfo[playerid][pGender] = cache_get_field_content_int(0, "gender");
  9.             PlayerInfo[playerid][pMoney] = cache_get_field_content_int(0, "money");
  10.             PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "admin");
  11.             PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0, "model");
  12.            
  13.             cache_get_field_content(0, "name", result); format(PlayerInfo[playerid][pName], MAX_PLAYER_NAME, result);
  14.             cache_get_field_content(0, "password", result); format(PlayerInfo[playerid][pPassword], 36, result);
  15.             cache_get_field_content(0, "email", result); format(PlayerInfo[playerid][pEmail], 36, result);
  16.            
  17.             format(str, sizeof(str), ""#COL_SERVER">> "#COL_WHITE"Welcome back, "#COL_SERVER"%s", GetName(playerid));
  18.             SCM(playerid, -1, str);
  19.             SpawnPlayer(playerid);
  20.             SetPlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  21.             SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  22.            
  23.             printf("Utilizatorul %s s-a autentificat pe server | IP: %s", PlayerInfo[playerid][pName], GetIP(playerid));
  24.         }
  25.     }
  26.     return 1;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement