Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Includes */
- #include <a_samp>
- #include <YSI\y_ini>
- /* Defines */
- #define ServerName "New City Role Play"
- #define ServerNameShorted "NCRP"
- #define D_Login 100
- #define D_Register 200
- #define D_R_Mail 201
- #define D_R_C_Gender 202
- #define D_R_C_Age 203
- #define D_R_C_Origin 204
- #define D_R_Rules 205
- #define D_R_Rules2 206
- #define D_R_Quiz 207
- #define D_R_Quiz2 208
- #define PATH "Accounts/%s.ini"
- /* News */
- enum pStats
- {
- pID,
- pPassword[128],
- pEmail[128],
- pGender[128],
- pAge,
- pOrigin[128],
- pDeaths,
- pKills,
- pMoney,
- pSkin,
- pBanned,
- pBanReason[128],
- pBanBy[128],
- pBanExpire[128],
- pPasswordAttempts,
- pPlayerLevel,
- Float: pPosY,
- Float: pPosX,
- Float: pPosZ,
- pInterior,
- pWorld
- };
- new PlayerInfo[MAX_PLAYERS][pStats],
- strings[128],
- PasswordAttempts[MAX_PLAYERS],
- RulesTimer[MAX_PLAYERS];
- /* Normal */
- main()
- {
- print("\n[Launch] Creating GameMode: New City RolePlay");
- }
- forward CheckAndLoad_data(playerid, name[], value[]);
- forward DialogTimer(playerid);
- forward DialogTimer2(playerid);
- /* Publics */
- public OnGameModeInit()
- {
- SetGameModeText("NCRP - V0.10.0");
- return 1;
- }
- public CheckAndLoad_data(playerid, name[], value[])
- {
- print("\nLoading first player's data..\n");
- INI_String("pPassword", PlayerInfo[playerid][pPassword], 128);
- INI_String("pEmail", PlayerInfo[playerid][pEmail], 128);
- INI_String("pGender", PlayerInfo[playerid][pGender], 128);
- INI_Int("pAge", PlayerInfo[playerid][pAge]);
- INI_String("pOrigin", PlayerInfo[playerid][pOrigin], 128);
- INI_Int("pDeaths", PlayerInfo[playerid][pDeaths]);
- INI_Int("pKills", PlayerInfo[playerid][pKills]);
- INI_Int("pMoney", PlayerInfo[playerid][pMoney]);
- INI_Int("pSkin", PlayerInfo[playerid][pSkin]);
- INI_Int("pBanned", PlayerInfo[playerid][pBanned]);
- INI_String("pBanReason", PlayerInfo[playerid][pBanReason], 128);
- INI_String("pBanBy", PlayerInfo[playerid][pBanBy], 128);
- INI_String("pBanExpire", PlayerInfo[playerid][pBanExpire], 128);
- INI_Int("pPlayerLevel", PlayerInfo[playerid][pPlayerLevel]);
- INI_Float("pPosY", PlayerInfo[playerid][pPosY]);
- printf("POSY LOADED ! %f", PlayerInfo[playerid][pPosY]);
- INI_Float("pPosX", PlayerInfo[playerid][pPosX]);
- INI_Float("pPosZ", PlayerInfo[playerid][pPosZ]);
- INI_Int("pInterior", PlayerInfo[playerid][pInterior]);
- INI_Int("pWorld", PlayerInfo[playerid][pWorld]);
- return 1;
- }
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- print("\nLoading first player's data..\n");
- INI_String("pPassword", PlayerInfo[playerid][pPassword], 128);
- print("\nLoading 2 player's data..\n");
- INI_String("pEmail", PlayerInfo[playerid][pEmail], 128);
- print("\nLoading 3 player's data..\n");
- INI_String("pGender", PlayerInfo[playerid][pGender], 128);
- INI_Int("pAge", PlayerInfo[playerid][pAge]);
- INI_String("pOrigin", PlayerInfo[playerid][pOrigin], 128);
- INI_Int("pDeaths", PlayerInfo[playerid][pDeaths]);
- INI_Int("pKills", PlayerInfo[playerid][pKills]);
- INI_Int("pMoney", PlayerInfo[playerid][pMoney]);
- INI_Int("pSkin", PlayerInfo[playerid][pSkin]);
- SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
- INI_Int("pBanned", PlayerInfo[playerid][pBanned]);
- INI_String("pBanReason", PlayerInfo[playerid][pBanReason], 128);
- INI_String("pBanBy", PlayerInfo[playerid][pBanBy], 128);
- INI_String("pBanExpire", PlayerInfo[playerid][pBanExpire], 128);
- INI_Int("pPlayerLevel", PlayerInfo[playerid][pPlayerLevel]);
- INI_Float("pPosY", PlayerInfo[playerid][pPosY]);
- printf("POSY LOADED ! %f", PlayerInfo[playerid][pPosY]);
- INI_Float("pPosX", PlayerInfo[playerid][pPosX]);
- INI_Float("pPosZ", PlayerInfo[playerid][pPosZ]);
- INI_Int("pInterior", PlayerInfo[playerid][pInterior]);
- INI_Int("pWorld", PlayerInfo[playerid][pWorld]);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "");
- TogglePlayerSpectating(playerid, 1);
- PasswordAttempts[playerid] = 3;
- new name[MAX_PLAYER_NAME];
- new dialog[200];
- GetPlayerName(playerid, name, sizeof(name));
- if(fexist(UserPath(playerid)))
- {
- new chemin[120];
- format(chemin, sizeof(chemin), "/Accounts/%i.ini", playerid);
- print("\nLoad infos\n");
- INI_ParseFile(chemin, "LoadUser_data", .bExtra = true, .extra = playerid);
- printf("Loaded? %f %f", PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY]);
- format(dialog, sizeof(dialog), "{FFFFFF}Welcome back to {82CAFF}"ServerNameShorted"{FFFFFF}, %s!\nInsert your password in order to start the fun!\n\nPassword Attempts left: 3", name);
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Login", dialog,"Login","");
- }
- else
- {
- ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Register", "{FFFFFF}Welcome to {82CAFF}"ServerNameShorted"{FFFFFF}!\nInsert a personal password in order to contine!","Register","");
- return 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == D_Register)
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Register", "{FFFFFF}Welcome to {82CAFF}"ServerNameShorted"{FFFFFF}!\nInsert a personal password in order to contine!","Register","");
- }
- else
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Register", "{FFFFFF}Welcome to {82CAFF}"ServerNameShorted"{FFFFFF}!\nInsert a personal password in order to contine!\n\n{FFFF00}You forgot to enter a password.","Register","");
- return 1;
- }
- else
- {
- ///new INI:file = INI_Open(Path(playerid));
- //INI_SetTag(file, "Stats");
- format(PlayerInfo[playerid][pPassword], 128, "%s", inputtext);
- printf("%s", PlayerInfo[playerid][pPassword]);
- //INI_WriteString(file, "pPassword", inputtext);
- //INI_Close(file);
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Register - Email", "{FFFFFF}If you want you may receive news letters by us via email, Up to you to decide.\nEnter your email if you want, else click None.","Contine","None");
- return 1;
- }
- }
- }
- if(dialogid == D_R_Mail)
- {
- if(!response)
- {
- new INI:file = INI_Open(Path(playerid));
- INI_WriteString(file, "pEmail", "None");
- INI_Close(file);
- ShowPlayerDialog(playerid, D_R_C_Gender, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Character - Gender", "{FFFFFF}What's your characters gender?\nClick the button to enter the gender.","Male","Female");
- }
- else
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Register - Email", "{FFFFFF}If you want you may receive news letters by us via email, Up to you to decide.\nEnter your email if you want, else click None.\n\n{FFFF00}You forgot to insert the mail.","Contine","None");
- return 1;
- }
- else
- {
- if(strfind(inputtext, "@", true))
- {
- //new INI:file = INI_Open(Path(playerid));
- format(PlayerInfo[playerid][pEmail], 128, "%s", inputtext);
- //INI_WriteString(file, "pEmail", inputtext);
- //INI_Close(file);
- ShowPlayerDialog(playerid, D_R_C_Gender, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Character - Gender", "{FFFFFF}What's your characters gender?\nClick the button to enter the gender.","Male","Female");
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Register - Email", "{FFFFFF}If you want you may receive news letters by us via email, Up to you to decide.\nEnter your email if you want, else click None.\n\n{FFFF00}You didn't insert a real email.","Contine","None");
- }
- return 1;
- }
- }
- }
- if(dialogid == D_R_C_Gender)
- {
- if(!response)
- {
- /*new INI:file = INI_Open(Path(playerid));
- INI_WriteString(file, "pGender", "Female");
- INI_Close(file);*/
- format(PlayerInfo[playerid][pGender], 128, "Female");
- ShowPlayerDialog(playerid, D_R_C_Age, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Character - Age", "{FFFFFF}What's your characters age?\nEnter the age of your character.","Contine","");
- }
- else
- {
- /*new INI:file = INI_Open(Path(playerid));
- INI_WriteString(file, "pGender", "Male");
- INI_Close(file);*/
- format(PlayerInfo[playerid][pGender], 128, "Male", inputtext);
- ShowPlayerDialog(playerid, D_R_C_Age, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Character - Age", "{FFFFFF}What's your characters age?\nEnter the age of your character.","Contine","");
- }
- }
- if(dialogid == D_R_C_Age)
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, D_R_C_Age, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Character - Age", "{FFFFFF}What's your characters age?\nEnter the age of your character.\n\n{FFFF00}You forgot to insert an age.","Contine","");
- }
- else
- {
- format(PlayerInfo[playerid][pAge], 128, "%i", inputtext);
- if(strval(inputtext) > 18 && strval(inputtext) < 51)
- {
- /*new INI:file = INI_Open(Path(playerid));
- INI_WriteInt(file, "pAge", strval(inputtext));
- INI_Close(file);*/
- PlayerInfo[playerid][pAge] = strval(inputtext);
- ShowPlayerDialog(playerid, D_R_C_Origin, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Character - Origin", "{FFFFFF}Where is your character from?\nEnter the place of birth of your character.","Contine","");
- }
- else
- {
- ShowPlayerDialog(playerid, D_R_C_Age, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Character - Age", "{FFFFFF}What's your characters age?\nEnter the age of your character.\n\n{FFFF00}You need to be over 19 and under 50 years old!","Contine","");
- }
- }
- }
- if(dialogid == D_R_C_Origin)
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, D_R_C_Origin, DIALOG_STYLE_INPUT, "{82CAFF}"ServerName"{FFFFFF}: Character - Origin", "{FFFFFF}Where is your character from?\nEnter the place of birth of your character.\n\n{FFFF00}You forgot to enter a place of birth.","Contine","");
- }
- else
- {
- format(PlayerInfo[playerid][pOrigin], 128, "%s", inputtext);
- /*new INI:file = INI_Open(Path(playerid));
- INI_WriteString(file, "pOrigin", inputtext);
- INI_Close(file);*/
- printf("pass : %s", PlayerInfo[playerid][pPassword]);
- printf("email : %s", PlayerInfo[playerid][pEmail]);
- printf("gender : %s", PlayerInfo[playerid][pGender]);
- printf("age : %i", PlayerInfo[playerid][pAge]);
- printf("origin : %s", PlayerInfo[playerid][pOrigin]);
- RulesTimer[playerid] = 15;
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Deathmatching{FFFFFF} You are not allowed to deathmatch anyone, Even if they did something to you OOC, You will be punished.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Car Ramming{FFFFFF} This rule is tricky, You're allowed to ram someone, But you need to roleplay it correctly, without powergaming.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither to roleplayers, Doing so will result a 15 minute kick to calm down.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Non RP Conducts{FFFFFF} GTA SA:MP Roleplay isn't just about getting money, beeing a \"gangster\", beeing a faction, It's about to actually Roleplay -..\n");
- strcat(strca, " -.. so we suggest you to not just be a criminal, It's not against the rules, we just don't want everyone to run around with weapons, robbing newbies and other people. Play fair.\n");
- ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,"15","");
- SetTimerEx("DialogTimer", 1000, false, "i", playerid);
- }
- }
- if(dialogid == D_R_Rules)
- {
- if(!response)
- {
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Deathmatching{FFFFFF} You are not allowed to deathmatch anyone, Even if they did something to you OOC, You will be punished.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Car Ramming{FFFFFF} This rule is tricky, You're allowed to ram someone, But you need to roleplay it correctly, without powergaming.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither to roleplayers, Doing so will result a 15 minute kick to calm down.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Non RP Conducts{FFFFFF} GTA SA:MP Roleplay isn't just about getting money, beeing a \"gangster\", beeing a faction, It's about to actually Roleplay -..\n");
- strcat(strca, " -.. so we suggest you to not just be a criminal, It's not against the rules, we just don't want everyone to run around with weapons, robbing newbies and other people. Play fair.");
- ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,"15","");
- }
- else
- {
- if(RulesTimer[playerid] < 2)
- {
- new strca[952];
- RulesTimer[playerid] = 10;
- strcat(strca, "{FFFFFF}- {8C1717}Insulting/Harrasing{FFFFFF} Don't harrass any one in our server, Be nice, friednly. We do not accept any bad attitude.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Bunny jumping{FFFFFF} You may npt Bunny Jump, This is to jump while running to get faster to your destiny.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Begging{FFFFFF} Don't beg for any sort of membership such as VIP, Admin, Helper, and etc, Doing this will result an account flag.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF} There's of course more rules that's not written here, If you're insecure, You can simply use /a(dmin)m(essage) or /m(oderator)m(essage)");
- ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,"10","");
- SetTimerEx("DialogTimer2", 1000, false, "i", playerid);
- }
- else
- {
- new timer_dialog[255];
- format(timer_dialog, sizeof(timer_dialog), "%i", RulesTimer[playerid]);
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Deathmatching{FFFFFF} You are not allowed to deathmatch anyone, Even if they did something to you OOC, You will be punished.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Car Ramming{FFFFFF} This rule is tricky, You're allowed to ram someone, But you need to roleplay it correctly, without powergaming.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither to roleplayers, Doing so will result a 15 minute kick to calm down.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Non RP Conducts{FFFFFF} GTA SA:MP Roleplay isn't just about getting money, beeing a \"gangster\", beeing a faction, It's about to actually Roleplay -..\n");
- strcat(strca, " -.. so we suggest you to not just be a criminal, It's not against the rules, we just don't want everyone to run around with weapons, robbing newbies and other people. Play fair.");
- ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,timer_dialog,"");
- }
- }
- }
- if(dialogid == D_R_Rules2)
- {
- if(!response)
- {
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Insulting/Harrasing{FFFFFF} Don't harrass any one in our server, Be nice, friednly. We do not accept any bad attitude.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Bunny jumping{FFFFFF} You may npt Bunny Jump, This is to jump while running to get faster to your destiny.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Begging{FFFFFF} Don't beg for any sort of membership such as VIP, Admin, Helper, and etc, Doing this will result an account flag.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF} There's of course more rules that's not written here, If you're insecure, You can simply use /a(dmin)m(essage) or /m(oderator)m(essage)");
- ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,"10","");
- }
- else
- {
- if(RulesTimer[playerid] < 2)
- {
- TogglePlayerSpectating(playerid, 0);
- SetSpawnInfo(playerid, 0, 0, 1743.1300, -1861.9683, 13.5769, 359.2573, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- if(strcmp(PlayerInfo[playerid][pGender], "Male"))
- {
- SetPlayerSkin(playerid, 93);
- }
- else
- {
- SetPlayerSkin(playerid, 17);
- }
- SetPlayerPos(playerid, 1743.1300, -1861.9683, 13.5769);
- SetPlayerFacingAngle(playerid, 359.2573);
- GivePlayerMoney(playerid, 12500);
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome to New City Roleplay! Are you in need of help? Feel free to use /m(oderator)m(essage)!");
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] You have received a refund by the server! You may use /o(oc)c(hat) to chat globaly.");
- new message[255];
- new name[MAX_PLAYER_NAME];
- format(message, 255, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome our newest user %s to NCRP!", GetPlayerName(playerid, name, sizeof(name)));
- SendClientMessageToAll(-1, message);
- format(PlayerInfo[playerid][pBanReason], 128, "None");
- format(PlayerInfo[playerid][pBanBy], 128, "None");
- format(PlayerInfo[playerid][pBanExpire], 128, "None");
- PlayerInfo[playerid][pPlayerLevel] = 0;
- new INI:file = INI_Open(Path(playerid));
- //INI_SetTag(file,"Stats");
- INI_WriteString(file,"pPassword", PlayerInfo[playerid][pPassword]);
- INI_WriteString(file,"pEmail", PlayerInfo[playerid][pEmail]);
- INI_WriteString(file,"pGender", PlayerInfo[playerid][pGender]);
- INI_WriteInt(file,"pAge", PlayerInfo[playerid][pAge]);
- INI_WriteString(file,"pOrigin", PlayerInfo[playerid][pOrigin]);
- INI_WriteInt(file,"pDeaths", PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(file,"pKills", PlayerInfo[playerid][pKills]);
- INI_WriteInt(file,"pMoney", GetPlayerMoney(playerid));
- INI_WriteInt(file,"pSkin", GetPlayerSkin(playerid));
- INI_WriteInt(file,"pBanned", 0);
- INI_WriteString(file,"pBanReason", "none");
- INI_WriteString(file,"pBanBy", "none");
- INI_WriteString(file,"pBanExpire", "none");
- INI_WriteInt(file,"pPlayerLevel", 0);
- INI_WriteFloat(file,"pPosY", 1743.1300);
- INI_WriteFloat(file,"pPosX", -1861.9683);
- INI_WriteFloat(file,"pPosZ", 13.5769);
- INI_WriteInt(file,"pInterior", 0);
- INI_WriteInt(file,"pWorld", 0);
- INI_Close(file);
- }
- else
- {
- new timer_dialog[255];
- format(timer_dialog, sizeof(timer_dialog), "%i", RulesTimer[playerid]);
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Insulting/Harrasing{FFFFFF} Don't harrass any one in our server, Be nice, friednly. We do not accept any bad attitude.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Bunny jumping{FFFFFF} You may npt Bunny Jump, This is to jump while running to get faster to your destiny.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Begging{FFFFFF} Don't beg for any sort of membership such as VIP, Admin, Helper, and etc, Doing this will result an account flag.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF} There's of course more rules that's not written here, If you're insecure, You can simply use /a(dmin)m(essage) or /m(oderator)m(essage)");
- ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,timer_dialog,"");
- }
- }
- }
- if(dialogid == D_Login)
- {
- if(!response)
- {
- new name[MAX_PLAYER_NAME];
- new dialog[200];
- format(dialog, sizeof(dialog), "{FFFFFF}Welcome back to {82CAFF}"ServerNameShorted"{FFFFFF}, %s!\nInsert your password in order to start the fun!\n\nPassword Attempts left: 2", name);
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Login", dialog,"Login","");
- }
- if(response)
- {
- if(!strcmp(inputtext, PlayerInfo[playerid][pPassword], false))
- {
- TogglePlayerSpectating(playerid, 0);
- //INI_ParseFile(UserPath(playerid), "CheckAndLoad_%s", .bExtra = true, .extra = playerid);
- new chemin[120];
- format(chemin, sizeof(chemin), "/Accounts/%i.ini", playerid);
- INI_ParseFile(chemin, "LoadUser_%s", .bExtra = true, .extra = playerid);
- print("Loaded player's data ...");
- SendClientMessage(playerid,-1,"{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome back to NCRP, Enjoy your stay here!");
- SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 359.2573, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
- printf("X: %.2f - Y: %.2f - Z: %.2f", PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
- SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
- printf("Interior : %i", PlayerInfo[playerid][pInterior]);
- SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pWorld]);
- printf("VirtualWorld : %i", PlayerInfo[playerid][pWorld]);
- SetPlayerScore(playerid, PlayerInfo[playerid][pPlayerLevel]);
- printf("Level : %i", PlayerInfo[playerid][pPlayerLevel]);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
- printf("Money : %i", PlayerInfo[playerid][pMoney]);
- SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
- printf("Skin : %i", PlayerInfo[playerid][pSkin]);
- }
- else
- {
- new name[MAX_PLAYER_NAME];
- new dialog[200];
- format(dialog, sizeof(dialog), "{FFFFFF}Welcome back to {82CAFF}"ServerNameShorted"{FFFFFF}, %s!\nInsert your password in order to start the fun!\n\nPassword Attempts left: 2", name);
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Login", dialog,"Login","");
- return 1;
- }
- }
- }
- return 1;
- }
- public DialogTimer(playerid)
- {
- if(RulesTimer[playerid] == 1)
- {
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Deathmatching{FFFFFF} You are not allowed to deathmatch anyone, Even if they did something to you OOC, You will be punished.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Car Ramming{FFFFFF} This rule is tricky, You're allowed to ram someone, But you need to roleplay it correctly, without powergaming.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither to roleplayers, Doing so will result a 15 minute kick to calm down.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Non RP Conducts{FFFFFF} GTA SA:MP Roleplay isn't just about getting money, beeing a \"gangster\", beeing a faction, It's about to actually Roleplay -..\n");
- strcat(strca, " -.. so we suggest you to not just be a criminal, It's not against the rules, we just don't want everyone to run around with weapons, robbing newbies and other people. Play fair.\n");
- ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,"Contine","");
- }
- else
- {
- RulesTimer[playerid]--;
- new timer_dialog[255];
- format(timer_dialog, sizeof(timer_dialog), "%i", RulesTimer[playerid]);
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Deathmatching{FFFFFF} You are not allowed to deathmatch anyone, Even if they did something to you OOC, You will be punished.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Car Ramming{FFFFFF} This rule is tricky, You're allowed to ram someone, But you need to roleplay it correctly, without powergaming.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither to roleplayers, Doing so will result a 15 minute kick to calm down.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Non RP Conducts{FFFFFF} GTA SA:MP Roleplay isn't just about getting money, beeing a \"gangster\", beeing a faction, It's about to actually Roleplay -..\n");
- strcat(strca, " -.. so we suggest you to not just be a criminal, It's not against the rules, we just don't want everyone to run around with weapons, robbing newbies and other people. Play fair.");
- ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,timer_dialog,"");
- SetTimerEx("DialogTimer", 1000, false, "i", playerid);
- }
- return 1;
- }
- public DialogTimer2(playerid)
- {
- if(RulesTimer[playerid] == 1)
- {
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Insulting/Harrasing{FFFFFF} Don't harrass any one in our server, Be nice, friednly. We do not accept any bad attitude.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Bunny jumping{FFFFFF} You may npt Bunny Jump, This is to jump while running to get faster to your destiny.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Begging{FFFFFF} Don't beg for any sort of membership such as VIP, Admin, Helper, and etc, Doing this will result an account flag.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF} There's of course more rules that's not written here, If you're insecure, You can simply use /a(dmin)m(essage) or /m(oderator)m(essage)");
- ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,"Contine","");
- }
- else
- {
- RulesTimer[playerid]--;
- new timer_dialog[255];
- format(timer_dialog, sizeof(timer_dialog), "%i", RulesTimer[playerid]);
- new strca[952];
- strcat(strca, "{FFFFFF}- {8C1717}Insulting/Harrasing{FFFFFF} Don't harrass any one in our server, Be nice, friednly. We do not accept any bad attitude.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Bunny jumping{FFFFFF} You may npt Bunny Jump, This is to jump while running to get faster to your destiny.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Begging{FFFFFF} Don't beg for any sort of membership such as VIP, Admin, Helper, and etc, Doing this will result an account flag.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
- strcat(strca, "{FFFFFF}- {8C1717}Revenge Killing{FFFFFF} If someone killed you, You cannot go back and kill them as revenge, Remember that you forget 30minutes of your past life after death.\n");
- strcat(strca, "{FFFFFF} There's of course more rules that's not written here, If you're insecure, You can simply use /a(dmin)m(essage) or /m(oderator)m(essage)");
- ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,timer_dialog,"");
- SetTimerEx("DialogTimer2", 1000, false, "i", playerid);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- /*new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new INI:file = INI_Open(Path(playerid));
- INI_SetTag(file,"Stats");
- INI_WriteString(file,"pPassword", PlayerInfo[playerid][pPassword]);
- INI_WriteString(file,"pEmail", PlayerInfo[playerid][pEmail]);
- INI_WriteString(file,"pGender", PlayerInfo[playerid][pGender]);
- INI_WriteInt(file,"pAge", PlayerInfo[playerid][pAge]);
- INI_WriteString(file,"pOrigin", PlayerInfo[playerid][pOrigin]);
- INI_WriteInt(file,"pDeaths", PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(file,"pKills", PlayerInfo[playerid][pKills]);
- INI_WriteInt(file,"pMoney", GetPlayerMoney(playerid));
- INI_WriteInt(file,"pSkin", GetPlayerSkin(playerid));
- INI_WriteInt(file,"pBanned", PlayerInfo[playerid][pBanned]);
- INI_WriteString(file,"pBanReason", PlayerInfo[playerid][pBanReason]);
- INI_WriteString(file,"pBanBy", PlayerInfo[playerid][pBanBy]);
- INI_WriteString(file,"pBanExpire", PlayerInfo[playerid][pBanExpire]);
- INI_WriteInt(file,"pPlayerLevel", GetPlayerScore(playerid));
- INI_WriteFloat(file,"pPosY", y);
- INI_WriteFloat(file,"pPosX", x);
- INI_WriteFloat(file,"pPosZ", z);
- INI_WriteInt(file,"pInterior", GetPlayerInterior(playerid));
- INI_WriteInt(file,"pWorld", GetPlayerVirtualWorld(playerid));
- INI_Close(file);*/
- return 1;
- }
- /* Stocks */
- stock Path(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(strings, sizeof(strings), "Accounts/%s.ini", name);
- return strings;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- print("USERPATH");
- return string;
- }
- stock UserRPName(playerid)
- {
- new uname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,uname,sizeof(uname));
- for(new i = 0; i < MAX_PLAYER_NAME; i++)
- {
- if(uname[i] == '_') uname[i] = ' ';
- }
- return strings;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement