Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum pInfo
- {
- PlayerCash,
- AdminLevel,
- Rank,
- VIP,
- Skin,
- Float: pX,
- Float: pY,
- Float: pZ,
- Float: pR
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 2251.1633, 1166.7668, 79.5547);
- SetPlayerCameraLookAt(playerid, 1500.1633, 2000.7668, 79.5547);
- PlayerInfo[playerid][AdminLevel] = dini_Int(File, "AdminLevel");
- PlayerInfo[playerid][VIP] = dini_Int(File, "VIP");
- PlayerInfo[playerid][PlayerCash] = dini_Int(File, "PlayerMoney");
- PlayerInfo[playerid][Skin] = dini_Int(File, "Skin");
- GivePlayerMoney(playerid, PlayerInfo[playerid][PlayerCash]);
- SetPlayerScore(playerid, PlayerInfo[playerid][Rank]);
- SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- GetPlayerName(playerid, pName, sizeof(pName));
- format(File, sizeof(File), AccountLocation, pName);
- dini_IntSet(File, "PlayerMoney", PlayerInfo[playerid][PlayerCash] = GetPlayerMoney(playerid));
- dini_IntSet(File, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
- dini_IntSet(File, "Rank", PlayerInfo[playerid][Rank] = GetPlayerScore(playerid));
- dini_IntSet(File, "VIP", PlayerInfo[playerid][VIP]);
- dini_IntSet(File, "Skin", PlayerInfo[playerid][Skin] = GetPlayerSkin(playerid));
- format(leftgame, sizeof(leftgame), "**~{FF0000} %s{AAAAAA} has logged out.", pName);
- SCM_ALL(COLOR_GREY, leftgame);
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new Message[128], StartingMessage[128];
- if(dialogid == DIALOG_REGISTER)
- {
- GetPlayerName(playerid, pName, sizeof(pName));
- format(File, sizeof(File), AccountLocation, pName);
- if(!response) return Kick(playerid);
- if(!strlen(inputtext))
- {
- format(Message, sizeof(Message), "Welcome %s,\n\nYour new here, please enter a new password to register.", pName);
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Account Manager | Register", Message, "Register", "");
- }
- dini_Create(File);
- dini_IntSet(File, "Password", udb_hash(inputtext));
- dini_IntSet(File, "AdminLevel", PlayerInfo[playerid][AdminLevel] = 0);
- dini_IntSet(File, "PlayerMoney", PlayerInfo[playerid][PlayerCash] = 100);
- dini_IntSet(File, "Rank", PlayerInfo[playerid][Rank] = 0);
- dini_IntSet(File, "VIP", PlayerInfo[playerid][VIP] = 0);
- dini_IntSet(File, "Skin", PlayerInfo[playerid][Skin] = 230);
- PlayerInfo[playerid][AdminLevel] = dini_Int(File, "AdminLevel");
- PlayerInfo[playerid][VIP] = dini_Int(File, "VIP");
- PlayerInfo[playerid][PlayerCash] = dini_Int(File, "PlayerMoney");
- PlayerInfo[playerid][Skin] = dini_Int(File, "Skin");
- GetPlayerName(playerid, pName, sizeof(pName));
- format(Message, sizeof(Message), "Congratulations %s,\nYou have succesfully created an account on Skyline Gaming \nUsername is: %s", pName, pName, inputtext);
- ShowPlayerDialog(playerid, DIALOG_ACCOUNT, DIALOG_STYLE_MSGBOX, "Account Manager | Account Created", Message, "Ok", "");
- format(StartingMessage, sizeof(StartingMessage), "You are a homeless man... Start doing jobs and earning a bit of cash and live the american dream!");
- SCM(playerid, COLOR_GREY, StartingMessage);
- gPlayerLogged[playerid] = 1;
- return 1;
- }
- if(dialogid == DIALOG_LOGIN)
- {
- GetPlayerName(playerid, pName, sizeof(pName));
- format(File, sizeof(File), AccountLocation, pName);
- if(!response) return Kick(playerid);
- if(!strlen(inputtext))
- {
- format(Message, sizeof(Message), "Welcome back %s,\n\nPlease enter your password login.", pName);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Account Manager | Register", Message, "Login", "");
- }
- new tmp;
- tmp = dini_Int(File, "Password");
- if(udb_hash(inputtext) !=tmp)
- {
- format(Message, sizeof(Message), "The password you entered for the username: %s was incorrect. Please try again!", pName);
- SCM(playerid, COLOR_RED, Message);
- format(Message, sizeof(Message), "Welcome back %s,\n\nPlease enter your password login.", pName);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Account Manager | Login", Message, "Login", "");
- }
- else
- {
- gPlayerLogged[playerid] = 1;
- SCM(playerid, COLOR_ORANGE, "You have succesfully logged in.");
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement