Guest User

Untitled

a guest
Nov 13th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.53 KB | None | 0 0
  1. // ohmy: IM ALLREADY CREATE THE FOLDER DIRECTORY TOO
  2. // ohmy: THE COMPILING IS SUCCESS WITHOUT ANY ERROR OR WARNING
  3. // ohmy: BUT IT NOT CREATE THE .INI FILE
  4. // ohmy: I USE A BIT OF INFINITY90 CMD
  5.  
  6. // Includes
  7. #include <a_samp>
  8. #include <YSI\y_ini>
  9. #include <zcmd>
  10. #include <foreach>
  11. #include <sscanf>
  12.  
  13. // Login Dialogs
  14. #define DIALOG_REGISTER 1
  15. #define DIALOG_LOGIN 2
  16. #define DIALOG_SUCCESS_1 3
  17. #define DIALOG_SUCCESS_2 4
  18. // Where The Userfile Gets Created!
  19. #define PATH "/Users/%s.ini"
  20.  
  21. // New
  22. new teleports;
  23.  
  24. // Colours
  25. #define COLOR_WHITE "{FFFFFF}"
  26. #define COLOR_RED "{F81414}"
  27. #define COLOR_GREEN "{00FF22}"
  28. #define COLOR_LIGHTBLUE "{00CED1}"
  29. #define COLOR_YELLOW 0xFFFF00AA
  30. #define COLOR_GGREEN 0x33AA33AA
  31. #define COLOR_PURPLE 0xC2A2DAAA
  32. #define COLOR_PINK 0xFF66FFAA
  33. #define COLOR_ORANGE 0xFF8C00AA
  34. #define COLOR_DRED 0xFF0000AA
  35. #define COLOR_BROWN 0x654321AA
  36.  
  37. // Forwards!
  38. forward SendStaffMessage(color, string[]);
  39.  
  40. // Stats / Saves
  41. enum pInfo
  42. {
  43. pPass,
  44. pCash,
  45. pAdmin,
  46. pKills,
  47. pDeaths,
  48. pScore,
  49. pMuted
  50. }
  51. new PlayerInfo[MAX_PLAYERS][pInfo];
  52.  
  53. // Loading / Finding The Players Data Once Login
  54. forward LoadUser_data(playerid,name[],value[]);
  55. public LoadUser_data(playerid,name[],value[])
  56. {
  57. INI_Int("Password",PlayerInfo[playerid][pPass]);
  58. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  59. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  60. INI_Int("Kills",PlayerInfo[playerid][pKills]);
  61. INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  62. INI_Int("Score",PlayerInfo[playerid][pScore]);
  63. INI_Int("Muted",PlayerInfo[playerid][pMuted]);
  64. return 1;
  65. }
  66.  
  67. // The Location Of Players File
  68. stock UserPath(playerid)
  69. {
  70. new string[128],playername[MAX_PLAYER_NAME];
  71. GetPlayerName(playerid,playername,sizeof(playername));
  72. format(string,sizeof(string),PATH,playername);
  73. return string;
  74. }
  75.  
  76. // Hashes The Players Passwords!
  77. stock udb_hash(buf[]) {
  78. new length=strlen(buf);
  79. new s1 = 1;
  80. new s2 = 0;
  81. new n;
  82. for (n=0; n<length; n++)
  83. {
  84. s1 = (s1 + buf[n]) % 65521;
  85. s2 = (s2 + s1) % 65521;
  86. }
  87. return (s2 << 16) + s1;
  88. }
  89.  
  90. public SendStaffMessage(color, string[])
  91. {
  92. foreach(Player, i)
  93. {
  94. if(PlayerInfo[i][pAdmin] >= 1)
  95. {
  96. SendClientMessage(i, color, string);
  97. }
  98. }
  99. }
  100.  
  101.  
  102. #if defined FILTERSCRIPT
  103.  
  104. public OnFilterScriptInit()
  105. {
  106. main()
  107. print("\n--------------------------------------");
  108. print(" Infinty90 Register / Admin System! ");
  109. print("--------------------------------------\n");
  110. return 1;
  111. }
  112.  
  113. public OnFilterScriptExit()
  114. {
  115. return 1;
  116. }
  117.  
  118. #endif
  119.  
  120. public OnPlayerConnect(playerid)
  121. {
  122. if(fexist(UserPath(playerid)))
  123. {
  124. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  125. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Enter Your Password You Registered With!","Login","Quit");
  126. }
  127. else
  128. {
  129. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Register Below",""COLOR_WHITE"Enter A Password To Register And Play!","Register","Quit");
  130. }
  131. return 1;
  132. }
  133.  
  134. public OnPlayerDisconnect(playerid, reason)
  135. {
  136. new INI:File = INI_Open(UserPath(playerid));
  137. INI_SetTag(File,"data");
  138. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  139. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  140. INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  141. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  142. INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
  143. INI_WriteInt(File,"Muted",PlayerInfo[playerid][pMuted]);
  144. INI_Close(File);
  145. return 1;
  146. }
  147.  
  148. public OnPlayerSpawn(playerid)
  149. {
  150. return 1;
  151. }
  152.  
  153. public OnPlayerDeath(playerid, killerid, reason)
  154. {
  155. PlayerInfo[killerid][pKills]++;
  156. PlayerInfo[playerid][pDeaths]++;
  157. PlayerInfo[killerid][pScore] = 1;
  158. PlayerInfo[playerid][pScore] = -1;
  159. return 1;
  160. }
  161.  
  162. public OnVehicleSpawn(vehicleid)
  163. {
  164. return 1;
  165. }
  166.  
  167. public OnVehicleDeath(vehicleid, killerid)
  168. {
  169. return 1;
  170. }
  171.  
  172. public OnPlayerText(playerid, text[])
  173. {
  174. return 1;
  175. }
  176.  
  177.  
  178. CMD:a(playerid, params[])
  179. {
  180.  
  181. if(PlayerInfo[playerid][pAdmin] >= 1)
  182. {
  183. new admin[128];
  184. new Name[MAX_PLAYER_NAME];
  185. GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  186. if(PlayerInfo[playerid][pAdmin] == 1) format(admin, sizeof(admin), "[Admin Chat] (Level 1 Admin) %s: %s", Name, params);
  187. else if(PlayerInfo[playerid][pAdmin] == 2) format(admin, sizeof(admin), "[Admin Chat] (Level 2 Admin) %s: %s", Name, params);
  188. else if(PlayerInfo[playerid][pAdmin] == 3) format(admin, sizeof(admin), "[Admin Chat] (Level 3 Admin) %s: %s", Name, params);
  189. else if(PlayerInfo[playerid][pAdmin] == 4) format(admin, sizeof(admin), "[Admin Chat] (Level 4 Admin) %s: %s", Name, params);
  190. SendStaffMessage(COLOR_GGREEN, admin);
  191. }
  192. return 1;
  193. }
  194.  
  195. CMD:kick(playerid, params[])
  196. {
  197. if(PlayerInfo[playerid][pAdmin] >= 1)
  198. {
  199. new targetid, reason;
  200. new VBName[MAX_PLAYER_NAME];
  201. new VBName1[MAX_PLAYER_NAME];
  202. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  203. GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
  204. if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /kick [playerid] [reason]");
  205. if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Yourself!");
  206. if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
  207. else
  208. {
  209. new str[128];
  210. format(str, sizeof(str), "Administrator %s Has Kicked %s Reason: %d!", VBName, VBName1, reason);
  211. SendClientMessageToAll(COLOR_DRED,str);
  212. Kick(targetid);
  213. }
  214. }
  215. else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
  216. return 1;
  217. }
  218.  
  219. CMD:makeadmin(playerid, params[]) {
  220. if(PlayerInfo[playerid][pAdmin] >= 4) {
  221. new VBName[MAX_PLAYER_NAME];
  222. new VBName1[MAX_PLAYER_NAME];
  223. new targetid;
  224. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  225. GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
  226. new
  227. iAdminValue,
  228. iTargetID;
  229.  
  230. if(sscanf(params, "di", iTargetID, iAdminValue)) {
  231. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /makeadmin [playerid] [level]");
  232. }
  233. else if(IsPlayerConnected(iTargetID)) {
  234. new
  235. szMessage[47 + (MAX_PLAYER_NAME * 2)];
  236.  
  237. if(iAdminValue < 0 || iAdminValue > 4) return SendClientMessage(playerid, COLOR_PURPLE, "Valid range is 0 - 8.");
  238. PlayerInfo[iTargetID][pAdmin] = iAdminValue;
  239. format(szMessage, sizeof(szMessage), "Administrator %s has promoted %s to a level %d admin.", VBName, VBName1, iAdminValue);
  240. SendStaffMessage(COLOR_PURPLE,szMessage);
  241. format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, VBName);
  242. SendClientMessage(iTargetID, COLOR_PURPLE, szMessage);
  243. format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", VBName1,iAdminValue);
  244. SendClientMessage(playerid, COLOR_PURPLE, szMessage);
  245. }
  246. else SendClientMessage(playerid, COLOR_PURPLE, "Invalid player specified.");
  247. }
  248. return 1;
  249. }
  250.  
  251. CMD:ban(playerid, params[])
  252. {
  253. if(PlayerInfo[playerid][pAdmin] >= 1)
  254. {
  255. new targetid, reason;
  256. new VBName[MAX_PLAYER_NAME];
  257. new VBName1[MAX_PLAYER_NAME];
  258. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  259. GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
  260. if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_DRED,"Usage: /Ban [playerid] [reason]");
  261. if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Ban Yourself!");
  262. if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
  263. else
  264. {
  265. new str[128];
  266. format(str, sizeof(str), "Administrator %s Has Banned %s Reason: %d!", VBName, VBName1, reason);
  267. SendClientMessageToAll(COLOR_DRED,str);
  268. Ban(targetid);
  269. }
  270. }
  271. else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
  272. return 1;
  273. }
  274.  
  275. CMD:banip(playerid, params[])
  276. {
  277. if(PlayerInfo[playerid][pAdmin] >= 3)
  278. {
  279. new
  280. type[ 128 ],
  281. string[ 128 ]
  282. ;
  283. if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "Usage: /banip [IP]");
  284. else
  285. {
  286. format(string, sizeof(string),"banip %s", type);
  287. SendRconCommand(string);
  288. SendRconCommand("reloadbans");
  289. }
  290. return true;
  291. }
  292. return 1;
  293. }
  294.  
  295. CMD:unbanip(playerid, params[])
  296. {
  297. new type[128],string[128];
  298. new VBName[MAX_PLAYER_NAME];
  299. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  300. if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "USAGE: /Unbanip [Players IP]");
  301. else
  302. {
  303. if(PlayerInfo[playerid][pAdmin] >= 3)
  304. {
  305. format(string, sizeof(string),"unbanip %s", type);
  306. SendRconCommand(string);
  307. SendRconCommand("reloadbans");
  308. format(string, sizeof(string), "Administrator: %s has unbanned IP %s", VBName, type);
  309. SendStaffMessage(-1,string);
  310. }
  311. else
  312. {
  313. return SendClientMessage(playerid, -1 ,"You dont have access!");
  314. }
  315. }
  316. return true;
  317. }
  318.  
  319. CMD:clearchat(playerid,params[])
  320. {
  321. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_DRED, "ERROR: You must be level 1 to use this command!" );
  322. {
  323. new string[128], VBName[MAX_PLAYER_NAME];
  324. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  325. for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll(COLOR_PURPLE, " " );
  326. format(string,sizeof(string),"The Server Chat Has Been Cleared By Administrator %s", VBName);
  327. SendClientMessageToAll(COLOR_DRED, string);
  328. return 1;
  329. }
  330. }
  331.  
  332. CMD:givemoney(playerid, params[])
  333. {
  334. if (PlayerInfo[playerid][pAdmin] >= 3)
  335. {
  336. new string[128], giveplayerid, money;
  337. new VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME];
  338. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  339. GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
  340. if(sscanf(params, "dd", giveplayerid, money)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /givemoney [playerid] [money]");
  341.  
  342. if(IsPlayerConnected(giveplayerid))
  343. {
  344. GivePlayerMoney(giveplayerid, money);
  345. format(string, sizeof(string), "[ADMIN] %s has given %s $%d.", VBName, VBName1, money);
  346. SendStaffMessage(COLOR_DRED, string);
  347. }
  348. }
  349. return 1;
  350. }
  351.  
  352. CMD:pos(playerid, params[])
  353. {
  354. if(PlayerInfo[playerid][pAdmin] >= 2)
  355. {
  356. new Float: pos[3], int;
  357. if(sscanf(params, "fffd", pos[0], pos[1], pos[2], int)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /pos [x coordinate] [y coordinate] [z coordinate] [interior]");
  358.  
  359. SendClientMessage(playerid, COLOR_PURPLE, "You have teleported!");
  360. SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  361. SetPlayerInterior(playerid, int);
  362. }
  363. return 1;
  364. }
  365.  
  366. CMD:teleports(playerid, params[])
  367. {
  368. if(PlayerInfo[playerid][pAdmin] >= 2)
  369. {
  370. ShowPlayerDialog(playerid,teleports, DIALOG_STYLE_LIST,"Teleports List For Admins","Los Santos\nSan Fierro\nLas Venturas","Teleport!","Cancel");
  371. return 1;
  372. }
  373. return 1;
  374. }
  375.  
  376. CMD:jetpack(playerid, params[])
  377. {
  378. if(PlayerInfo[playerid][pAdmin] >= 3) {
  379. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  380. new string[128];
  381. new VBName[MAX_PLAYER_NAME];
  382. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  383. format(string, sizeof(string), "[ADMIN] %s gave themself a jetpack.", VBName);
  384. SendStaffMessage(COLOR_DRED, string);
  385. return 1;
  386. }
  387. return 1;
  388. }
  389.  
  390. CMD:armour(playerid, params[])
  391. {
  392. new string[128], playa, health, VBName [MAX_PLAYER_NAME], VBName1 [MAX_PLAYER_NAME];
  393. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  394. GetPlayerName(playa, VBName1, MAX_PLAYER_NAME);
  395. if(sscanf(params, "dd", playa, health))
  396. {
  397. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /armour [playerid] [armor]");
  398. return 1;
  399. }
  400. if (PlayerInfo[playerid][pAdmin] >= 3)
  401. {
  402. if(IsPlayerConnected(playa))
  403. {
  404. if(playa != INVALID_PLAYER_ID)
  405. {
  406. SetPlayerArmour(playa, health);
  407. format(string, sizeof(string), "[ADMIN] %s set %s's armour to %d.", VBName, VBName1, health);
  408. SendStaffMessage(COLOR_DRED, string);
  409. }
  410. }
  411. }
  412. return 1;
  413. }
  414.  
  415. CMD:health(playerid, params[])
  416. {
  417. new string[128], playa, health, VBName [MAX_PLAYER_NAME], VBName1 [MAX_PLAYER_NAME];
  418. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  419. GetPlayerName(playa, VBName1, MAX_PLAYER_NAME);
  420. if(sscanf(params, "dd", playa, health))
  421. {
  422. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /health [playerid] [armor]");
  423. return 1;
  424. }
  425. if (PlayerInfo[playerid][pAdmin] >= 3)
  426. {
  427. if(IsPlayerConnected(playa))
  428. {
  429. if(playa != INVALID_PLAYER_ID)
  430. {
  431. SetPlayerHealth(playa, health);
  432. format(string, sizeof(string), "[ADMIN] %s set %s's armour to %d.", VBName, VBName1, health);
  433. SendStaffMessage(COLOR_DRED, string);
  434. }
  435. }
  436. }
  437. return 1;
  438. }
  439.  
  440. CMD:car(playerid, params[])
  441. {
  442. if (PlayerInfo[playerid][pAdmin] >= 2)
  443. {
  444.  
  445. new
  446. iVehicle,
  447. iColors[2];
  448.  
  449. if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1]))
  450. {
  451. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /veh [Car ID] [Colour 1] [Colour 2]");
  452. }
  453. else if(!(400 <= iVehicle <= 611))
  454. {
  455. SendClientMessage(playerid, COLOR_PURPLE, "No Such Vehicle Model (400 - 611)");
  456. }
  457. else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255))
  458. {
  459. SendClientMessage(playerid, COLOR_PURPLE, "No Such Colour (0 - 255)");
  460. }
  461.  
  462. new
  463. Float: fVehPos[4];
  464.  
  465. GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
  466. GetPlayerFacingAngle(playerid, fVehPos[3]);
  467. CreateVehicle(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
  468. return SendClientMessage(playerid, COLOR_PURPLE, "Your Vehicle Has Spawned!");
  469. }
  470. return 1;
  471. }
  472.  
  473. CMD:cnn(playerid, params[])
  474. {
  475. if(PlayerInfo[playerid][pAdmin] >= 1)
  476. {
  477. if(!isnull(params))
  478. {
  479.  
  480. new
  481. szMessage[128];
  482. new VBName [MAX_PLAYER_NAME];
  483. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  484. format(szMessage, sizeof(szMessage), "~b~%s: ~w~%s",VBName, params);
  485. foreach(Player, i) GameTextForPlayer(i, szMessage, 5000, 6);
  486. }
  487. else SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /cnn [message]. ~n~ = new line, ~r~ = red, ~g~ = green, ~b~ = blue, ~w~ = white, ~y~ = yellow.");
  488. }
  489. else SendClientMessage(playerid, COLOR_PURPLE, "You are not authorized to use that command!");
  490. return 1;
  491. }
  492.  
  493. CMD:report(playerid, params[])
  494. {
  495. if(isnull(params)) return SendClientMessage(playerid, COLOR_DRED, "USAGE: /report [reason]");
  496. new string[120];
  497. new VBName[MAX_PLAYER_NAME];
  498. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  499. format(string, sizeof(string), "%s Has Reported %s", VBName, params);
  500. SendStaffMessage(COLOR_ORANGE, string);
  501. return 1;
  502. }
  503.  
  504. CMD:general(playerid, params[])
  505. {
  506. SendClientMessage(playerid, COLOR_DRED," /report");
  507. return 1;
  508. }
  509.  
  510. CMD:mute(playerid, params[])
  511. {
  512. if(PlayerInfo[playerid][pAdmin] >= 2)
  513. {
  514. new string[128], giveplayerid;
  515. new VBName [MAX_PLAYER_NAME];
  516. new VBName1 [MAX_PLAYER_NAME];
  517. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  518. GetPlayerName(giveplayerid, VBName, MAX_PLAYER_NAME);
  519. if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /mute [playerid]");
  520.  
  521. if(IsPlayerConnected(giveplayerid))
  522. {
  523. if(giveplayerid == playerid)
  524. {
  525. SendClientMessage(playerid, COLOR_PURPLE, "You can not use this command on yourself!");
  526. return 1;
  527. }
  528.  
  529. if(PlayerInfo[giveplayerid][pMuted] == 0)
  530. {
  531. if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
  532. {
  533. format(string, sizeof(string), "%s just tried to /mute you.",VBName);
  534. SendClientMessage(giveplayerid, COLOR_PURPLE, string);
  535. SendClientMessage(playerid, COLOR_PURPLE, "You can't perform this action on an equal or higher level administrator.");
  536. return 1;
  537. }
  538. PlayerInfo[giveplayerid][pMuted] = 1;
  539. format(string, sizeof(string), "[ADMIN] %s was silenced by %s.",VBName1,VBName);
  540. SendStaffMessage(COLOR_PURPLE,string);
  541. }
  542. else
  543. {
  544. PlayerInfo[giveplayerid][pMuted] = 0;
  545. format(string, sizeof(string), "[ADMIN] %s was unsilenced by %s.",VBName1,VBName);
  546. SendStaffMessage(COLOR_PURPLE,string);
  547. }
  548. }
  549. }
  550. else
  551. {
  552. SendClientMessage(playerid, COLOR_DRED, "You are not authorized to use that command!");
  553. }
  554. return 1;
  555. }
  556.  
  557. CMD:hit(playerid, params[])
  558. {
  559. if (PlayerInfo[playerid][pAdmin] >= 2)
  560. {
  561. new string[128], giveplayerid;
  562. new VBName [MAX_PLAYER_NAME];
  563. new VBName1 [MAX_PLAYER_NAME];
  564. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  565. GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
  566. if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /hit [playerid]");
  567.  
  568. new Float:shealth;
  569. new Float:slx, Float:sly, Float:slz;
  570.  
  571. if(IsPlayerConnected(giveplayerid))
  572. {
  573.  
  574. GetPlayerHealth(giveplayerid, shealth);
  575. SetPlayerHealth(giveplayerid, shealth-5);
  576. GetPlayerPos(giveplayerid, slx, sly, slz);
  577. SetPlayerPos(giveplayerid, slx, sly, slz+5);
  578. PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
  579. format(string, sizeof(string), "[ADMIN] %s was slapped by %s",VBName1, VBName);
  580. SendStaffMessage(COLOR_PURPLE,string);
  581.  
  582. }
  583. }
  584. else
  585. {
  586. SendClientMessage(playerid, COLOR_PURPLE, "You are not authorized to use that command!");
  587. }
  588. return 1;
  589. }
  590.  
  591. CMD:ah(playerid, params[])
  592. {
  593. if(PlayerInfo[playerid][pAdmin] >= 1)
  594. {
  595. SendClientMessage(playerid, COLOR_GGREEN,"LEVEL 1 Administrator: /a /kick /ban /freeze /unfreeze /cnn /report");
  596. }
  597. if(PlayerInfo[playerid][pAdmin] >= 2)
  598. {
  599. SendClientMessage(playerid, COLOR_DRED,"LEVEL 2 Administrator: /clearchat /teleports /pos /car /hit");
  600. }
  601. if(PlayerInfo[playerid][pAdmin] >= 3)
  602. {
  603. SendClientMessage(playerid, COLOR_DRED,"LEVEL 3 Administrator: /jetpack /banip /unbanip /givemoney /health /armour ");
  604. }
  605. if(PlayerInfo[playerid][pAdmin] >= 4)
  606. {
  607. SendClientMessage(playerid, COLOR_DRED,"LEVEL 4 Administrator: /makeadmin /giftall");
  608. }
  609. return 1;
  610. }
  611.  
  612. CMD:giftall(playerid, params[])
  613. {
  614. if(PlayerInfo[playerid][pAdmin] >= 4)
  615. {
  616. if(IsPlayerConnected(playerid))
  617. {
  618. if(isnull(params))
  619. {
  620. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /giftall [Confirm]");
  621. SendClientMessage(playerid, COLOR_DRED, "This Will Give Everyone $10,000, +10 Score, Full Health And Armour!");
  622. return 1;
  623. }
  624. if(strcmp(params,"confirm",true) == 0)
  625. {
  626. foreach(Player, i)
  627. {
  628. SetPlayerHealth(i,100);
  629. SetPlayerArmour(i,100);
  630. GivePlayerMoney(i,10000);
  631. SetPlayerScore(i,10);
  632. }
  633. return 1;
  634. }
  635. }
  636. }
  637. return 1;
  638. }
  639.  
  640. CMD:freeze(playerid, params[])
  641. {
  642. if(PlayerInfo[playerid][pAdmin] >= 1)
  643. {
  644. new string[128], VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME], giveplayerid;
  645. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  646. GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
  647. if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /freeze [playerid]");
  648. TogglePlayerControllable(giveplayerid, 0);
  649. format(string, sizeof(string),"Administrator %s Has Frozen %s", VBName, VBName1);
  650. SendStaffMessage(COLOR_DRED, string);
  651. return 1;
  652. }
  653. return 1;
  654. }
  655.  
  656. CMD:unfreeze(playerid, params[])
  657. {
  658. if(PlayerInfo[playerid][pAdmin] >= 1)
  659. {
  660. new string[128], VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME], giveplayerid;
  661. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  662. GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
  663. if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /unfreeze [playerid]");
  664. TogglePlayerControllable(giveplayerid, 1);
  665. format(string, sizeof(string),"Administrator %s Has Unfrozen %s", VBName, VBName1);
  666. SendStaffMessage(COLOR_DRED, string);
  667. return 1;
  668. }
  669. return 1;
  670. }
  671.  
  672. public OnPlayerStateChange(playerid, newstate, oldstate)
  673. {
  674. return 1;
  675. }
  676.  
  677. public OnPlayerEnterCheckpoint(playerid)
  678. {
  679. return 1;
  680. }
  681.  
  682. public OnPlayerLeaveCheckpoint(playerid)
  683. {
  684. return 1;
  685. }
  686.  
  687. public OnPlayerEnterRaceCheckpoint(playerid)
  688. {
  689. return 1;
  690. }
  691.  
  692. public OnPlayerLeaveRaceCheckpoint(playerid)
  693. {
  694. return 1;
  695. }
  696.  
  697. public OnRconCommand(cmd[])
  698. {
  699. return 1;
  700. }
  701.  
  702. public OnPlayerRequestSpawn(playerid)
  703. {
  704. return 1;
  705. }
  706.  
  707. public OnObjectMoved(objectid)
  708. {
  709. return 1;
  710. }
  711.  
  712. public OnPlayerObjectMoved(playerid, objectid)
  713. {
  714. return 1;
  715. }
  716.  
  717. public OnPlayerPickUpPickup(playerid, pickupid)
  718. {
  719. return 1;
  720. }
  721.  
  722. public OnVehicleMod(playerid, vehicleid, componentid)
  723. {
  724. return 1;
  725. }
  726.  
  727. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  728. {
  729. return 1;
  730. }
  731.  
  732. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  733. {
  734. return 1;
  735. }
  736.  
  737. public OnPlayerSelectedMenuRow(playerid, row)
  738. {
  739. return 1;
  740. }
  741.  
  742. public OnPlayerExitedMenu(playerid)
  743. {
  744. return 1;
  745. }
  746.  
  747. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  748. {
  749. return 1;
  750. }
  751.  
  752. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  753. {
  754. return 1;
  755. }
  756.  
  757. public OnRconLoginAttempt(ip[], password[], success)
  758. {
  759. return 1;
  760. }
  761.  
  762. public OnPlayerUpdate(playerid)
  763. {
  764. return 1;
  765. }
  766.  
  767. public OnPlayerStreamIn(playerid, forplayerid)
  768. {
  769. return 1;
  770. }
  771.  
  772. public OnPlayerStreamOut(playerid, forplayerid)
  773. {
  774. return 1;
  775. }
  776.  
  777. public OnVehicleStreamIn(vehicleid, forplayerid)
  778. {
  779. return 1;
  780. }
  781.  
  782. public OnVehicleStreamOut(vehicleid, forplayerid)
  783. {
  784. return 1;
  785. }
  786.  
  787. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  788. {
  789. switch( dialogid )
  790. {
  791. case DIALOG_REGISTER:
  792. {
  793. if (!response) return Kick(playerid);
  794. if(response)
  795. {
  796. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COLOR_WHITE"Register Below",""COLOR_RED"Wrong Password!\n"COLOR_WHITE"Enter Password To Play!","Register","Quit");
  797. new INI:File = INI_Open(UserPath(playerid));
  798. INI_SetTag(File,"data");
  799. INI_WriteInt(File,"Password",udb_hash(inputtext));
  800. INI_WriteInt(File,"Cash",0);
  801. INI_WriteInt(File,"Admin",0);
  802. INI_WriteInt(File,"Kills",0);
  803. INI_WriteInt(File,"Deaths",0);
  804. INI_Close(File);
  805.  
  806. ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COLOR_WHITE"Success!",""COLOR_GREEN"Your Account Is Now In Our Database! Thanks For Registering","Ok","");
  807. }
  808. }
  809.  
  810. case DIALOG_LOGIN:
  811. {
  812. if ( !response ) return Kick ( playerid );
  813. if( response )
  814. {
  815. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  816. {
  817. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  818. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  819. ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COLOR_WHITE"Success!",""COLOR_GREEN"You have successfully logged in!","Ok","");
  820. }
  821. else
  822. {
  823. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_RED"You have entered an incorrect password.\n"COLOR_WHITE"Type your password below to login.","Login","Quit");
  824. }
  825. return 1;
  826. }
  827. }
  828. }
  829. if(dialogid == teleports)
  830. {
  831. if(listitem == 0)
  832. {
  833. SetPlayerPos(playerid, 1485.9170,-1730.4979,13.0973);
  834. SendClientMessage(playerid, COLOR_PURPLE,"You've Teleported To Los Santos");
  835. return 1;
  836. }
  837. if(listitem == 1)
  838. {
  839. SetPlayerPos(playerid, -1417.0,-295.8,14.1);
  840. SendClientMessage(playerid, COLOR_PURPLE,"You've Teleported To San Fierro");
  841. return 1;
  842. }
  843. if(listitem == 2)
  844. {
  845. SetPlayerPos(playerid, 1699.2,1435.1, 10.7);
  846. SendClientMessage(playerid, COLOR_PURPLE,"You've Teleported To Las Venturas");
  847. return 1;
  848. }
  849. }
  850. return 1;
  851. }
Advertisement
Add Comment
Please, Sign In to add comment