Advertisement
Dayrion

LARP

May 14th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 33.72 KB | None | 0 0
  1. /*- Start of: Include -*/
  2. #include <a_samp>
  3. #include <YSI\y_ini>
  4. #include <zcmd>
  5. #include <sscanf2>
  6.  
  7. /*- Start of: Defines -*/
  8. #define D_Username 1
  9. #define D_Login 10
  10. #define D_Register 20
  11.  
  12. #define D_R_Mail 21
  13. #define D_RC_Age 22
  14. #define D_RC_Origin 23
  15. #define D_RC_Gender 24
  16. #define D_R_Rules 25
  17.  
  18. #define U_Path "/acc_%s.ini"
  19.  
  20. #if !defined isnull
  21.     #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
  22. #endif
  23.  
  24. /*- Start of: Vars -*/
  25. enum pStats
  26. {
  27.     pID,
  28.     pPassword[128],
  29.     pMail[128],
  30.     pAge,
  31.     pOrigin[128],
  32.     pGender[128],
  33.     pSkin,
  34.     pInterior,
  35.     pVW,
  36.     Float:pPositionX,
  37.     Float:pPositionY,
  38.     Float:pPositionZ,
  39.     pMoney,
  40.     pLevel,
  41.     pJob1,
  42.     pJob2,
  43.     pFlags,
  44.     pBanned,
  45.     pBanBy[128],
  46.     pBanReason[128],
  47.     pRegIP[128],
  48.     pLastIP[128],
  49.     pFaction,
  50.     pRank[11]
  51. }
  52.  
  53. enum fStats
  54. {
  55.     fID,
  56.     fCompleteName[50],
  57.     fShortName[10],
  58.     fLeader[MAX_PLAYER_NAME],
  59.     fMaxRank,
  60.     fRank1[11],
  61.     fRank2[11],
  62.     fRank3[11],
  63.     fRank4[11],
  64.     fRank5[11],
  65.     fRank6[11],
  66.     fRank7[11],
  67.     fRank8[11],
  68.     fRank9[11],
  69.     fRank10[11],
  70. }
  71.  
  72.  
  73. #define MAX_FACTION 3
  74. new Factions[MAX_FACTION][fStats];
  75. new U_Stats[MAX_PLAYERS][pStats];
  76.  
  77. /*- Start of: Random -*/
  78. main()
  79. {
  80.     print("\n[Launch] NCRP V0.10.0 has been loded.");
  81. }
  82.  
  83. /*- Start of: Public -*/
  84. public OnGameModeInit()
  85. {
  86.     CreateVehicles();
  87.     CreateEnters();
  88.     CreateFactions();
  89.     ManualVehicleEngineAndLights();
  90.     EnableStuntBonusForAll(0);
  91.     DisableInteriorEnterExits();
  92.     SetGameModeText("NCRP V0.10.0");
  93.     return 1;
  94. }
  95.  
  96. public OnGameModeExit()
  97. {
  98.     return 1;
  99. }
  100.  
  101. forward LoadUser_data(playerid,name[],value[]);
  102. public LoadUser_data(playerid,name[],value[])
  103. {
  104.     INI_Int("ID", U_Stats[playerid][pID]);
  105.     INI_String("Password", U_Stats[playerid][pPassword], 128);
  106.     INI_String("Mail", U_Stats[playerid][pMail], 128);
  107.     INI_Int("Age", U_Stats[playerid][pAge]);
  108.     INI_String("Origin", U_Stats[playerid][pOrigin], 128);
  109.     INI_String("Gender", U_Stats[playerid][pGender], 128);
  110.     INI_Int("Skin", U_Stats[playerid][pSkin]);
  111.     INI_Int("Interior", U_Stats[playerid][pInterior]);
  112.     INI_Int("VW", U_Stats[playerid][pVW]);
  113.     INI_Float("PositionX", U_Stats[playerid][pPositionX]);
  114.     INI_Float("PositionY", U_Stats[playerid][pPositionY]);
  115.     INI_Float("PositionZ", U_Stats[playerid][pPositionZ]);
  116.     INI_Int("Money", U_Stats[playerid][pMoney]);
  117.     INI_Int("Level", U_Stats[playerid][pLevel]);
  118.     INI_Int("Job1", U_Stats[playerid][pJob1]);
  119.     INI_Int("Job2", U_Stats[playerid][pJob2]);
  120.     INI_Int("Flags", U_Stats[playerid][pFlags]);
  121.     INI_Int("Banned", U_Stats[playerid][pBanned]);
  122.     INI_String("BanBy", U_Stats[playerid][pBanBy], 128);
  123.     INI_String("BanReason", U_Stats[playerid][pBanReason], 128);
  124.     INI_String("RegIP", U_Stats[playerid][pRegIP], 128);
  125.     INI_String("LastIP", U_Stats[playerid][pLastIP], 128);
  126.     INI_Int("Faction", U_Stats[playerid][pFaction]);
  127.     INI_String("Rank", U_Stats[playerid][pRank], 11);
  128.     return 1;
  129. }
  130. forward LoadFaction_data(factionid, name[], value[]);
  131. public LoadFaction_data(factionid, name[], value[]) // faction load data
  132. {
  133.     INI_Int("ID",Factions[factionid][fID]);
  134.     INI_String("CompleteName",Factions[factionid][fCompleteName], 50);
  135.     INI_String("ShortName",Factions[factionid][fShortName], 10);
  136.     INI_String("Leader",Factions[factionid][fLeader], MAX_PLAYER_NAME);
  137.     INI_Int("MaxRank",Factions[factionid][fMaxRank]);
  138.     INI_String("Rank1",Factions[factionid][fRank1], 11);
  139.     INI_String("Rank2",Factions[factionid][fRank2], 11);
  140.     INI_String("Rank3",Factions[factionid][fRank3], 11);
  141.     INI_String("Rank4",Factions[factionid][fRank4], 11);
  142.     INI_String("Rank5",Factions[factionid][fRank5], 11);
  143.     INI_String("Rank6",Factions[factionid][fRank6], 11);
  144.     INI_String("Rank7",Factions[factionid][fRank7], 11);
  145.     INI_String("Rank8",Factions[factionid][fRank8], 11);
  146.     INI_String("Rank9",Factions[factionid][fRank9], 11);
  147.     INI_String("Rank10",Factions[factionid][fRank10], 11);
  148.     return 1;
  149. }
  150. public OnPlayerConnect(playerid)
  151. {
  152.     SetTimerEx("OnPlayerConnectCamera", 100, false, "d", playerid);
  153.     for(new i; i!=20; i++)
  154.     {
  155.         SendClientMessage(playerid, -1, "");
  156.     }
  157.     new name[MAX_PLAYER_NAME];
  158.     GetPlayerName(playerid, name, sizeof(name));
  159.     if(IsARolePlayName(name) == 1)
  160.     {
  161.         if(fexist(UserPath(playerid)))
  162.         {
  163.             INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  164.             ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Login","{FFFFFF}Welcome back to {82CAFF}New City Roleplay{FFFFFF}. This name seems to be registrated.\nIf you're the owner of this account, Please proceed by entering your password.","Login","");
  165.         }
  166.         else
  167.         {
  168.             ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, It seems like this account isn't registrated yet! Enter a password below to contine the registration.",">>","");
  169.         }
  170.     }
  171.     else
  172.     {
  173.         ShowPlayerDialog(playerid, D_Username, DIALOG_STYLE_INPUT, "{82CAFF}New City Roleplay{FFFFFF}: Invalid Username", "{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, We just met a little problem, Your name isn't allowed.\n\nEnter a new roleplay name such as: John_Doe", ">>", "");
  174.     }
  175.     return 1;
  176. }
  177.  
  178. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  179. {
  180.     switch(dialogid)
  181.     {
  182.         case D_Username:
  183.         {
  184.             if(!response)
  185.             {
  186.                 Kick(playerid);
  187.             }
  188.             else
  189.             {
  190.                 if(!strlen(inputtext))
  191.                 {
  192.                     Kick(playerid);
  193.                 }
  194.                 else
  195.                 {
  196.                     SetPlayerName(playerid, inputtext);
  197.                     new name[MAX_PLAYER_NAME];
  198.                     GetPlayerName(playerid, name, sizeof(name));
  199.                     if(IsARolePlayName(name) == 1)
  200.                     {
  201.                         if(fexist(UserPath(playerid)))
  202.                         {
  203.                             INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  204.                             ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Login","{FFFFFF}Welcome back to {82CAFF}New City Roleplay{FFFFFF}. This name seems to be registrated.\nIf you're the owner of this account, Please proceed by entering your password.","Login","");
  205.                         }
  206.                         else
  207.                         {
  208.                             ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, It seems like this account isn't registrated yet!\nEnter a password below to contine the registration.",">>","");
  209.                         }
  210.                     }
  211.                     else
  212.                     {
  213.                         ShowPlayerDialog(playerid, D_Username, DIALOG_STYLE_INPUT, "{82CAFF}New City Roleplay{FFFFFF}: Invalid Username", "{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, We just met a little problem, Your name isn't allowed.\n\nEnter a new roleplay name such as: John_Doe", ">>", "");
  214.                     }
  215.                 }
  216.             }
  217.         }
  218.  
  219.         case D_Login:
  220.         {
  221.             if(!response)
  222.             {
  223.                 Kick ( playerid );
  224.             }
  225.             else
  226.             {
  227.                 if(!strlen(inputtext))
  228.                 {
  229.                     ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Login","{FFFFFF}Welcome back to {82CAFF}New City Roleplay{FFFFFF}. This name seems to be registrated.\nIf you're the owner of this account, Please proceed by entering your password.","Login","");
  230.                 }
  231.                 else
  232.                 {
  233.                     if(!strcmp(inputtext, U_Stats[playerid][pPassword]))
  234.                     {
  235.                         SpawnPlayer(playerid);
  236.                         SetSpawnInfo( playerid, 0, U_Stats[playerid][pSkin], U_Stats[playerid][pPositionX], U_Stats[playerid][pPositionY], U_Stats[playerid][pPositionZ], 269.15, 0, 0, 0, 0, 0, 0 );
  237.                         TogglePlayerSpectating(playerid, 0);
  238.                         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  239.                         SpawnPlayer(playerid);
  240.                         SetPlayerSkin(playerid, U_Stats[playerid][pSkin]);
  241.                         SetPlayerInterior(playerid, U_Stats[playerid][pInterior]);
  242.                         SetPlayerVirtualWorld(playerid, U_Stats[playerid][pVW]);
  243.                         SetPlayerPos(playerid, U_Stats[playerid][pPositionX], U_Stats[playerid][pPositionY], U_Stats[playerid][pPositionZ]);
  244.                         GivePlayerMoney(playerid, U_Stats[playerid][pMoney]);
  245.                         SetPlayerScore(playerid, U_Stats[playerid][pLevel]);
  246.                         SpawnPlayer(playerid);
  247.                     }
  248.                     else
  249.                     {
  250.                         ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Login","{FFFFFF}Welcome back to {82CAFF}New City Roleplay{FFFFFF}. This name seems to be registrated.\nIf you're the owner of this account, Please proceed by entering your password.\n\n{FFFF00}You entered the wrong password!","Login","");
  251.                     }
  252.                 }
  253.                 return 1;
  254.             }
  255.         }
  256.  
  257.         case D_Register:
  258.         {
  259.             if(!response)
  260.             {
  261.                 Kick ( playerid );
  262.             }
  263.             else
  264.             {
  265.                 if(!strlen(inputtext))
  266.                 {
  267.                     ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_PASSWORD,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}, It seems like this account isn't registrated yet!\nEnter a password below to contine the registration.\n\n{FFFF00}You forgot to insert a password.",">>","");
  268.                 }
  269.                 else
  270.                 {
  271.                     new INI:File = INI_Open(UserPath(playerid));
  272.                     INI_SetTag(File, "data");
  273.                     INI_WriteString(File, "Password", inputtext);
  274.                     INI_Close(File);
  275.                     ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhat is your email? You may decide if you want to receive news letters or not.\nIf you don't, Simply leave it empty.",">>","");
  276.                 }
  277.                 return 1;
  278.             }
  279.         }
  280.  
  281.         case D_R_Mail:
  282.         {
  283.             if(!response)
  284.             {
  285.                 ShowPlayerDialog(playerid, D_R_Mail, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhat is your email? You may decide if you want to receive news letters or not.\nIf you don't, Simply leave it empty.",">>","");
  286.             }
  287.             else
  288.             {
  289.                 if(!strlen(inputtext))
  290.                 {
  291.                     new INI:File = INI_Open(UserPath(playerid));
  292.                     INI_SetTag(File, "data");
  293.                     INI_WriteString(File, "Mail", "empty");
  294.                     INI_Close(File);
  295.                     ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.",">>","");
  296.                 }
  297.                 else
  298.                 {
  299.                     new INI:File = INI_Open(UserPath(playerid));
  300.                     INI_SetTag(File, "data");
  301.                     INI_WriteString(File, "Mail", inputtext);
  302.                     INI_Close(File);
  303.                     ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.",">>","");
  304.                 }
  305.                 return 1;
  306.             }
  307.         }
  308.  
  309.         case D_RC_Age:
  310.         {
  311.             if(!response)
  312.             {
  313.                     ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.",">>","");
  314.             }
  315.             else
  316.             {
  317.                 if(!strlen(inputtext))
  318.                 {
  319.                     ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.\n\n{FFFF00}You forgot to enter an age.",">>","");
  320.                 }
  321.                 else
  322.                 {
  323.                     if(strval(inputtext) > 16 && strval(inputtext) < 61)
  324.                     {
  325.                         new INI:File = INI_Open(UserPath(playerid));
  326.                         INI_SetTag(File, "data");
  327.                         INI_WriteInt(File, "Age", strval(inputtext));
  328.                         INI_Close(File);
  329.                         ShowPlayerDialog(playerid, D_RC_Origin, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhere are your character borned? Enter it below!",">>","");
  330.                     }
  331.                     else
  332.                     {
  333.                         ShowPlayerDialog(playerid, D_RC_Age, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nHow old are your character? Not you, The character.\nEnter an age below 60 and over 17.\n\n{FFFF00}You need to be below 60 and 17!",">>","");
  334.                     }
  335.                 }
  336.                 return 1;
  337.             }
  338.         }
  339.  
  340.         case D_RC_Origin:
  341.         {
  342.             if(!response)
  343.             {
  344.                 ShowPlayerDialog(playerid, D_RC_Origin, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhere are your character borned? Enter it below!",">>","");
  345.             }
  346.             else
  347.             {
  348.                 if(!strlen(inputtext))
  349.                 {
  350.                     ShowPlayerDialog(playerid, D_RC_Origin, DIALOG_STYLE_INPUT,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhere are your character borned? Enter it below!\n\nYou forgot to enter the origin!",">>","");
  351.                 }
  352.                 else
  353.                 {
  354.                     new INI:File = INI_Open(UserPath(playerid));
  355.                     INI_SetTag(File, "data");
  356.                     INI_WriteString(File, "Origin", inputtext);
  357.                     INI_Close(File);
  358.                     ShowPlayerDialog(playerid, D_RC_Gender, DIALOG_STYLE_MSGBOX,"{82CAFF}New City Roleplay{FFFFFF}: Register","{FFFFFF}Welcome to {82CAFF}New City Roleplay{FFFFFF}.\nWhat gender are your character? Press the buttons to choose.","Male","Female");
  359.                 }
  360.                 return 1;
  361.             }
  362.         }
  363.         case D_RC_Gender:
  364.         {
  365.             if(!response)
  366.             {
  367.                 new INI:File = INI_Open(UserPath(playerid));
  368.                 INI_SetTag(File, "data");
  369.                 INI_WriteString(File, "Gender", "Female");
  370.                 INI_Close(File);
  371.                 new strca[3000];
  372.                 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");
  373.                 strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
  374.                 strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
  375.                 strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
  376.                 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");
  377.                 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");
  378.                 strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither do roleplayers, Doing so will result a 15 minute kick to calm down.\n");
  379.                 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");
  380.                 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");
  381.                 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");
  382.                 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");
  383.                 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");
  384.                 strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
  385.                 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");
  386.                 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)");
  387.                 ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX,"{82CAFF}New City Roleplay{FFFFFF}: Rules",strca,"Accept rules","");
  388.             }
  389.             else
  390.             {
  391.                 new INI:File = INI_Open(UserPath(playerid));
  392.                 INI_SetTag(File, "data");
  393.                 INI_WriteString(File, "Gender", "Male");
  394.                 INI_Close(File);
  395.                 new strca[3000];
  396.                 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");
  397.                 strcat(strca, "{FFFFFF}- {8C1717}Hacking{FFFFFF} Using anything of a 3rd party program will get you IP-Banned for ever.\n");
  398.                 strcat(strca, "{FFFFFF}- {8C1717}Powergaming{FFFFFF} You may not force any action towards a player, Always use some kind of Succes/Failure.\n");
  399.                 strcat(strca, "{FFFFFF}- {8C1717}Metagaming{FFFFFF} You're not allowed to metagame, This means you cannot mix OOC Information with IC\n");
  400.                 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");
  401.                 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");
  402.                 strcat(strca, "{FFFFFF}- {8C1717}Spamming{FFFFFF} We don't like spammers, neither do roleplayers, Doing so will result a 15 minute kick to calm down.\n");
  403.                 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");
  404.                 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");
  405.                 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");
  406.                 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");
  407.                 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");
  408.                 strcat(strca, "{FFFFFF}- {8C1717}Ninja jacking{FFFFFF} This is sort of Powergaming, Simple taking a car with someone in it without any roleplay.\n");
  409.                 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");
  410.                 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)");
  411.                 ShowPlayerDialog(playerid, D_R_Rules, DIALOG_STYLE_MSGBOX,"{82CAFF}New City Roleplay{FFFFFF}: Rules",strca,"Accept rules","");
  412.                 return 1;
  413.             }
  414.         }
  415.         case D_R_Rules:
  416.         {
  417.             if(response)
  418.             {
  419.                 TogglePlayerSpectating(playerid, 0);
  420.                 SetSpawnInfo(playerid, 0, 17, 1743.1300, -1861.9683, 13.5769, 359.2573, 0, 0, 0, 0, 0, 0);
  421.                 SpawnPlayer(playerid);
  422.                 GivePlayerMoney(playerid, 25000);
  423.                 SetPlayerScore(playerid, 1);
  424.                 new INI:File = INI_Open(UserPath(playerid));
  425.                 INI_SetTag(File, "data");
  426.                 INI_WriteInt(File, "Skin", 17);
  427.                 INI_WriteInt(File, "Interior", 0);
  428.                 INI_WriteInt(File, "VW", 0);
  429.                 INI_WriteFloat(File, "PositionX", 1743.1300);
  430.                 INI_WriteFloat(File, "PositionY", -1861.9683);
  431.                 INI_WriteFloat(File, "PositionZ", 13.5769);
  432.                 INI_WriteInt(File, "Money", 25000);
  433.                 INI_WriteInt(File, "Level", 1);
  434.                 INI_WriteInt(File, "Job1", 0);
  435.                 INI_WriteInt(File, "Job2", 0);
  436.                 INI_WriteInt(File, "Flags", 0);
  437.                 INI_WriteInt(File, "Banned", 0);
  438.                 INI_WriteString(File, "BanBy", "0");
  439.                 INI_WriteString(File, "BanReason", "0");
  440.                 new plrIP[16];
  441.                 GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  442.                 INI_WriteString(File, "RegIP", plrIP);
  443.                 INI_WriteString(File, "LastIP", plrIP);
  444.                 INI_WriteInt(File, "Faction", 0);
  445.                 INI_WriteString(File, "Rank", "None");
  446.                 INI_Close(File);
  447.                 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)!");
  448.                 SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] You may use /o(oc)c(hat) to chat globaly.");
  449.                 new message[255];
  450.                 new name[MAX_PLAYER_NAME];
  451.                 format(message, 255, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome our newest user %s to NCRP!", GetPlayerName(playerid, name, sizeof(name)));
  452.                 SendClientMessageToAll(-1, message);
  453.                 return 1;
  454.             }
  455.         }
  456.     }
  457.     return 1;
  458. }
  459.  
  460. public OnPlayerDisconnect(playerid, reason)
  461. {
  462.     new INI:File = INI_Open(UserPath(playerid));
  463.     INI_SetTag(File, "data");
  464.     INI_WriteInt(File, "Skin", GetPlayerSkin(playerid));
  465.     INI_WriteInt(File, "Interior", GetPlayerInterior(playerid));
  466.     INI_WriteInt(File, "VW", GetPlayerVirtualWorld(playerid));
  467.     new Float:x, Float:y, Float:z;
  468.     GetPlayerPos(playerid, x, y, z);
  469.     INI_WriteFloat(File, "PositionX", x);
  470.     INI_WriteFloat(File, "PositionY", y);
  471.     INI_WriteFloat(File, "PositionZ", z);
  472.     INI_WriteInt(File, "Money", GetPlayerMoney(playerid));
  473.     INI_WriteInt(File, "Level", GetPlayerScore(playerid));
  474.     INI_WriteInt(File, "Job1", U_Stats[playerid][pJob1]);
  475.     INI_WriteInt(File, "Job2", U_Stats[playerid][pJob2]);
  476.     INI_WriteInt(File, "Flags", U_Stats[playerid][pFlags]);
  477.     INI_WriteInt(File, "Banned", U_Stats[playerid][pBanned]);
  478.     INI_WriteString(File, "BanBy", U_Stats[playerid][pBanBy]);
  479.     INI_WriteString(File, "BanReason", U_Stats[playerid][pBanReason]);
  480.     new plrIP[16];
  481.     GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  482.     INI_WriteString(File, "LastIP", plrIP);
  483.     INI_WriteInt(File, "Faction", U_Stats[playerid][pFaction]);
  484.     INI_Close(File);
  485.     return 1;
  486. }
  487.  
  488. forward OnPlayerConnectCamera(playerid);
  489. public OnPlayerConnectCamera(playerid)
  490. {
  491.     TogglePlayerSpectating(playerid, 1);
  492.     switch(random(5))
  493.     {
  494.         case 0:
  495.         {
  496.             InterpolateCameraPos(playerid,1006.8538, 282.1343, 85.7583, 1006.8538, 282.1343, 85.7583, 1000, CAMERA_CUT);
  497.             InterpolateCameraLookAt(playerid, 1007.8502, 282.1040, 85.5879, 1007.8502, 282.1040, 85.5879, 1000, CAMERA_CUT);
  498.         }
  499.         case 1:
  500.         {
  501.             InterpolateCameraPos(playerid,646.6002, -594.4451, 15.9723, 646.6002, -594.4451, 15.9723, 1000, CAMERA_CUT);
  502.             InterpolateCameraLookAt(playerid,646.9472, -593.6812, 16.1468, 645.9472, -593.6812, 16.1468, 1000, CAMERA_CUT);
  503.         }
  504.         case 2:
  505.         {
  506.             InterpolateCameraPos(playerid, 651.7802, -494.6155, 30.2279, 651.7802, -494.6155, 30.2279, 1000, CAMERA_CUT);
  507.             InterpolateCameraLookAt(playerid, 652.5730, -493.9993, 29.9173, 652.5730, -493.9993, 29.9173, 1000, CAMERA_CUT);
  508.         }
  509.         case 3:
  510.         {
  511.             InterpolateCameraPos(playerid, 187.5941, -217.7278, 1.9320, 187.5941, -217.7278, 1.9320, 1000, CAMERA_CUT);
  512.             InterpolateCameraLookAt(playerid, 188.3079, -217.0226, 2.0968, 188.3079, -217.0226, 2.0968, 1000, CAMERA_CUT);
  513.         }
  514.         default:
  515.         {
  516.             InterpolateCameraPos(playerid, 94.6793, -215.7012, 3.1615, 94.6793, -215.7012, 3.1615, 1000, CAMERA_CUT);
  517.             InterpolateCameraLookAt(playerid, 94.1885, -216.5767, 3.2614, 94.1885, -216.5767, 3.2614, 1000, CAMERA_CUT);
  518.         }
  519.     }
  520.     return 1;
  521. }
  522.  
  523. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  524. {
  525.     if((newkeys == KEY_SECONDARY_ATTACK) && (oldkeys == 0) && IsPlayerInRangeOfPoint(playerid, 2.0, 1081.2261, -1697.9417, 13.5469)) // employment agency - enter
  526.     {
  527.         GameTextForPlayer(playerid, "Loading objects..", 1750, 6);
  528.         TogglePlayerControllable(playerid, 0);
  529.         SetPlayerPos(playerid, 384.808624, 173.804992, 1008.382812);
  530.         SetPlayerInterior(playerid, 3);
  531.         SetTimerEx("EE", 1750, false, "i", playerid);
  532.         return 1;
  533.     }
  534.     if((newkeys == KEY_SECONDARY_ATTACK) && (oldkeys == 0) && IsPlayerInRangeOfPoint(playerid, 2.25, 384.808624, 173.804992, 1008.382812)) // employment agency - exit
  535.     {
  536.         GameTextForPlayer(playerid, "Loading objects..", 1750, 6);
  537.         TogglePlayerControllable(playerid, 0);
  538.         SetPlayerPos(playerid, 1081.2261, -1697.9417, 13.5469);
  539.         SetPlayerInterior(playerid, 0);
  540.         SetTimerEx("EE", 1750, false, "i", playerid);
  541.         return 1;
  542.     }
  543.     return 1;
  544. }
  545.  
  546. forward EE(playerid);
  547. public EE(playerid)
  548. {
  549.     TogglePlayerControllable(playerid, 1);
  550. }
  551.  
  552. /*- Start of: Admin Commands -*/
  553. CMD:avehicle(playerid, params[])
  554. {
  555.     if(U_Stats[playerid][pLevel] > 12)
  556.     {
  557.         new vmod;
  558.         if(sscanf(params, "i", vmod))
  559.         {
  560.             SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] You forgot to insert a vehicle model.");
  561.         }
  562.         else
  563.         {
  564.             new Float:x, Float:y, Float:z;
  565.             GetPlayerPos(playerid, x, y, z);
  566.             CreateVehicle(vmod, x, y, z, 82.2873, -1, -1, -1);
  567.         }
  568.     }
  569.     else
  570.     {
  571.         SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] You're not high admin enough.");
  572.     }
  573.     return 1;
  574. }
  575.  
  576. CMD:atp(playerid, params[])
  577. {
  578.     if(U_Stats[playerid][pLevel] > 12)
  579.     {
  580.         new player, to[128];
  581.         if(sscanf(params, "us", player, to))
  582.         {
  583.             SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] You forgot to insert a player/destiny.");
  584.         }
  585.         else
  586.         {
  587.             if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] The player is offline.");
  588.             else
  589.             {
  590.                 if(!strcmp(to, "ea"))
  591.                 {
  592.                     SetPlayerPos(player, 1081.2261, -1697.9417, 13.5469);
  593.                     SetPlayerInterior(player, 0);
  594.                 }
  595.             }
  596.         }
  597.     }
  598.     else
  599.     {
  600.         SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] You're not high admin enough.");
  601.     }
  602.     return 1;
  603. }
  604.  
  605.  
  606.  
  607. /*- Start of: Normal Commands -*/
  608. CMD:enter(playerid)
  609. {
  610.     if(IsPlayerInRangeOfPoint(playerid, 12.5, 1081.2261, -1697.9417, 13.5469))
  611.     {
  612.         GameTextForPlayer(playerid, "Loading objects..", 1750, 6);
  613.         TogglePlayerControllable(playerid, 0);
  614.         SetPlayerPos(playerid, 384.808624, 173.804992, 1008.382812);
  615.         SetPlayerInterior(playerid, 3);
  616.         SetTimerEx("EE", 1750, false, "i", playerid);
  617.     }
  618.     return 1;
  619. }
  620.  
  621. /*- Start of: Stocks -*/
  622. stock UserPath(playerid)
  623. {
  624.     new
  625.         string[128],
  626.         playername[MAX_PLAYER_NAME];
  627.     GetPlayerName(playerid, playername, sizeof(playername));
  628.     format(string, sizeof(string), U_Path, playername);
  629.     return string;
  630. }
  631.  
  632. stock IsARolePlayName(name[])
  633. {
  634.     new
  635.         szLastCell,
  636.         bool:   bUnderScore;
  637.     for(new i; i < strlen(name); i++)
  638.     {
  639.         if(name[i] == '_')
  640.         {
  641.             if(bUnderScore == true)
  642.             {
  643.                 return 0;
  644.             }
  645.             bUnderScore = true;
  646.         }
  647.         else if(!szLastCell || szLastCell == '_')
  648.         {
  649.             if(name[i] < 'A' || name[i] > 'Z')
  650.             {
  651.                 return 0;
  652.             }
  653.         }
  654.         else
  655.         {
  656.             if(name[i] < 'a' || name[i] > 'z')
  657.             return 0;
  658.         }
  659.         szLastCell = name[i];
  660.     }
  661.     if(bUnderScore == false)
  662.         return 0;
  663.     return 1;
  664. }
  665.  
  666. stock CreateVehicles()
  667. {
  668.     AddStaticVehicle(420,1792.4155,-1867.6967,13.3874,358.8062,6,6); // Taxi Unity #1
  669.     AddStaticVehicle(420,1797.1969,-1867.6871,13.3912,358.9693,6,6); // Taxi Unity #2
  670.     AddStaticVehicle(420,1802.4940,-1867.6484,13.3940,358.8062,6,6); // Taxi Unity #3
  671.     AddStaticVehicle(420,1807.8152,-1867.7207,13.4007,358.8062,6,6); // Taxi Unity #4
  672.     AddStaticVehicle(428,1542.6244,-1024.6200,24.0320,163.2065,4,75); // Chuff #1
  673.     AddStaticVehicle(428,1546.4946,-1026.1895,24.0301,163.4733,4,75); // Chuff #2
  674.     AddStaticVehicle(428,1551.0212,-1027.5726,24.0321,162.4711,15,28); // Chuff #3
  675.     AddStaticVehicle(428,1555.1923,-1028.6541,24.0309,162.7516,88,94); // Chuff #4
  676.     AddStaticVehicle(428,1559.5815,-1029.7976,24.0310,163.7259,53,54); // Chuff #5
  677.     AddStaticVehicle(428,1563.8594,-1031.3964,24.0355,163.6010,40,77); // Chuff #6
  678. }
  679.  
  680. stock CreateEnters()
  681. {
  682.     Create3DTextLabel("- Los Santos Employment Agency -\n Press F to enter", 0xffffffff, 1081.2261, -1697.9417, 13.5469, 40.0, 0, 0); // Los Santos - Job enter | 1081.2261, -1697.9417, 13.5469
  683.     AddStaticPickup(1239, 1, 1081.2261, -1697.9417, 13.5469, 0); // Los Santos - Job enter | 1081.2261, -1697.9417, 13.5469
  684.  
  685.     Create3DTextLabel("- Los Santos Employment Agency -\n Press F to exit", 0xffffffff, 1702.0747, -1667.7676, 20.2188, 40.0, 1, 0); // Los Santos - Job exit | 1702.0747, -1667.7676, 20.2188
  686.     AddStaticPickup(1239, 1, 1702.0747, -1667.7676, 20.2188, 1); // Los Santos - Job exit  | 1702.0747, -1667.7676, 20.2188
  687.  
  688.     Create3DTextLabel("- JOB 1 -", 0xffffffff, 1734.4955, -1660.0510, 23.7309, 10.0, 1, 0); // Los Santos - EA - JOB 1 | 1734.4955, -1660.0510, 23.7183
  689.     AddStaticPickup(1239, 1, 1734.4955, -1660.0510, 23.7309, 1);
  690.  
  691.     Create3DTextLabel("- JOB 2 -", 0xffffffff, 1734.4955, -1654.4794, 23.7309, 10.0, 1, 0); // Los Santos - EA - JOB 2 | 1734.4866, -1654.4794, 23.7305
  692.     AddStaticPickup(1239, 1, 1734.4955, -1654.4794, 23.7309, 1);
  693.  
  694.     Create3DTextLabel("- JOB 3 -", 0xffffffff, 1734.4955, -1648.4071, 23.7309, 10.0, 1, 0); // Los Santos - EA - JOB 3 | 1734.3845, -1648.4071, 23.7438
  695.     AddStaticPickup(1239, 1, 1734.4955, -1648.4071, 23.7309, 1);
  696.  
  697.     Create3DTextLabel("- JOB 4 -", 0xffffffff, 1734.4955, -1642.4214, 23.7309, 10.0, 1, 0); // Los Santos - EA - JOB 4 | 1734.2845, -1642.4214, 23.7515
  698.     AddStaticPickup(1239, 1, 1734.4955, -1642.4214, 23.7309, 1);
  699. }
  700. stock FactionPath(factionID)
  701. {
  702.     new str[128];
  703.     format(str, sizeof(str), "Factions/%i", factionID);
  704.     return str;
  705. }
  706.  
  707. stock CreateFactions()
  708. {
  709.     for(new i=0; i<MAX_FACTION; i++)
  710.     {
  711.         if(fexist(FactionPath(i)))
  712.         {
  713.             switch(i)
  714.             {
  715.                 case 0:
  716.                 {
  717.                     Factions[i][fID] = 1;
  718.                     Factions[i][fMaxRank] = 8;
  719.                     new INI:File = INI_Open(FactionPath(i));
  720.                     INI_WriteInt(File,"ID",Factions[i][fID]);
  721.                     INI_WriteString(File,"CompleteName","Los Angeles Police Department");
  722.                     INI_WriteString(File,"ShortName","L.A.P.D");
  723.                     INI_WriteString(File,"Leader","None");
  724.                     INI_WriteInt(File,"MaxRank",Factions[i][fMaxRank]);
  725.                     INI_WriteString(File,"Rank1","Cadet");
  726.                     INI_WriteString(File,"Rank2","Officier 1");
  727.                     INI_WriteString(File,"Rank3","Officer 2");
  728.                     INI_WriteString(File,"Rank4","Officer 3");
  729.                     INI_WriteString(File,"Rank5","Sergeant");
  730.                     INI_WriteString(File,"Rank6","Captain");
  731.                     INI_WriteString(File,"Rank7","Assistant Chief");
  732.                     INI_WriteString(File,"Rank8","Chief");
  733.                     INI_WriteString(File,"Rank9","");
  734.                     INI_WriteString(File,"Rank10","");
  735.                     INI_Close(File);
  736.                 }
  737.                 case 1:
  738.                 {
  739.                     Factions[i][fID] = 2;
  740.                     Factions[i][fMaxRank] = 7;
  741.                     new INI:File = INI_Open(FactionPath(i));
  742.                     INI_WriteInt(File,"ID",Factions[i][fID]);
  743.                     INI_WriteString(File,"CompleteName","Los Angeles Fire Department");
  744.                     INI_WriteString(File,"ShortName","L.A.F.D");
  745.                     INI_WriteString(File,"Leader","None");
  746.                     INI_WriteInt(File,"MaxRank",Factions[i][fMaxRank]);
  747.                     INI_WriteString(File,"Rank1","Cadet");
  748.                     INI_WriteString(File,"Rank2","EMS");
  749.                     INI_WriteString(File,"Rank3","Firefighter");
  750.                     INI_WriteString(File,"Rank4","EMS/Firefighter");
  751.                     INI_WriteString(File,"Rank5","Captain");
  752.                     INI_WriteString(File,"Rank6","Assistant Chief");
  753.                     INI_WriteString(File,"Rank7","Chief");
  754.                     INI_WriteString(File,"Rank8","");
  755.                     INI_WriteString(File,"Rank9","");
  756.                     INI_WriteString(File,"Rank10","");
  757.                     INI_Close(File);
  758.                 }
  759.                 case 2:
  760.                 {
  761.                     Factions[i][fID] = 3;
  762.                     Factions[i][fMaxRank] = 4;
  763.                     new INI:File = INI_Open(FactionPath(i));
  764.                     INI_WriteInt(File,"ID",Factions[i][fID]);
  765.                     INI_WriteString(File,"CompleteName","Fox5");
  766.                     INI_WriteString(File,"ShortName","Fox5");
  767.                     INI_WriteString(File,"Leader","None");
  768.                     INI_WriteInt(File,"MaxRank",Factions[i][fMaxRank]);
  769.                     INI_WriteString(File,"Rank1","New Reporter");
  770.                     INI_WriteString(File,"Rank2","Heli Reporter");
  771.                     INI_WriteString(File,"Rank3","Interview Reporter");
  772.                     INI_WriteString(File,"Rank4","Owner");
  773.                     INI_WriteString(File,"Rank5","");
  774.                     INI_WriteString(File,"Rank6","");
  775.                     INI_WriteString(File,"Rank7","");
  776.                     INI_WriteString(File,"Rank8","");
  777.                     INI_WriteString(File,"Rank9","");
  778.                     INI_WriteString(File,"Rank10","");
  779.                     INI_Close(File);
  780.                    
  781.                 }
  782.             }
  783.         }
  784.         else
  785.         {
  786.             INI_ParseFile(FactionPath(i), "LoadFaction_data", .bExtra = true, .extra = i);
  787.             printf("[Launch] Faction ID : %i Succefuly LOADED", i);
  788.         }
  789.     }
  790.     return 1;
  791. }
  792.  
  793. stock GetName(playerid)
  794. {
  795.     new gName[MAX_PLAYER_NAME];
  796.     GetPlayerName(playerid, gName, sizeof(gName));
  797.     return gName;
  798. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement