Advertisement
Dayrion

GM

May 14th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 33.65 KB | None | 0 0
  1. /*     Includes     */
  2. #include <a_samp>
  3. #include <YSI\y_ini>
  4.  
  5. /*     Defines     */
  6. #define         ServerName               "New City Role Play"
  7. #define         ServerNameShorted        "NCRP"
  8.  
  9. #define         D_Login         100
  10. #define         D_Register      200
  11. #define         D_R_Mail        201
  12. #define         D_R_C_Gender    202
  13. #define         D_R_C_Age       203
  14. #define         D_R_C_Origin    204
  15. #define         D_R_Rules       205
  16. #define         D_R_Rules2      206
  17. #define         D_R_Quiz        207
  18. #define         D_R_Quiz2       208
  19. #define PATH    "Accounts/%s.ini"
  20.  
  21. /*     News     */
  22. enum pStats
  23. {
  24.     pID,
  25.     pPassword[128],
  26.     pEmail[128],
  27.     pGender[128],
  28.     pAge,
  29.     pOrigin[128],
  30.     pDeaths,
  31.     pKills,
  32.     pMoney,
  33.     pSkin,
  34.     pBanned,
  35.     pBanReason[128],
  36.     pBanBy[128],
  37.     pBanExpire[128],
  38.     pPasswordAttempts,
  39.     pPlayerLevel,
  40.     Float: pPosY,
  41.     Float: pPosX,
  42.     Float: pPosZ,
  43.     pInterior,
  44.     pWorld
  45. };
  46.  
  47. new PlayerInfo[MAX_PLAYERS][pStats],
  48.     strings[128],
  49.     PasswordAttempts[MAX_PLAYERS],
  50.     RulesTimer[MAX_PLAYERS];
  51. /*     Normal     */
  52. main()
  53. {
  54.     print("\n[Launch] Creating GameMode: New City RolePlay");
  55. }
  56.  
  57. forward CheckAndLoad_data(playerid, name[], value[]);
  58. forward DialogTimer(playerid);
  59. forward DialogTimer2(playerid);
  60.  
  61. /*     Publics     */
  62. public OnGameModeInit()
  63. {
  64.     SetGameModeText("NCRP - V0.10.0");
  65.     return 1;
  66. }
  67.  
  68. public CheckAndLoad_data(playerid, name[], value[])
  69. {
  70.     print("\nLoading first player's data..\n");
  71.     INI_String("pPassword", PlayerInfo[playerid][pPassword], 128);
  72.     INI_String("pEmail", PlayerInfo[playerid][pEmail], 128);
  73.     INI_String("pGender", PlayerInfo[playerid][pGender], 128);
  74.     INI_Int("pAge", PlayerInfo[playerid][pAge]);
  75.     INI_String("pOrigin", PlayerInfo[playerid][pOrigin], 128);
  76.     INI_Int("pDeaths", PlayerInfo[playerid][pDeaths]);
  77.     INI_Int("pKills", PlayerInfo[playerid][pKills]);
  78.     INI_Int("pMoney", PlayerInfo[playerid][pMoney]);
  79.     INI_Int("pSkin", PlayerInfo[playerid][pSkin]);
  80.     INI_Int("pBanned", PlayerInfo[playerid][pBanned]);
  81.     INI_String("pBanReason", PlayerInfo[playerid][pBanReason], 128);
  82.     INI_String("pBanBy", PlayerInfo[playerid][pBanBy], 128);
  83.     INI_String("pBanExpire", PlayerInfo[playerid][pBanExpire], 128);
  84.     INI_Int("pPlayerLevel", PlayerInfo[playerid][pPlayerLevel]);
  85.     INI_Float("pPosY", PlayerInfo[playerid][pPosY]);
  86.     printf("POSY LOADED ! %f", PlayerInfo[playerid][pPosY]);
  87.     INI_Float("pPosX", PlayerInfo[playerid][pPosX]);
  88.     INI_Float("pPosZ", PlayerInfo[playerid][pPosZ]);
  89.     INI_Int("pInterior", PlayerInfo[playerid][pInterior]);
  90.     INI_Int("pWorld", PlayerInfo[playerid][pWorld]);
  91.     return 1;
  92. }
  93.  
  94. forward LoadUser_data(playerid,name[],value[]);
  95. public LoadUser_data(playerid,name[],value[])
  96. {
  97.     print("\nLoading first player's data..\n");
  98.     INI_String("pPassword", PlayerInfo[playerid][pPassword], 128);
  99.     print("\nLoading 2 player's data..\n");
  100.     INI_String("pEmail", PlayerInfo[playerid][pEmail], 128);
  101.     print("\nLoading 3 player's data..\n");
  102.     INI_String("pGender", PlayerInfo[playerid][pGender], 128);
  103.     INI_Int("pAge", PlayerInfo[playerid][pAge]);
  104.     INI_String("pOrigin", PlayerInfo[playerid][pOrigin], 128);
  105.     INI_Int("pDeaths", PlayerInfo[playerid][pDeaths]);
  106.     INI_Int("pKills", PlayerInfo[playerid][pKills]);
  107.     INI_Int("pMoney", PlayerInfo[playerid][pMoney]);
  108.     INI_Int("pSkin", PlayerInfo[playerid][pSkin]);
  109.     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  110.     INI_Int("pBanned", PlayerInfo[playerid][pBanned]);
  111.     INI_String("pBanReason", PlayerInfo[playerid][pBanReason], 128);
  112.     INI_String("pBanBy", PlayerInfo[playerid][pBanBy], 128);
  113.     INI_String("pBanExpire", PlayerInfo[playerid][pBanExpire], 128);
  114.     INI_Int("pPlayerLevel", PlayerInfo[playerid][pPlayerLevel]);
  115.     INI_Float("pPosY", PlayerInfo[playerid][pPosY]);
  116.     printf("POSY LOADED ! %f", PlayerInfo[playerid][pPosY]);
  117.     INI_Float("pPosX", PlayerInfo[playerid][pPosX]);
  118.     INI_Float("pPosZ", PlayerInfo[playerid][pPosZ]);
  119.     INI_Int("pInterior", PlayerInfo[playerid][pInterior]);
  120.     INI_Int("pWorld", PlayerInfo[playerid][pWorld]);
  121.     return 1;
  122. }
  123.  
  124.  
  125. public OnPlayerConnect(playerid)
  126. {
  127.     SendClientMessage(playerid, -1, "");
  128.     SendClientMessage(playerid, -1, "");
  129.     SendClientMessage(playerid, -1, "");
  130.     SendClientMessage(playerid, -1, "");
  131.     SendClientMessage(playerid, -1, "");
  132.     SendClientMessage(playerid, -1, "");
  133.     SendClientMessage(playerid, -1, "");
  134.     SendClientMessage(playerid, -1, "");
  135.     SendClientMessage(playerid, -1, "");
  136.     SendClientMessage(playerid, -1, "");
  137.     SendClientMessage(playerid, -1, "");
  138.     SendClientMessage(playerid, -1, "");
  139.     SendClientMessage(playerid, -1, "");
  140.     SendClientMessage(playerid, -1, "");
  141.     SendClientMessage(playerid, -1, "");
  142.     SendClientMessage(playerid, -1, "");
  143.     SendClientMessage(playerid, -1, "");
  144.     TogglePlayerSpectating(playerid, 1);
  145.     PasswordAttempts[playerid] = 3;
  146.     new name[MAX_PLAYER_NAME];
  147.     new dialog[200];
  148.     GetPlayerName(playerid, name, sizeof(name));
  149.     if(fexist(UserPath(playerid)))
  150.     {
  151.         new chemin[120];
  152.         format(chemin, sizeof(chemin), "/Accounts/%i.ini", playerid);
  153.         print("\nLoad infos\n");
  154.         INI_ParseFile(chemin, "LoadUser_data", .bExtra = true, .extra = playerid);
  155.         printf("Loaded? %f %f", PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY]);
  156.         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);
  157.         ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Login", dialog,"Login","");
  158.     }
  159.     else
  160.     {
  161.         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","");
  162.         return 1;
  163.     }
  164.     return 1;
  165. }
  166.  
  167. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  168. {
  169.     if(dialogid == D_Register)
  170.     {
  171.         if(!response)
  172.         {
  173.             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","");
  174.         }
  175.         else
  176.         {
  177.             if(!strlen(inputtext))
  178.             {
  179.                 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","");
  180.                 return 1;
  181.             }
  182.             else
  183.             {
  184.                 ///new INI:file = INI_Open(Path(playerid));
  185.                 //INI_SetTag(file, "Stats");
  186.                 format(PlayerInfo[playerid][pPassword], 128, "%s", inputtext);
  187.                 printf("%s", PlayerInfo[playerid][pPassword]);
  188.                 //INI_WriteString(file, "pPassword", inputtext);
  189.                 //INI_Close(file);
  190.                 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");
  191.                 return 1;
  192.             }
  193.         }
  194.     }
  195.     if(dialogid == D_R_Mail)
  196.     {
  197.         if(!response)
  198.         {
  199.             new INI:file = INI_Open(Path(playerid));
  200.             INI_WriteString(file, "pEmail", "None");
  201.             INI_Close(file);
  202.             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");
  203.         }
  204.         else
  205.         {
  206.             if(!strlen(inputtext))
  207.             {
  208.                 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");
  209.                 return 1;
  210.             }
  211.             else
  212.             {
  213.                 if(strfind(inputtext, "@", true))
  214.                 {
  215.                     //new INI:file = INI_Open(Path(playerid));
  216.                     format(PlayerInfo[playerid][pEmail], 128, "%s", inputtext);
  217.                     //INI_WriteString(file, "pEmail", inputtext);
  218.                     //INI_Close(file);
  219.                     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");
  220.                 }
  221.                 else
  222.                 {
  223.                     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");
  224.                 }
  225.                 return 1;
  226.             }
  227.         }
  228.     }
  229.     if(dialogid == D_R_C_Gender)
  230.     {
  231.         if(!response)
  232.         {
  233.             /*new INI:file = INI_Open(Path(playerid));
  234.             INI_WriteString(file, "pGender", "Female");
  235.             INI_Close(file);*/
  236.             format(PlayerInfo[playerid][pGender], 128, "Female");
  237.             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","");
  238.         }
  239.         else
  240.         {
  241.             /*new INI:file = INI_Open(Path(playerid));
  242.             INI_WriteString(file, "pGender", "Male");
  243.             INI_Close(file);*/
  244.             format(PlayerInfo[playerid][pGender], 128, "Male", inputtext);
  245.             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","");
  246.         }
  247.     }
  248.     if(dialogid == D_R_C_Age)
  249.     {
  250.         if(!response)
  251.         {
  252.             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","");
  253.         }
  254.         else
  255.         {
  256.             format(PlayerInfo[playerid][pAge], 128, "%i", inputtext);
  257.             if(strval(inputtext) > 18 && strval(inputtext) < 51)
  258.             {
  259.                 /*new INI:file = INI_Open(Path(playerid));
  260.                 INI_WriteInt(file, "pAge", strval(inputtext));
  261.                 INI_Close(file);*/
  262.                 PlayerInfo[playerid][pAge] = strval(inputtext);
  263.                 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","");
  264.             }
  265.             else
  266.             {
  267.                 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","");
  268.             }
  269.         }
  270.     }
  271.     if(dialogid == D_R_C_Origin)
  272.     {
  273.         if(!response)
  274.         {
  275.             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","");
  276.         }
  277.         else
  278.         {
  279.             format(PlayerInfo[playerid][pOrigin], 128, "%s", inputtext);
  280.             /*new INI:file = INI_Open(Path(playerid));
  281.             INI_WriteString(file, "pOrigin", inputtext);
  282.             INI_Close(file);*/
  283.             printf("pass : %s", PlayerInfo[playerid][pPassword]);
  284.             printf("email : %s", PlayerInfo[playerid][pEmail]);
  285.             printf("gender : %s", PlayerInfo[playerid][pGender]);
  286.             printf("age : %i", PlayerInfo[playerid][pAge]);
  287.             printf("origin : %s", PlayerInfo[playerid][pOrigin]);
  288.             RulesTimer[playerid] = 15;
  289.             new strca[952];
  290.             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");
  291.             strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
  292.             strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
  293.             strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
  294.             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");
  295.             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");
  296.             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");
  297.             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");
  298.             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");
  299.             ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,"15","");
  300.             SetTimerEx("DialogTimer", 1000, false, "i", playerid);
  301.         }
  302.     }
  303.     if(dialogid == D_R_Rules)
  304.     {
  305.         if(!response)
  306.         {
  307.             new strca[952];
  308.             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");
  309.             strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
  310.             strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
  311.             strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
  312.             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");
  313.             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");
  314.             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");
  315.             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");
  316.             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.");
  317.             ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,"15","");
  318.         }
  319.         else
  320.         {
  321.             if(RulesTimer[playerid] < 2)
  322.             {
  323.                 new strca[952];
  324.                 RulesTimer[playerid] = 10;
  325.                 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");
  326.                 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");
  327.                 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");
  328.                 strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
  329.                 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");
  330.                 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)");
  331.                 ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,"10","");
  332.                 SetTimerEx("DialogTimer2", 1000, false, "i", playerid);
  333.             }
  334.             else
  335.             {
  336.                 new timer_dialog[255];
  337.                 format(timer_dialog, sizeof(timer_dialog), "%i", RulesTimer[playerid]);
  338.                 new strca[952];
  339.                 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");
  340.                 strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
  341.                 strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
  342.                 strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
  343.                 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");
  344.                 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");
  345.                 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");
  346.                 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");
  347.                 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.");
  348.                 ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,timer_dialog,"");
  349.             }
  350.         }
  351.     }
  352.     if(dialogid == D_R_Rules2)
  353.     {
  354.         if(!response)
  355.         {
  356.             new strca[952];
  357.             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");
  358.             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");
  359.             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");
  360.             strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
  361.             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");
  362.             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)");
  363.             ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,"10","");
  364.         }
  365.         else
  366.         {
  367.             if(RulesTimer[playerid] < 2)
  368.             {
  369.                 TogglePlayerSpectating(playerid, 0);
  370.                 SetSpawnInfo(playerid, 0, 0, 1743.1300, -1861.9683, 13.5769, 359.2573, 0, 0, 0, 0, 0, 0);
  371.                 SpawnPlayer(playerid);
  372.                 if(strcmp(PlayerInfo[playerid][pGender], "Male"))
  373.                 {
  374.                     SetPlayerSkin(playerid, 93);
  375.                 }
  376.                 else
  377.                 {
  378.                     SetPlayerSkin(playerid, 17);
  379.                 }
  380.                 SetPlayerPos(playerid, 1743.1300, -1861.9683, 13.5769);
  381.                 SetPlayerFacingAngle(playerid, 359.2573);
  382.                 GivePlayerMoney(playerid, 12500);
  383.                 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)!");
  384.                 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.");
  385.                 new message[255];
  386.                 new name[MAX_PLAYER_NAME];
  387.                 format(message, 255, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome our newest user %s to NCRP!", GetPlayerName(playerid, name, sizeof(name)));
  388.                 SendClientMessageToAll(-1, message);
  389.                 format(PlayerInfo[playerid][pBanReason], 128, "None");
  390.                 format(PlayerInfo[playerid][pBanBy], 128, "None");
  391.                 format(PlayerInfo[playerid][pBanExpire], 128, "None");
  392.                 PlayerInfo[playerid][pPlayerLevel] = 0;
  393.                 new INI:file = INI_Open(Path(playerid));
  394.                 //INI_SetTag(file,"Stats");
  395.                 INI_WriteString(file,"pPassword", PlayerInfo[playerid][pPassword]);
  396.                 INI_WriteString(file,"pEmail", PlayerInfo[playerid][pEmail]);
  397.                 INI_WriteString(file,"pGender", PlayerInfo[playerid][pGender]);
  398.                 INI_WriteInt(file,"pAge", PlayerInfo[playerid][pAge]);
  399.                 INI_WriteString(file,"pOrigin", PlayerInfo[playerid][pOrigin]);
  400.                 INI_WriteInt(file,"pDeaths", PlayerInfo[playerid][pDeaths]);
  401.                 INI_WriteInt(file,"pKills", PlayerInfo[playerid][pKills]);
  402.                 INI_WriteInt(file,"pMoney", GetPlayerMoney(playerid));
  403.                 INI_WriteInt(file,"pSkin", GetPlayerSkin(playerid));
  404.                 INI_WriteInt(file,"pBanned", 0);
  405.                 INI_WriteString(file,"pBanReason", "none");
  406.                 INI_WriteString(file,"pBanBy", "none");
  407.                 INI_WriteString(file,"pBanExpire", "none");
  408.                 INI_WriteInt(file,"pPlayerLevel", 0);
  409.                 INI_WriteFloat(file,"pPosY", 1743.1300);
  410.                 INI_WriteFloat(file,"pPosX", -1861.9683);
  411.                 INI_WriteFloat(file,"pPosZ", 13.5769);
  412.                 INI_WriteInt(file,"pInterior", 0);
  413.                 INI_WriteInt(file,"pWorld", 0);
  414.                 INI_Close(file);
  415.             }
  416.             else
  417.             {
  418.                 new timer_dialog[255];
  419.                 format(timer_dialog, sizeof(timer_dialog), "%i", RulesTimer[playerid]);
  420.                 new strca[952];
  421.                 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");
  422.                 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");
  423.                 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");
  424.                 strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
  425.                 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");
  426.                 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)");
  427.                 ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,timer_dialog,"");
  428.             }
  429.         }
  430.     }
  431.     if(dialogid == D_Login)
  432.     {
  433.         if(!response)
  434.         {
  435.             new name[MAX_PLAYER_NAME];
  436.             new dialog[200];
  437.             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);
  438.             ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Login", dialog,"Login","");
  439.         }
  440.         if(response)
  441.         {
  442.             if(!strcmp(inputtext, PlayerInfo[playerid][pPassword], false))
  443.             {
  444.                 TogglePlayerSpectating(playerid, 0);
  445.                
  446.                 //INI_ParseFile(UserPath(playerid), "CheckAndLoad_%s", .bExtra = true, .extra = playerid);
  447.                 new chemin[120];
  448.                 format(chemin, sizeof(chemin), "/Accounts/%i.ini", playerid);
  449.                 INI_ParseFile(chemin, "LoadUser_%s", .bExtra = true, .extra = playerid);
  450.                 print("Loaded player's data ...");
  451.                 SendClientMessage(playerid,-1,"{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome back to NCRP, Enjoy your stay here!");
  452.                 SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 359.2573, 0, 0, 0, 0, 0, 0);
  453.                 SpawnPlayer(playerid);
  454.                 SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
  455.                 printf("X: %.2f - Y: %.2f - Z: %.2f", PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
  456.                 SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
  457.                 printf("Interior : %i", PlayerInfo[playerid][pInterior]);
  458.                 SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pWorld]);
  459.                 printf("VirtualWorld : %i", PlayerInfo[playerid][pWorld]);
  460.                 SetPlayerScore(playerid, PlayerInfo[playerid][pPlayerLevel]);
  461.                 printf("Level : %i", PlayerInfo[playerid][pPlayerLevel]);
  462.                 GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  463.                 printf("Money : %i", PlayerInfo[playerid][pMoney]);
  464.                 SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  465.                 printf("Skin : %i", PlayerInfo[playerid][pSkin]);
  466.             }
  467.             else
  468.             {
  469.                 new name[MAX_PLAYER_NAME];
  470.                 new dialog[200];
  471.                 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);
  472.                 ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD, "{82CAFF}"ServerName"{FFFFFF}: Login", dialog,"Login","");
  473.                 return 1;
  474.             }
  475.         }
  476.     }
  477.     return 1;
  478. }
  479.  
  480. public DialogTimer(playerid)
  481. {
  482.     if(RulesTimer[playerid] == 1)
  483.     {
  484.         new strca[952];
  485.         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");
  486.         strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
  487.         strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
  488.         strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
  489.         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");
  490.         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");
  491.         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");
  492.         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");
  493.         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");
  494.         ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,"Contine","");
  495.  
  496.     }
  497.     else
  498.     {
  499.         RulesTimer[playerid]--;
  500.         new timer_dialog[255];
  501.         format(timer_dialog, sizeof(timer_dialog), "%i", RulesTimer[playerid]);
  502.         new strca[952];
  503.         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");
  504.         strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
  505.         strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
  506.         strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
  507.         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");
  508.         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");
  509.         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");
  510.         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");
  511.         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.");
  512.         ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 1 of 2", strca,timer_dialog,"");
  513.         SetTimerEx("DialogTimer", 1000, false, "i", playerid);
  514.     }
  515.     return 1;
  516. }
  517.  
  518. public DialogTimer2(playerid)
  519. {
  520.     if(RulesTimer[playerid] == 1)
  521.     {
  522.         new strca[952];
  523.         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");
  524.         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");
  525.         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");
  526.         strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
  527.         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");
  528.         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)");
  529.         ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,"Contine","");
  530.  
  531.     }
  532.     else
  533.     {
  534.         RulesTimer[playerid]--;
  535.         new timer_dialog[255];
  536.         format(timer_dialog, sizeof(timer_dialog), "%i", RulesTimer[playerid]);
  537.         new strca[952];
  538.         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");
  539.         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");
  540.         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");
  541.         strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
  542.         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");
  543.         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)");
  544.         ShowPlayerDialog(playerid, D_R_Rules2, DIALOG_STYLE_MSGBOX, "{82CAFF}"ServerName"{FFFFFF}: Rules - Page 2 of 2", strca,timer_dialog,"");
  545.         SetTimerEx("DialogTimer2", 1000, false, "i", playerid);
  546.     }
  547.     return 1;
  548. }
  549.  
  550. public OnPlayerDisconnect(playerid, reason)
  551. {
  552.         /*new Float:x, Float:y, Float:z;
  553.         GetPlayerPos(playerid, x, y, z);
  554.         new INI:file = INI_Open(Path(playerid));
  555.         INI_SetTag(file,"Stats");
  556.         INI_WriteString(file,"pPassword", PlayerInfo[playerid][pPassword]);
  557.         INI_WriteString(file,"pEmail", PlayerInfo[playerid][pEmail]);
  558.         INI_WriteString(file,"pGender", PlayerInfo[playerid][pGender]);
  559.         INI_WriteInt(file,"pAge", PlayerInfo[playerid][pAge]);
  560.         INI_WriteString(file,"pOrigin", PlayerInfo[playerid][pOrigin]);
  561.         INI_WriteInt(file,"pDeaths", PlayerInfo[playerid][pDeaths]);
  562.         INI_WriteInt(file,"pKills", PlayerInfo[playerid][pKills]);
  563.         INI_WriteInt(file,"pMoney", GetPlayerMoney(playerid));
  564.         INI_WriteInt(file,"pSkin", GetPlayerSkin(playerid));
  565.         INI_WriteInt(file,"pBanned", PlayerInfo[playerid][pBanned]);
  566.         INI_WriteString(file,"pBanReason", PlayerInfo[playerid][pBanReason]);
  567.         INI_WriteString(file,"pBanBy", PlayerInfo[playerid][pBanBy]);
  568.         INI_WriteString(file,"pBanExpire", PlayerInfo[playerid][pBanExpire]);
  569.         INI_WriteInt(file,"pPlayerLevel", GetPlayerScore(playerid));
  570.         INI_WriteFloat(file,"pPosY", y);
  571.         INI_WriteFloat(file,"pPosX", x);
  572.         INI_WriteFloat(file,"pPosZ", z);
  573.         INI_WriteInt(file,"pInterior", GetPlayerInterior(playerid));
  574.         INI_WriteInt(file,"pWorld", GetPlayerVirtualWorld(playerid));
  575.         INI_Close(file);*/
  576.         return 1;
  577. }
  578.  
  579. /*     Stocks     */
  580. stock Path(playerid)
  581. {
  582.     new name[MAX_PLAYER_NAME];
  583.     GetPlayerName(playerid, name, sizeof(name));
  584.     format(strings, sizeof(strings), "Accounts/%s.ini", name);
  585.     return strings;
  586. }
  587.  
  588. stock UserPath(playerid)
  589. {
  590.     new string[128],playername[MAX_PLAYER_NAME];
  591.     GetPlayerName(playerid,playername,sizeof(playername));
  592.     format(string,sizeof(string),PATH,playername);
  593.     print("USERPATH");
  594.     return string;
  595. }
  596.  
  597. stock UserRPName(playerid)
  598. {
  599.     new uname[MAX_PLAYER_NAME];
  600.     GetPlayerName(playerid,uname,sizeof(uname));
  601.     for(new i = 0; i < MAX_PLAYER_NAME; i++)
  602.     {
  603.         if(uname[i] == '_') uname[i] = ' ';
  604.     }
  605.     return strings;
  606. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement