Guest User

Untitled

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