SHARE
TWEET

Untitled

a guest Sep 14th, 2017 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. enum pInfo
  2. {
  3.     PlayerCash,
  4.     AdminLevel,
  5.     Rank,
  6.     VIP,
  7.     Skin,
  8.     Float: pX,
  9.     Float: pY,
  10.     Float: pZ,
  11.     Float: pR
  12. }
  13.  
  14. public OnPlayerRequestClass(playerid, classid)
  15. {
  16.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  17.     SetPlayerCameraPos(playerid, 2251.1633, 1166.7668, 79.5547);
  18.     SetPlayerCameraLookAt(playerid, 1500.1633, 2000.7668, 79.5547);
  19.  
  20.  
  21.     PlayerInfo[playerid][AdminLevel] = dini_Int(File, "AdminLevel");
  22.     PlayerInfo[playerid][VIP] = dini_Int(File, "VIP");
  23.     PlayerInfo[playerid][PlayerCash] = dini_Int(File, "PlayerMoney");
  24.     PlayerInfo[playerid][Skin] = dini_Int(File, "Skin");
  25.     GivePlayerMoney(playerid, PlayerInfo[playerid][PlayerCash]);
  26.     SetPlayerScore(playerid, PlayerInfo[playerid][Rank]);
  27.     SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
  28.     return 1;
  29. }
  30.  
  31.  
  32. public OnPlayerDisconnect(playerid, reason)
  33. {
  34. GetPlayerName(playerid, pName, sizeof(pName));
  35. format(File, sizeof(File), AccountLocation, pName);
  36.  
  37. dini_IntSet(File, "PlayerMoney", PlayerInfo[playerid][PlayerCash] = GetPlayerMoney(playerid));
  38. dini_IntSet(File, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
  39. dini_IntSet(File, "Rank", PlayerInfo[playerid][Rank] = GetPlayerScore(playerid));
  40. dini_IntSet(File, "VIP", PlayerInfo[playerid][VIP]);
  41. dini_IntSet(File, "Skin", PlayerInfo[playerid][Skin] = GetPlayerSkin(playerid));
  42. format(leftgame, sizeof(leftgame), "**~{FF0000} %s{AAAAAA} has logged out.", pName);
  43.  
  44. SCM_ALL(COLOR_GREY, leftgame);
  45. }
  46.  
  47. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  48. {
  49. new Message[128], StartingMessage[128];
  50. if(dialogid == DIALOG_REGISTER)
  51.     {
  52.         GetPlayerName(playerid, pName, sizeof(pName));
  53.         format(File, sizeof(File), AccountLocation, pName);
  54.         if(!response) return Kick(playerid);
  55.         if(!strlen(inputtext))
  56.         {
  57.             format(Message, sizeof(Message), "Welcome %s,\n\nYour new here, please enter a new password to register.", pName);
  58.             ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Account Manager | Register", Message, "Register", "");
  59.         }
  60.         dini_Create(File);
  61.         dini_IntSet(File, "Password", udb_hash(inputtext));
  62.         dini_IntSet(File, "AdminLevel", PlayerInfo[playerid][AdminLevel] = 0);
  63.         dini_IntSet(File, "PlayerMoney", PlayerInfo[playerid][PlayerCash] = 100);
  64.         dini_IntSet(File, "Rank", PlayerInfo[playerid][Rank] = 0);
  65.         dini_IntSet(File, "VIP", PlayerInfo[playerid][VIP] = 0);
  66.         dini_IntSet(File, "Skin", PlayerInfo[playerid][Skin] = 230);
  67.         PlayerInfo[playerid][AdminLevel] = dini_Int(File, "AdminLevel");
  68.         PlayerInfo[playerid][VIP] = dini_Int(File, "VIP");
  69.         PlayerInfo[playerid][PlayerCash] = dini_Int(File, "PlayerMoney");
  70.         PlayerInfo[playerid][Skin] = dini_Int(File, "Skin");
  71.         GetPlayerName(playerid, pName, sizeof(pName));
  72.         format(Message, sizeof(Message), "Congratulations %s,\nYou have succesfully created an account on Skyline Gaming \nUsername is: %s", pName, pName, inputtext);
  73.         ShowPlayerDialog(playerid, DIALOG_ACCOUNT, DIALOG_STYLE_MSGBOX, "Account Manager | Account Created", Message, "Ok", "");
  74.        
  75.         format(StartingMessage, sizeof(StartingMessage), "You are a homeless man... Start doing jobs and earning a bit of cash and live the american dream!");
  76.         SCM(playerid, COLOR_GREY, StartingMessage);
  77.         gPlayerLogged[playerid] = 1;
  78.         return 1;
  79.     }
  80. if(dialogid == DIALOG_LOGIN)
  81.     {
  82.         GetPlayerName(playerid, pName, sizeof(pName));
  83.         format(File, sizeof(File), AccountLocation, pName);
  84.         if(!response) return Kick(playerid);
  85.         if(!strlen(inputtext))
  86.         {
  87.             format(Message, sizeof(Message), "Welcome back %s,\n\nPlease enter your password login.", pName);
  88.             ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Account Manager | Register", Message, "Login", "");
  89.         }
  90.         new tmp;
  91.         tmp = dini_Int(File, "Password");
  92.         if(udb_hash(inputtext) !=tmp)
  93.         {
  94.             format(Message, sizeof(Message), "The password you entered for the username: %s was incorrect. Please try again!", pName);
  95.             SCM(playerid, COLOR_RED, Message);
  96.             format(Message, sizeof(Message), "Welcome back %s,\n\nPlease enter your password login.", pName);
  97.             ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Account Manager | Login", Message, "Login", "");
  98.         }
  99.         else
  100.         {
  101.             gPlayerLogged[playerid] = 1;
  102.             SCM(playerid, COLOR_ORANGE, "You have succesfully logged in.");
  103.             return 1;
  104.         }
  105.     }
RAW Paste Data
Top