Advertisement
Guest User

Who ever reads this will die in the next 24 hours/

a guest
Jul 1st, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.76 KB | None | 0 0
  1. public OnPlayerRequestClass(playerid, classid)
  2. {
  3. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  4. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  5. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  6. return 1;
  7. }
  8.  
  9.  
  10.  
  11.  
  12. //------------------------------------------------------------- \\
  13. //*** *** *** The Basic Roleplay commands m8. *** *** *** \\
  14. //------------------------------------------------------------------\\
  15.  
  16. // *** LE END OF LE BASIC ROLEPLAY COMMANDS MATE. ((It's probably not, just havn't added them yet. ))
  17.  
  18.  
  19. // *** Logging In, Seting up acount. *** \\
  20.  
  21. new string [128];
  22. format(string, sizeof(string), "{FFFFFF}Welcome To Western County Roleplay, {50BB44}%s.\n{FFFFFF}Type your desired password below to Register.", RemoveUnderScore(playerid));
  23. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Register",string,"Register","Quit");
  24. return 1;
  25. }
  26. stock ShowLoginDialog(playerid)
  27. {
  28. new string [128];
  29. format(string, sizeof(string), "{FFFFFF}Welcome Back, {50BB44}%s.\n{FFFFFF}Type Your below Password To Login.", RemoveUnderScore(playerid));
  30. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login",string,"Login","Quit");
  31. return 1;
  32. }
  33. stock ShowCharacterDialog(playerid)
  34. {
  35. new string[128];
  36. format(string, sizeof(string), "{FFFFFF}Play as {50BB44}%s\n\n{FFFFFF}Profile Settings", PlayerInfo[playerid][Name]);
  37. ShowPlayerDialog(playerid, DIALOG_CHARSELECT, DIALOG_STYLE_LIST,"Menu",string,"Select","Quit");
  38. return 1;
  39. }
  40. stock ShowCharacterInformation(playerid)
  41. {
  42. new string[128];
  43. SendClientMessage(playerid, WHITE, "Welcome to {50BB44}Western County Roleplay.");
  44.  
  45. format(string, sizeof(string), "Account Name: {50BB44}%s",PlayerInfo[playerid][Name]);
  46. SendClientMessage(playerid, WHITE, string);
  47.  
  48. if(PlayerInfo[playerid][AdminLevel] == 0) format (string, sizeof(string), "Administrator Level: {50BB44}None.");
  49. else format(string, sizeof(string), "Administrator Level: {50BB44}%s {FFFFFF}(%d)",GetAdminRank(playerid),PlayerInfo[playerid][AdminLevel]);
  50. SendClientMessage(playerid, WHITE, string);
  51.  
  52. format(string, sizeof(string), "Level: {50BB44}%d",PlayerInfo[playerid][Level]);
  53. SendClientMessage(playerid, WHITE, string);
  54. return 1;
  55. }
  56. stock ShowProfileSettings(playerid)
  57. {
  58. new string[128];
  59. format(string, sizeof(string), "{FFFFFF}Change Name {50BB44}(Current: %s)\nChange Age\nChange Gender\nChange Password", PlayerInfo[playerid][Name]);
  60. ShowPlayerDialog(playerid, DIALOG_PROFILE, DIALOG_STYLE_LIST,"{FFFFFF}Profile",string,"Select","");
  61. return 1;
  62. }
  63. stock GetGender(playerid)
  64. {
  65. new astring[128];
  66. if(PlayerInfo[playerid][Gender] == 1)format(astring, sizeof(astring), "Male");
  67. else if(PlayerInfo[playerid][Gender] == 2)format(astring, sizeof(astring), "Female");
  68. return astring;
  69. }
  70.  
  71. enum pInfo
  72. {
  73. Name[32],
  74. Password,
  75. Level,
  76. Registered,
  77. Money,
  78. AdminLevel,
  79. Age,
  80. Gender,
  81. Skin,
  82. RegDate,
  83. RegMonth,
  84. RegYear,
  85. TimesKicked,
  86. Banned,
  87. BannedBy[32],
  88. BanReason[128],
  89. TimesWarned,
  90. }
  91.  
  92. forward LoadUser_data(playerid,name[],value[]);
  93. public LoadUser_data(playerid,name[],value[])
  94. {
  95. INI_String("Name", PlayerInfo[playerid][Name], 32);
  96. INI_Int("Password",PlayerInfo[playerid][Password]);
  97. INI_Int("Level",PlayerInfo[playerid][Level]);
  98. INI_Int("Registered",PlayerInfo[playerid][Registered]);
  99. INI_Int("Money",PlayerInfo[playerid][Money]);
  100. INI_Int("AdminLevel",PlayerInfo[playerid][AdminLevel]);
  101. INI_Int("Age",PlayerInfo[playerid][Age]);
  102. INI_Int("Gender",PlayerInfo[playerid][Gender]);
  103. INI_Int("Skin",PlayerInfo[playerid][Skin]);
  104. INI_Int("RegDate",PlayerInfo[playerid][RegDate]);
  105. INI_Int("RegMonth",PlayerInfo[playerid][RegMonth]);
  106. INI_Int("RegYear",PlayerInfo[playerid][RegYear]);
  107. INI_Int("TimesKicked",PlayerInfo[playerid][TimesKicked]);
  108. INI_Int("Banned",PlayerInfo[playerid][Banned]);
  109. INI_String("BannedBy",PlayerInfo[playerid][BannedBy], 32);
  110. INI_String("BanReason",PlayerInfo[playerid][BanReason], 128);
  111. INI_Int("TimesWarned",PlayerInfo[playerid][TimesWarned]);
  112. return 1;
  113. }
  114.  
  115. stock SaveUser(playerid)
  116. {
  117. PlayerInfo[playerid][Money] = GetPlayerMoney(playerid);
  118. PlayerInfo[playerid][Level] = GetPlayerScore(playerid);
  119. new INI:File = INI_Open(UserPath(playerid));
  120. INI_SetTag(File,"PLAYER INFORMATION");
  121. INI_WriteString(File,"Name",PlayerInfo[playerid][Name]);
  122. INI_WriteInt(File,"Password",PlayerInfo[playerid][Password]);
  123. INI_WriteInt(File,"Level",PlayerInfo[playerid][Level]);
  124. INI_WriteInt(File,"Registered",PlayerInfo[playerid][Registered]);
  125. INI_WriteInt(File,"Money",PlayerInfo[playerid][Money]);
  126. INI_WriteInt(File,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
  127. INI_WriteInt(File,"Age",PlayerInfo[playerid][Age]);
  128. INI_WriteInt(File,"Gender",PlayerInfo[playerid][Gender]);
  129. INI_WriteInt(File,"Skin",PlayerInfo[playerid][Skin]);
  130. INI_WriteInt(File,"RegDate",PlayerInfo[playerid][RegDate]);
  131. INI_WriteInt(File,"RegMonth",PlayerInfo[playerid][RegMonth]);
  132. INI_WriteInt(File,"RegYear",PlayerInfo[playerid][RegYear]);
  133. INI_WriteInt(File,"TimesKicked",PlayerInfo[playerid][TimesKicked]);
  134. INI_WriteInt(File,"Banned",PlayerInfo[playerid][Banned]);
  135. INI_WriteString(File,"BannedBy",PlayerInfo[playerid][BannedBy]);
  136. INI_WriteString(File,"BanReason",PlayerInfo[playerid][BanReason]);
  137. INI_WriteInt(File,"TimesWarned",PlayerInfo[playerid][TimesWarned]);
  138. INI_Close(File);
  139. return 1;
  140. }
  141.  
  142. Spawned[playerid] = 1;
  143. TogglePlayerSpectating(playerid, 0);
  144. SetPlayerVirtualWorld(playerid, 0);
  145. SetPlayerInterior(playerid, 0);
  146. SetSpawnInfo(playerid, 0, 170, -35.5528, 1420.6594, 13.2465, 98, 0, 0, 0, 0, 0, 0);
  147. SpawnPlayer(playerid);
  148. SetCameraBehindPlayer(playerid);
  149. PlayerInfo[playerid][Money] = 3000;
  150. GivePlayerMoney(playerid, 5000);
  151. SendClientMessage(playerid, GREY, "We hope you enjoy your stay here.");
  152. return 1;
  153. }
  154.  
  155. // END OF LOGIN AND REGISTRATION. \\
  156.  
  157. // ADMIN COMMANDS\\
  158.  
  159.  
  160. // Admin Help
  161. CMD:ahelp(playerid, params[])
  162. {
  163. if(PlayerInfo[playerid][AdminLevel])
  164. {
  165. if(PlayerInfo[playerid][AdminLevel] >= 1)
  166. {
  167. SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Trial Administrator _____________________|");
  168. SendClientMessage(playerid, WHITE, "/a /asay /togadmin /changestatus /setint /setvw ");
  169. }
  170. if(PlayerInfo[playerid][AdminLevel] >= 2)
  171. {
  172. SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Administrator _____________________|");
  173. SendClientMessage(playerid, WHITE, "/kick /ban");
  174. }
  175. if(PlayerInfo[playerid][AdminLevel] >= 3)
  176. {
  177. SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Senior Administrator _____________________|");
  178. SendClientMessage(playerid, WHITE, "/goto /get");
  179. }
  180. if(PlayerInfo[playerid][AdminLevel] >= 4)
  181. {
  182. SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Management _____________________|");
  183. SendClientMessage(playerid, WHITE, "/freeze /unfreeze");
  184. }
  185. if(PlayerInfo[playerid][AdminLevel] == 5)
  186. {
  187. SendClientMessage(playerid, GREY, "{0080FF}|_____________________ Server Owner _____________________|");
  188. SendClientMessage(playerid, WHITE, "/makeadmin /makehelper");
  189. }
  190. }
  191. else return NotAdmin(playerid);
  192. return 1;
  193. }
  194.  
  195. //
  196. CMD:a(playerid, params[])
  197. {
  198. if(PlayerInfo[playerid][AdminLevel])
  199. {
  200. if(AdminChat[playerid] == 1)
  201. {
  202. new msg[128], string[168];
  203. if(sscanf(params, "s[128]", msg)) return SendClientMessage(playerid, GREY, "Usage: /a [message]");
  204. {
  205. format(string,sizeof(string), "* %s %s: %s", GetAdminRank(playerid), RemoveUnderScore(playerid), msg);
  206. SendAdminMessage(BLUE, string);
  207. }
  208. }
  209. else return SendClientMessage(playerid, GREY, "Please enable your Admin Chat by /togadmin.");
  210. }
  211. else return NotAdmin(playerid);
  212. return 1;
  213. }
  214.  
  215. //--
  216. CMD:asay(playerid, params[])
  217. {
  218. if(PlayerInfo[playerid][AdminLevel])
  219. {
  220. new string[128];
  221. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GREY, "Usage: /asay [text]");
  222. format(string, sizeof(string), "{800000}* Admin %s: %s *", RemoveUnderScore(playerid), params);
  223. SendClientMessageToAll(GREY, string);
  224. }
  225. else return NotAdmin(playerid);
  226. return 1;
  227. }
  228.  
  229. //Toggle Admin
  230. CMD:togadmin(playerid, params[])
  231. {
  232. if(PlayerInfo[playerid][AdminLevel])
  233. {
  234. if(AdminChat[playerid])
  235. {
  236. AdminChat[playerid] = 0;
  237. SendClientMessage(playerid, GREY, "You have {C43C3C}Disabled {888888}the Admin Chat.");
  238. }
  239. else
  240. {
  241. AdminChat[playerid] = 1;
  242. SendClientMessage(playerid, GREY, "You have {008000}Enabled {888888}the Admin Chat.");
  243. }
  244. }
  245. else return NotAdmin(playerid);
  246. return 1;
  247. }
  248.  
  249. //KIcking
  250. CMD:kick(playerid, params[])
  251. {
  252. if(PlayerInfo[playerid][AdminLevel] >= 2)
  253. {
  254. new str[128], targetid, reason[128];
  255. if(sscanf(params,"us[128]", targetid, reason)) return SendClientMessage(playerid, GREY, "Usage: /kick [player targetid or name] [reason]");
  256. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
  257. if(PlayerInfo[targetid][AdminLevel] > PlayerInfo[playerid][AdminLevel]) return SendClientMessage(playerid, GREY, "The person you are trying to kick has Higher Admin Level than you.");
  258. format(str, sizeof(str), "Administrator %s has kicked %s. [Reason: %s]", RemoveUnderScore(playerid), RemoveUnderScore(targetid), reason);
  259. SendClientMessageToAll(GREY, str);
  260. PlayerInfo[targetid][TimesKicked] ++;
  261. KickPlayer(targetid);
  262. }
  263. else return NotAdmin(playerid);
  264. return 1;
  265. }
  266.  
  267. // Banning
  268. CMD:ban(playerid, params[])
  269. {
  270. if(PlayerInfo[playerid][AdminLevel] >= 2)
  271. {
  272. new str[128], targetid, reason[128];
  273. if(sscanf(params,"us[128]", targetid, reason))return SendClientMessage(playerid, GREY, "Usage: /ban [player targetid or name] [reason]");
  274.  
  275. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
  276. if(PlayerInfo[targetid][AdminLevel] > PlayerInfo[playerid][AdminLevel]) return SendClientMessage(playerid, GREY, "The person you are trying to Ban has Higher Admin Level than you.");
  277. format(str, sizeof(str), "Administrator %s has Banned %s. [Reason: %s]", RemoveUnderScore(playerid), RemoveUnderScore(targetid), reason);
  278. SendClientMessageToAll(GREY, str);
  279. format(str, sizeof(str), "You have Banned %s's IP Address. [Reason: %s]", RemoveUnderScore(targetid), reason);
  280. SendClientMessage(playerid, GREY, str);
  281. PlayerInfo[targetid][Banned] = 1;
  282. format(PlayerInfo[targetid][BannedBy], 32, "%s", RemoveUnderScore(playerid));
  283. format(PlayerInfo[targetid][BanReason], 128, "%s", reason);
  284. KickPlayer(targetid);
  285. }
  286. else return NotAdmin(playerid);
  287. return 1;
  288. }
  289.  
  290. // Goto and GetID
  291. CMD:goto(playerid, params[])
  292. {
  293. if(PlayerInfo[playerid][AdminLevel] >= 3)
  294. {
  295. new targetid, Float:x, Float:y, Float:z, interior, vw, string[128];
  296. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, GREY, "Usage: /goto [player targetid or name]");
  297. {
  298. if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, GREY, NotConnected);
  299. GetPlayerPos(targetid, x, y, z);
  300. interior = GetPlayerInterior(targetid);
  301. vw = GetPlayerVirtualWorld(targetid);
  302.  
  303. format(string, sizeof(string), "You have teleported to %s's position.", RemoveUnderScore(targetid));
  304. SendClientMessage(playerid, LIBLUE, string);
  305.  
  306. if(IsPlayerInAnyVehicle(playerid))
  307. {
  308. SetVehiclePos(GetPlayerVehicleID(playerid), x+4, y, z);
  309. }
  310. else
  311. {
  312. SetPlayerPos(playerid, x+4, y, z);
  313. SetPlayerInterior(playerid, interior);
  314. SetPlayerVirtualWorld(playerid, vw);
  315. }
  316. }
  317. }
  318. else return NotAdmin(playerid);
  319. return 1;
  320. }
  321.  
  322.  
  323. CMD:get(playerid, params[])
  324. {
  325. if(PlayerInfo[playerid][AdminLevel] >= 3)
  326. {
  327. new targetid, Float:x, Float:y, Float:z, interior, vw, string[128];
  328. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, GREY, "Usage: /get [player targetid or name]");
  329. {
  330. if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, GREY, NotConnected);
  331. GetPlayerPos(playerid, x, y, z);
  332. interior = GetPlayerInterior(playerid);
  333. vw = GetPlayerVirtualWorld(playerid);
  334.  
  335. format(string, sizeof(string), "You have teleported %s to your position.", RemoveUnderScore(targetid));
  336. SendClientMessage(playerid, LIBLUE, string);
  337.  
  338. format(string, sizeof(string), "Admin %s has teleported you to their position.", RemoveUnderScore(playerid));
  339. SendClientMessage(targetid, LIBLUE, string);
  340.  
  341. if(IsPlayerInAnyVehicle(targetid))
  342. {
  343. SetVehiclePos(GetPlayerVehicleID(targetid), x+4, y, z);
  344. }
  345. else
  346. {
  347. SetPlayerPos(targetid, x+4, y, z);
  348. SetPlayerInterior(targetid, interior);
  349. SetPlayerVirtualWorld(targetid, vw);
  350. }
  351. }
  352. }
  353. else return NotAdmin(playerid);
  354. return 1;
  355. }
  356.  
  357. // Warnings
  358. CMD:warn(playerid, params[])
  359. {
  360. if(PlayerInfo[playerid][AdminLevel] >= 1)
  361. {
  362. new targetid, warn[128], string[256];
  363. if(sscanf(params, "us[128]", targetid, warn)) return SendClientMessage(playerid, GREY, "Usage: /warn [player targetid or name] [reason]");
  364. {
  365. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
  366. format(string, sizeof(string), "{FF0000}* WARNING * from Admin %s. [Reason: %s]", RemoveUnderScore(playerid), warn);
  367. SendClientMessage(targetid, WHITE, string);
  368. format(string, sizeof(string), "{FF0000}You have warned %s for %s.", RemoveUnderScore(targetid), warn);
  369. SendClientMessage(playerid, WHITE, string);
  370. PlayerInfo[playerid][TimesWarned] ++;
  371. }
  372. }
  373. else return NotAdmin(playerid);
  374. return 1;
  375. }
  376.  
  377. // Commands making people.
  378. CMD:makeadmin(playerid, params[])
  379. {
  380. if(PlayerInfo[playerid][AdminLevel] == 5)
  381. {
  382. new targetid, level, string[128];
  383. if(sscanf(params, "ud", targetid, level)) return SendClientMessage(playerid, GREY, "Usage: /makeadmin [player targetid or name] [level]");
  384. {
  385. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
  386. PlayerInfo[targetid][AdminLevel] = level;
  387. format(string, sizeof(string), "Administrator %s has set your Admin Level to %s (Level %d).",GetAdminRank(targetid),RemoveUnderScore(playerid), level);
  388. SendClientMessage(targetid, WHITE, string);
  389. format(string, sizeof(string), "You have set %s's Admin Level to %d.", RemoveUnderScore(targetid), level);
  390. SendClientMessage(playerid, WHITE, string);
  391. }
  392. }
  393. else return NotAdmin(playerid);
  394. return 1;
  395. }
  396.  
  397. CMD:makehelper(playerid, params[])
  398. {
  399. if(PlayerInfo[playerid][AdminLevel] == 5)
  400. {
  401. new targetid, string[128];
  402. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, GREY, "Usage: /makeadmin [player targetid or name]");
  403. {
  404. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, NotConnected);
  405. PlayerInfo[targetid][Helper] = 1;
  406. format(string, sizeof(string), "Administrator %s has set your Helper Level to 1.",GetAdminRank(targetid),RemoveUnderScore(playerid));
  407. SendClientMessage(targetid, WHITE, string);
  408. format(string, sizeof(string), "You have set %s's Helper Level to 1.", RemoveUnderScore(targetid));
  409. SendClientMessage(playerid, WHITE, string);
  410. }
  411. }
  412. else return NotAdmin(playerid);
  413. return 1;
  414. }
  415.  
  416. //------//
  417.  
  418. // Freeze Them!
  419.  
  420. CMD:freeze(playerid, params[])
  421. {
  422. if(PlayerInfo[playerid][AdminLevel] >=4)
  423. {
  424. new id, string[128];
  425. if(sscanf(params, "u", id)) return SendClientMessage(playerid, GREY, "Usage: /freeze [player id or name]");
  426. {
  427. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, GREY, NotConnected);
  428. TogglePlayerControllable(id, 0);
  429. format(string, sizeof(string), "Administrator %s has Freezed you.", RemoveUnderScore(playerid));
  430. SendClientMessage(id, LIBLUE, string);
  431. format(string, sizeof(string), "You have frozen %s(ID: %d)", RemoveUnderScore(id), id);
  432. SendClientMessage(playerid, LIBLUE, string);
  433. }
  434. }
  435. else return NotAdmin(playerid);
  436. return 1;
  437. }
  438.  
  439. // Un Freeze them.
  440. CMD:unfreeze(playerid, params[])
  441. {
  442. if(PlayerInfo[playerid][AdminLevel] >=4)
  443. {
  444. new id, string[128];
  445. if(sscanf(params, "u", id)) return SendClientMessage(playerid, GREY, "Usage: /unfreeze [player id or name]");
  446. {
  447. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, GREY, NotConnected);
  448. TogglePlayerControllable(id, 1);
  449. format(string, sizeof(string), "Administrator %s has Unfreezed you.", RemoveUnderScore(playerid));
  450. SendClientMessage(id, LIBLUE, string);
  451. format(string, sizeof(string), "You have unfrozen %s(ID: %d)", RemoveUnderScore(id), id);
  452. SendClientMessage(playerid, LIBLUE, string);
  453. }
  454. }
  455. else return NotAdmin(playerid);
  456. return 1;
  457. }
  458.  
  459. // ###-- END OF ADMIN COMMANDS --###\\
  460.  
  461. // Player Commands! WOo Woo!
  462.  
  463. //Helping.
  464. CMD:help(playerid, params[])
  465. {
  466. if(Spawned[playerid])
  467. {
  468. if(sscanf(params, "s[128]", params))
  469. {
  470. SendClientMessage(playerid, GREY, "{0080FF} Please do either /general or /helper.");
  471. SendClientMessage(playerid, GREY, "{0080FF}Usage: {FFFFFF}/help [option]");
  472. SendClientMessage(playerid, GREY, "| general | helper |");
  473. }
  474. else
  475. {
  476. if(!strcmp(params, "general", true))
  477. {
  478. SendClientMessage(playerid, GREY, "GENERAL: /settings /admins /helpme /me /do /stats");
  479. }
  480. if(!strcmp(params, "helper", true))
  481. {
  482. SendClientMessage(playerid, GREY, "HELPER: /helpme /hpm");
  483. }
  484. }
  485. }
  486. else return NotLogged(playerid);
  487. return 1;
  488. }
  489.  
  490. //Online Admins
  491. CMD:admins(playerid, params[])
  492. {
  493. new str[128];
  494.  
  495. SendClientMessage(playerid, WHITE, "Online Admins.");
  496. for(new i = 0; i < MAX_PLAYERS; i++)
  497. {
  498. if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] >= 1)
  499. {
  500. if(aStatus[i] == 1)
  501. {
  502. format(str, sizeof(str), "%s: %s ({40C040}Administrating)",GetAdminRank(i), RemoveUnderScore(i),i);
  503. }
  504. else if(aStatus[i] == 2)
  505. {
  506. format(str, sizeof(str), "%s: %s ({D52B2B}Roleplaying)",GetAdminRank(i), RemoveUnderScore(i),i);
  507. }
  508. else if(aStatus[i] == 3)
  509. {
  510. format(str, sizeof(str), "%s: %s ({EA9515}Off Duty)",GetAdminRank(i), RemoveUnderScore(i), i);
  511. }
  512. SendClientMessage(playerid, WHITE, str);
  513. }
  514. }
  515. SendClientMessage(playerid, WHITE, "------------------------------------------------");
  516. return 1;
  517. }
  518. CMD:settings(playerid, params[])
  519. {
  520. if(Spawned[playerid])
  521. {
  522. ShowProfileSettings(playerid);
  523. }
  524. else return NotLogged(playerid);
  525. return 1;
  526. }
  527.  
  528. //---------------------------------------------------------------------
  529.  
  530. // Get help from helpers
  531. MD:helpme(playerid, params[])
  532. {
  533. new string[128];
  534. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GREY, "Usage: /helpme [Message - What you need help with?]");
  535. format(string, sizeof(string), "[HELP] Player %s (ID: %d): %s",RemoveUnderScore(playerid), playerid, params);
  536. SendHelperMessage(LIBLUE, string);
  537. SendClientMessage(playerid, LIBLUE, "Your /helpme has been posted to online Helpers..");
  538. return 1;
  539. }
  540.  
  541. CMD:me(playerid, params[])
  542. {
  543. new string[128];
  544. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GREY, "Usage: /me [action]");
  545. format(string, sizeof(string), "%s %s",RemoveUnderScore(playerid), params);
  546. CloseMessage(playerid, LIBLUE, string);
  547. return 1;
  548. }
  549.  
  550. CMD:do(playerid, params[])
  551. {
  552. new string[128];
  553. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GREY, "Usage: /do [action]");
  554. format(string, sizeof(string), "%s ((%s))",params, RemoveUnderScore(playerid));
  555. CloseMessage(playerid, LIBLUE, string);
  556. return 1;
  557. }
  558.  
  559. CMD:stats(playerid, params[])
  560. {
  561. new string[512];
  562. SendClientMessage(playerid, BLUE, "|_____[STATS]_____|");
  563. // PLAYER NAME
  564. format(string, sizeof(string), "Account Name: {50BB44}%s",PlayerInfo[playerid][Name]);
  565. SendClientMessage(playerid, WHITE, string);
  566. // GENDER
  567. if(PlayerInfo[playerid][Gender] == 1) format(string, sizeof(string), "Gender: {50BB44}Male");
  568. else if(PlayerInfo[playerid][Gender] == 2) format(string, sizeof(string), "Gender: {50BB44}Female");
  569. SendClientMessage(playerid, WHITE, string);
  570. // ADMIN LEVEL
  571. if(PlayerInfo[playerid][AdminLevel] == 0) format (string, sizeof(string), "Administrator Level: {50BB44}None.");
  572. else format(string, sizeof(string), "Administrator Level: {50BB44}%s {FFFFFF}(%d)",GetAdminRank(playerid),PlayerInfo[playerid][AdminLevel]);
  573. SendClientMessage(playerid, WHITE, string);
  574. // LEVEL
  575. format(string, sizeof(string), "Level: {50BB44}%d",PlayerInfo[playerid][Level]);
  576. SendClientMessage(playerid, WHITE, string);
  577. return 1;
  578. }
  579.  
  580. public OnPlayerConnect(playerid)
  581. {
  582. SetPlayerColor(playerid, WHITE);
  583. SetTimerEx("InterPol", 2000, 0, "i", playerid);
  584. RemoveBuildings(playerid);
  585. aStatus[playerid] = 1; // Administrating
  586. if(IsValidName(playerid))
  587. {
  588. if(fexist(UserPath(playerid)))
  589. {
  590. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  591. if(!PlayerInfo[playerid][Banned])
  592. {
  593. ShowLoginDialog(playerid);
  594. }
  595. else if(PlayerInfo[playerid][Banned])
  596. {
  597. new string[128];
  598. SendClientMessage(playerid, GREY, "You are banned from Western County Roleplay. Make a Ban Appeal On Forums, if you wish to be Unbanned.");
  599. format(string, sizeof(string), "Banned By: {50BB44}%s", PlayerInfo[playerid][BannedBy]);
  600. SendClientMessage(playerid, GREY, string);
  601.  
  602. format(string, sizeof(string), "Ban Reason: {50BB44}%s", PlayerInfo[playerid][BanReason]);
  603. SendClientMessage(playerid, GREY, string);
  604.  
  605. KickPlayer(playerid);
  606. }
  607. }
  608. else
  609. {
  610. ShowRegisterDialog(playerid);
  611. }
  612. }
  613. else
  614. {
  615. SendClientMessage(playerid, RED, "You have been Kicked for using Incorrect Name Format.Use Firstname_Lastname.");
  616. KickPlayer(playerid);
  617. }
  618. return 1;
  619. }
  620.  
  621. public OnPlayerDisconnect(playerid, reason)
  622. {
  623. if(PlayerInfo[playerid][Registered])
  624. {
  625. if(Spawned[playerid])
  626. {
  627. SaveUser(playerid);
  628. }
  629. }
  630. new string[128];
  631. switch(reason)
  632. {
  633. case 0: format(string,sizeof string,"%s left the server. (Lost Connection)", RemoveUnderScore(playerid));
  634. case 1: format(string,sizeof string,"%s left the server.", RemoveUnderScore(playerid));
  635. case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)", RemoveUnderScore(playerid));
  636. }
  637. return 1;
  638. }
  639.  
  640. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  641. {
  642. switch( dialogid )
  643. {
  644. case DIALOG_REGISTER:
  645. {
  646. if(!response)
  647. {
  648. SendClientMessage(playerid, GREY,"You cannot proceed without Registeration.");
  649. ShowRegisterDialog(playerid);
  650. }
  651. if(response)
  652. {
  653. if(!strlen(inputtext))
  654. {
  655. ShowRegisterDialog(playerid);
  656. SendClientMessage(playerid, GREY,"You cannot proceed without Registeration.");
  657. }
  658. else
  659. {
  660. PlayerInfo[playerid][Password] = udb_hash(inputtext);
  661. //SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  662. //SpawnPlayer(playerid);
  663. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nType in your {50BB44}Age. {FFFFFF} (( e.g '25' ))","Enter","");
  664. }
  665. }
  666. }
  667. case DIALOG_AGE:
  668. {
  669. if(!response)
  670. {
  671. SendClientMessage(playerid, GREY,"Please enter your {50BB44}Age.");
  672. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nType in your {50BB44}Age. {FFFFFF} (( e.g '25' ))","Enter","");
  673. }
  674. else if(response)
  675. {
  676. PlayerInfo[playerid][Age] = strval(inputtext);
  677. ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nPlease Enter your {50BB44}Gender. {FFFFFF} (( 'Male' or 'Female' ))","Enter","");
  678. }
  679. }
  680. case DIALOG_GENDER:
  681. {
  682. if(!response)
  683. {
  684. SendClientMessage(playerid, GREY,"Please select your {50BB44}Gender.");
  685. ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nPlease Enter your {50BB44}Gender. {FFFFFF} (( 'Male' or 'Female' ))","Enter","");
  686. }
  687. else if(response)
  688. {
  689. NewStats(playerid);
  690. if(!strlen(inputtext))
  691. {
  692. ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nPlease Enter your {50BB44}Gender. {FFFFFF} (( 'Male' or 'Female' ))","Enter","");
  693. SendClientMessage(playerid, GREY,"Please select your {50BB44}Gender.");
  694. }
  695. if(strcmp(inputtext, "Male", true) == 0)
  696. {
  697. PlayerInfo[playerid][Gender] = 1;
  698. SendCitizenship(playerid);
  699. }
  700. else if(strcmp(inputtext, "Female", true) == 0)
  701. {
  702. PlayerInfo[playerid][Gender] = 2;
  703. SendCitizenship(playerid);
  704. }
  705. else
  706. {
  707. ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_INPUT,"{FFFFFF}Registeration Form","{FFFFFF}\nPlease Enter your {50BB44}Gender. {FFFFFF} (( 'Male' or 'Female' ))","Enter","");
  708. }
  709. }
  710. }
  711. case DIALOG_LOGIN:
  712. {
  713. if(!response)
  714. {
  715. ShowLoginDialog(playerid);
  716. SendClientMessage(playerid, GREY,"You need to Login in order to play.");
  717. }
  718. if(response)
  719. {
  720. if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
  721. {
  722. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  723. GivePlayerMoney(playerid, PlayerInfo[playerid][Money]);
  724. ShowCharacterDialog(playerid);
  725. }
  726. else
  727. {
  728. ShowLoginDialog(playerid);
  729. SendClientMessage(playerid, GREY, "Incorrect Password");
  730. LoginAttempt[playerid] ++;
  731. if(LoginAttempt[playerid] == 2)
  732. {
  733. LoginAttempt[playerid] = 0;
  734. KickPlayer(playerid);
  735. }
  736. }
  737. }
  738. }
  739. case DIALOG_CHARSELECT:
  740. {
  741. if(!response)
  742. {
  743. ShowCharacterDialog(playerid);
  744. SendClientMessage(playerid, GREY,"Please Select your Character in order to spawn, or click 'Profile Settings' for the settings.");
  745. }
  746. if(response)
  747. {
  748. switch(listitem)
  749. {
  750. case 0:
  751. {
  752. SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  753. SpawnPlayer(playerid);
  754. TogglePlayerSpectating(playerid, 0);
  755. if(PlayerInfo[playerid][Skin]) SetPlayerSkin(playerid, 170);
  756. else SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
  757. ShowCharacterInformation(playerid);
  758. HideMNT(playerid);
  759. }
  760. case 1:
  761. {
  762. ShowProfileSettings(playerid);
  763. }
  764. }
  765. }
  766. }
  767. case DIALOG_PROFILE:
  768. {
  769. if(!response)
  770. {
  771. SendClientMessage(playerid, GREY,"You have chosen to close the Profile Settings.");
  772. if(!Spawned[playerid])
  773. {
  774. ShowLoginDialog(playerid);
  775. }
  776. }
  777. if(response)
  778. {
  779. switch(listitem)
  780. {
  781. case 0:
  782. {
  783. // TO be Done Later
  784. }
  785. case 1:
  786. {
  787. ShowPlayerDialog(playerid, DIALOG_CHANGEAGE, DIALOG_STYLE_INPUT,"{FFFFFF}New Age","{FFFFFF}Please enter your Character's new age.","Enter","");
  788. }
  789. case 2:
  790. {
  791. ShowPlayerDialog(playerid, DIALOG_CHANGEGEN, DIALOG_STYLE_INPUT,"{FFFFFF}New Gender","{FFFFFF}Please enter your Character's new gender. (( 'Male' or 'Female' ))","Enter","");
  792. }
  793. case 3:
  794. {
  795. ShowPlayerDialog(playerid, DIALOG_CHANGEPASS, DIALOG_STYLE_INPUT,"{FFFFFF}New Password","{FFFFFF}Please enter your new password.","Enter","");
  796. }
  797. }
  798. }
  799. }
  800. case DIALOG_CHANGEAGE:
  801. {
  802. if(!response)
  803. {
  804. SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
  805. }
  806. else
  807. {
  808. new string[128];
  809. PlayerInfo[playerid][Age] = strval(inputtext);
  810. format(string, sizeof(string), "You have set your Character's Age to {50BB44}%d.", strval(inputtext));
  811. ShowPlayerDialog(playerid, DIALOG_AGEMSG, DIALOG_STYLE_MSGBOX, "{FFFFFF}New Age",string,"Ok","");
  812. }
  813. }
  814. case DIALOG_CHANGEGEN:
  815. {
  816. if(!response)
  817. {
  818. SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
  819. }
  820. else
  821. {
  822. if(!strlen(inputtext))
  823. {
  824. SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
  825. }
  826. if(strcmp(inputtext, "Male", true) == 0)
  827. {
  828. PlayerInfo[playerid][Gender] = 1;
  829. SendClientMessage(playerid, GREY, "You have successfully changed your Gender to {50BB44}Male.");
  830. }
  831. else if(strcmp(inputtext, "Female", true) == 0)
  832. {
  833. PlayerInfo[playerid][Gender] = 2;
  834. SendClientMessage(playerid, GREY, "You have successfully changed your Gender to {50BB44}Female.");
  835. }
  836. }
  837. }
  838. case DIALOG_CHANGEPASS:
  839. {
  840. if(!response)
  841. {
  842. SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
  843. }
  844. else
  845. {
  846. if(!strlen(inputtext))
  847. {
  848. SendClientMessage(playerid, GREY,"You have chosen to cancel the changes.");
  849. }
  850. else
  851. {
  852. new string[128];
  853. format(string, sizeof(string), "You have successfully changed your password to {50BB44}%s.", inputtext);
  854. SendClientMessage(playerid, GREY, string);
  855. PlayerInfo[playerid][Password] = udb_hash(inputtext);
  856. }
  857. }
  858. }
  859. case DIALOG_ASTATUS:
  860. {
  861. if(!response)
  862. {
  863. // Do nothing
  864. }
  865. else if(response)
  866. {
  867. switch(listitem)
  868. {
  869. case 0:
  870. {
  871. aStatus[playerid] = 1;
  872. SendClientMessage(playerid, GREY,"You have Changed your Administrator Status to {58A624}Administrating.");
  873. }
  874. case 1:
  875. {
  876. aStatus[playerid] = 2;
  877. SendClientMessage(playerid, GREY,"You have Changed your Administrator Status to {FF0000}Roleplaying.");
  878. }
  879. case 2:
  880. {
  881. aStatus[playerid] = 3;
  882. SendClientMessage(playerid, GREY,"You have Changed your Administrator Status to {FF8C00}Off Duty.");
  883. }
  884. }
  885. }
  886. }
  887. }
  888. return 1;
  889. }
  890.  
  891. stock LoadMainScreenTXD()
  892. {
  893. TDEditor_TD[0] = TextDrawCreate(-27.500000, -50.625000, "box");
  894. TextDrawLetterSize(TDEditor_TD[0], 0.000000, 18.599998);
  895. TextDrawTextSize(TDEditor_TD[0], 699.500000, 0.000000);
  896. TextDrawAlignment(TDEditor_TD[0], 1);
  897. TextDrawColor(TDEditor_TD[0], -1);
  898. TextDrawUseBox(TDEditor_TD[0], 1);
  899. TextDrawBoxColor(TDEditor_TD[0], 110);
  900. TextDrawSetShadow(TDEditor_TD[0], 0);
  901. TextDrawSetOutline(TDEditor_TD[0], 0);
  902. TextDrawBackgroundColor(TDEditor_TD[0], 255);
  903. TextDrawFont(TDEditor_TD[0], 1);
  904. TextDrawSetProportional(TDEditor_TD[0], 1);
  905. TextDrawSetShadow(TDEditor_TD[0], 0);
  906.  
  907. TDEditor_TD[1] = TextDrawCreate(193.000000, 39.062500, "Western County");
  908. TextDrawLetterSize(TDEditor_TD[1], 0.865500, 3.332499);
  909. TextDrawAlignment(TDEditor_TD[1], 1);
  910. TextDrawColor(TDEditor_TD[1], -1);
  911. TextDrawSetShadow(TDEditor_TD[1], 0);
  912. TextDrawSetOutline(TDEditor_TD[1], 1);
  913. TextDrawBackgroundColor(TDEditor_TD[1], 255);
  914. TextDrawFont(TDEditor_TD[1], 3);
  915. TextDrawSetProportional(TDEditor_TD[1], 1);
  916. TextDrawSetShadow(TDEditor_TD[1], 0);
  917.  
  918. TDEditor_TD[2] = TextDrawCreate(265.500000, 70.125000, "Roleplay");
  919. TextDrawLetterSize(TDEditor_TD[2], 0.737999, 2.396251);
  920. TextDrawAlignment(TDEditor_TD[2], 1);
  921. TextDrawColor(TDEditor_TD[2], -1);
  922. TextDrawSetShadow(TDEditor_TD[2], 0);
  923. TextDrawSetOutline(TDEditor_TD[2], 1);
  924. TextDrawBackgroundColor(TDEditor_TD[2], 255);
  925. TextDrawFont(TDEditor_TD[2], 0);
  926. TextDrawSetProportional(TDEditor_TD[2], 1);
  927. TextDrawSetShadow(TDEditor_TD[2], 0);
  928.  
  929. TDEditor_TD[3] = TextDrawCreate(452.000000, 16.312500, "");
  930. TextDrawLetterSize(TDEditor_TD[3], 0.000000, 0.000000);
  931. TextDrawTextSize(TDEditor_TD[3], 60.000000, 72.062500);
  932. TextDrawAlignment(TDEditor_TD[3], 1);
  933. TextDrawColor(TDEditor_TD[3], -1);
  934. TextDrawSetShadow(TDEditor_TD[3], 0);
  935. TextDrawSetOutline(TDEditor_TD[3], 0);
  936. TextDrawBackgroundColor(TDEditor_TD[3], 0);
  937. TextDrawFont(TDEditor_TD[3], 5);
  938. TextDrawSetProportional(TDEditor_TD[3], 1);
  939. TextDrawSetShadow(TDEditor_TD[3], 0);
  940. TextDrawSetPreviewModel(TDEditor_TD[3], 170);
  941. TextDrawSetPreviewRot(TDEditor_TD[3], 0.000000, 0.000000, -30.000000, 1.000000);
  942.  
  943. TDEditor_TD[4] = TextDrawCreate(419.500000, 18.062500, "");
  944. TextDrawLetterSize(TDEditor_TD[4], 0.000000, 0.000000);
  945. TextDrawTextSize(TDEditor_TD[4], 60.000000, 72.062500);
  946. TextDrawAlignment(TDEditor_TD[4], 1);
  947. TextDrawColor(TDEditor_TD[4], -1);
  948. TextDrawSetShadow(TDEditor_TD[4], 0);
  949. TextDrawSetOutline(TDEditor_TD[4], 0);
  950. TextDrawBackgroundColor(TDEditor_TD[4], 0);
  951. TextDrawFont(TDEditor_TD[4], 5);
  952. TextDrawSetProportional(TDEditor_TD[4], 1);
  953. TextDrawSetShadow(TDEditor_TD[4], 0);
  954. TextDrawSetPreviewModel(TDEditor_TD[4], 161);
  955. TextDrawSetPreviewRot(TDEditor_TD[4], 0.000000, 0.000000, 30.000000, 1.000000);
  956.  
  957. TDEditor_TD[5] = TextDrawCreate(-56.000000, 312.937500, "box");
  958. TextDrawLetterSize(TDEditor_TD[5], 0.000000, 18.599998);
  959. TextDrawTextSize(TDEditor_TD[5], 671.000000, 0.000000);
  960. TextDrawAlignment(TDEditor_TD[5], 1);
  961. TextDrawColor(TDEditor_TD[5], -1);
  962. TextDrawUseBox(TDEditor_TD[5], 1);
  963. TextDrawBoxColor(TDEditor_TD[5], 110);
  964. TextDrawSetShadow(TDEditor_TD[5], 0);
  965. TextDrawSetOutline(TDEditor_TD[5], 0);
  966. TextDrawBackgroundColor(TDEditor_TD[5], 255);
  967. TextDrawFont(TDEditor_TD[5], 1);
  968. TextDrawSetProportional(TDEditor_TD[5], 1);
  969. TextDrawSetShadow(TDEditor_TD[5], 0);
  970.  
  971. TDEditor_TD[6] = TextDrawCreate(0.500000, 123.937500, "box");
  972. TextDrawLetterSize(TDEditor_TD[6], 0.000000, -0.649999);
  973. TextDrawTextSize(TDEditor_TD[6], 697.500000, 0.000000);
  974. TextDrawAlignment(TDEditor_TD[6], 1);
  975. TextDrawColor(TDEditor_TD[6], -1);
  976. TextDrawUseBox(TDEditor_TD[6], 1);
  977. TextDrawBoxColor(TDEditor_TD[6], 110);
  978. TextDrawSetShadow(TDEditor_TD[6], 0);
  979. TextDrawSetOutline(TDEditor_TD[6], 0);
  980. TextDrawBackgroundColor(TDEditor_TD[6], 255);
  981. TextDrawFont(TDEditor_TD[6], 1);
  982. TextDrawSetProportional(TDEditor_TD[6], 1);
  983. TextDrawSetShadow(TDEditor_TD[6], 0);
  984.  
  985. TDEditor_TD[7] = TextDrawCreate(-18.000000, 311.625000, "box");
  986. TextDrawLetterSize(TDEditor_TD[7], 0.000000, -0.649999);
  987. TextDrawTextSize(TDEditor_TD[7], 679.000000, 0.000000);
  988. TextDrawAlignment(TDEditor_TD[7], 1);
  989. TextDrawColor(TDEditor_TD[7], -1);
  990. TextDrawUseBox(TDEditor_TD[7], 1);
  991. TextDrawBoxColor(TDEditor_TD[7], 110);
  992. TextDrawSetShadow(TDEditor_TD[7], 0);
  993. TextDrawSetOutline(TDEditor_TD[7], 0);
  994. TextDrawBackgroundColor(TDEditor_TD[7], 255);
  995. TextDrawFont(TDEditor_TD[7], 1);
  996. TextDrawSetProportional(TDEditor_TD[7], 1);
  997. TextDrawSetShadow(TDEditor_TD[7], 0);
  998.  
  999. TDEditor_TD[8] = TextDrawCreate(8.000000, 427.562500, "http://westerncountyrp.net16.net/index.php");
  1000. TextDrawLetterSize(TDEditor_TD[8], 0.287499, 1.315625);
  1001. TextDrawAlignment(TDEditor_TD[8], 1);
  1002. TextDrawColor(TDEditor_TD[8], -1);
  1003. TextDrawSetShadow(TDEditor_TD[8], 0);
  1004. TextDrawSetOutline(TDEditor_TD[8], 1);
  1005. TextDrawBackgroundColor(TDEditor_TD[8], 255);
  1006. TextDrawFont(TDEditor_TD[8], 1);
  1007. TextDrawSetProportional(TDEditor_TD[8], 1);
  1008. TextDrawSetShadow(TDEditor_TD[8], 0);
  1009. return 1;
  1010. }
  1011. //---------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement