Advertisement
Guest User

Untitled

a guest
Aug 1st, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.49 KB | None | 0 0
  1. /*
  2. Login / Register system by Zh3r0, using ZCMD + SSCANF + Y_INI
  3. Y_INI is the fastet writing system ever.
  4. ZCMD is the fastet command proccessor.
  5. SSCANF is the most usefull function ever made.
  6.  
  7.  
  8. [ Credits ]
  9. Y_Less - Y_Ini, SSCANF
  10. Zeex - ZCMD
  11. Dracoblue - Set, strreplace, pName, Encode, INI_Exist
  12. Zh3r0 - Building up this system using the above functions...
  13.  
  14.  
  15. !!!
  16. INI_Exist Function is not from Y_Ini, i transformed it from DINI to this.
  17. Remove the credits, and you are a complete moron. Do it! You will be a moron!
  18. !!!
  19.  
  20. Changelog:
  21.  
  22. v1.2 - Added VIP System 3 levels;
  23. Level 1: /vipgod
  24. Level 2: /vipgod /vipcargod
  25. Level 3: /vipgod /vipcargod /vnrg /vinf
  26.  
  27. v1.1 - Added Admin system.
  28. v1.0 - Initial release
  29. */
  30.  
  31.  
  32.  
  33. //
  34. #include < a_samp >
  35. #include < ZCMD >
  36. #include < sscanf >
  37. #include <YSI/y_ini>
  38.  
  39.  
  40. //0.3c Colors
  41. #define COL_RED "{F81414}"
  42. #define COL_LIGHTBLUE "{00C0FF}"
  43. #define COL_LRED "{FFA1A1}"
  44. #define COL_GREEN "{6EF83C}"
  45. #define COL_GREY "{C3C3C3}"
  46.  
  47.  
  48. //Dialogs
  49. #define DIALOG_REG 1995
  50. #define DIALOG_REG_REQ 1996
  51. #define DIALOG_LOGIN 1997
  52. #define DIALOG_LOGIN2 1998
  53. #define DIALOG_LOG_DONE 1999
  54. #define DIALOG_LOG 2000
  55. #define DIALOG_STATS 2001
  56. #define INFO_BOX 2002
  57.  
  58.  
  59. //You can edit the admin ranks as you wish!
  60. #define Level0 "Member"
  61. #define Level1 "Moderator"
  62. #define Level2 "Administrator"
  63. #define Level3 "Owner"
  64.  
  65. new God[ MAX_PLAYERS ], CGod[ MAX_PLAYERS ], pNrg500[ MAX_PLAYERS ], pInfernus[ MAX_PLAYERS ];
  66. public OnFilterScriptInit( ) return 1;
  67. public OnFilterScriptExit( ) return 1;
  68.  
  69.  
  70. forward ParsePlayerPass( playerid, name[ ], value[ ] );
  71. public ParsePlayerPass( playerid, name[ ], value[ ] )
  72. {
  73. if ( !strcmp( name, "PASSWORD" ) )
  74. {
  75. SetPVarString( playerid, "pPass", value );
  76. }
  77. }
  78.  
  79. forward LoadUser( playerid, name[ ], value[ ] );
  80. public LoadUser( playerid, name[ ], value[ ] )
  81. {
  82. if ( !strcmp(name, "REG_DATE" ) ) SetPVarString( playerid, "Date", value );
  83. if ( !strcmp(name, "MONEYS" ) ) SetPVarInt( playerid, "Moneys", strval( value ) );
  84. if ( !strcmp(name, "SCORE" ) ) SetPVarInt( playerid, "Score", strval( value ) );
  85. if ( !strcmp(name, "COINS" ) ) SetPVarInt( playerid, "Coins", strval( value ) );
  86. if ( !strcmp(name, "LEVEL" ) ) SetPVarInt( playerid, "Level", strval( value ) );
  87. if ( !strcmp(name, "VIP_LEVEL" ) ) SetPVarInt( playerid, "VIP Level", strval( value ) );
  88. if ( !strcmp(name, "MY_WEATHER" ) ) SetPVarInt( playerid, "Weather", strval( value ) );
  89. if ( !strcmp(name, "MY_TIME" ) ) SetPVarInt( playerid, "Time", strval( value ) );
  90. if ( !strcmp(name, "MY_SKIN" ) ) SetPVarInt( playerid, "Skin", strval( value ) );
  91. if ( !strcmp(name, "LAST_ON" ) ) SetPVarString( playerid, "On", value );
  92. if ( !strcmp(name, "KILLS" ) ) SetPVarInt( playerid, "Kills", strval( value ) );
  93. if ( !strcmp(name, "DEATHS" ) ) SetPVarInt( playerid, "Deaths", strval( value ) );
  94. if ( !strcmp(name, "MUTED" ) ) SetPVarInt( playerid, "Muted", strval( value ) );
  95. if ( !strcmp(name, "GOD" ) ) SetPVarInt( playerid, "God", strval( value ) );
  96. if ( !strcmp(name, "CAR_GOD" ) ) SetPVarInt( playerid, "CGod", strval( value ) );
  97. }
  98.  
  99. CMD:register( playerid, params[ ] )
  100. {
  101. #pragma unused params
  102. if ( GetPVarInt( playerid, "Logged" ) == 1 )
  103. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} You are already registered and logged in.");
  104.  
  105. ShowPlayerDialog( playerid, DIALOG_REG, DIALOG_STYLE_INPUT, "{FFFFFF}Registering...", "{FFFFFF}Please write your desired password.", ">>>", "Exit");
  106. return 1;
  107. }
  108. CMD:login( playerid, params[ ] )
  109. {
  110. #pragma unused params
  111. if ( GetPVarInt( playerid, "Logged" ) == 1 )
  112. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} You are already registered and logged in.");
  113.  
  114. ShowPlayerDialog( playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "{FFFFFF}Login", "{FFFFFF}Please write your current password", "Login", "Kick");
  115. return 1;
  116. }
  117. CMD:vnrg(playerid, params[])
  118. {
  119. if ( GetPVarInt( playerid, "VIP Level" ) < 3 )
  120. return SendClientMessage( playerid, -1, "You must be an VIP Level 3 to use this command");
  121.  
  122. if( pNrg500[playerid] > 0 )
  123. {
  124. if(GetPlayerVehicleID(playerid) != pNrg500[playerid] ) { CallNRG(playerid); }
  125. else{ SendClientMessage( playerid, -1,"You are already sitting on your personal ~b~~h~NRG-500~w~!"); }
  126. }else{ CreateNRG(playerid); }
  127. return 1;
  128. }
  129.  
  130. CMD:vinf(playerid, params[])
  131. {
  132. if ( GetPVarInt( playerid, "VIP Level" ) < 3 )
  133. return SendClientMessage( playerid, -1, "You must be an VIP Level 3 to use this command");
  134.  
  135. if( pInfernus[playerid] > 0 )
  136. {
  137. if ( GetPlayerVehicleID(playerid) != pInfernus [playerid] ) { CallInfernus(playerid); }
  138. else { SendClientMessage( playerid, -1, "You are already sitting on your personal ~b~~h~Infernus~w~!"); }
  139. }else{ CreateInfernus(playerid); }
  140. return 1;
  141. }
  142. CMD:ban( playerid, params[ ] )
  143. {
  144. if ( GetPVarInt( playerid, "Level" ) < 3 )
  145. return SendClientMessage( playerid, -1, "You must be the "COL_LIGHTBLUE""Level3"{FFFFFF} to ban someone.");
  146.  
  147. if ( sscanf( params, "uS", params[ 0 ], params[ 1 ] ) )
  148. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /kick <id> [reason]");
  149.  
  150. if ( !IsPlayerConnected( params[ 0 ] ) )
  151. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  152.  
  153.  
  154. new String[ 256 ];
  155.  
  156. format( String, sizeof String, ""COL_LIGHTBLUE"%s"COL_GREY"( %s | ID: %i){FFFFFF} banned player "COL_LIGHTBLUE"%s"COL_GREY"( %s | ID: %i ) "COL_LIGHTBLUE"Reason: "COL_GREY"%s",
  157. pName( playerid ),
  158. GetPlayerLevelName( playerid ),
  159. playerid,
  160. pName( params[ 0 ] ),
  161. GetPlayerLevelName( params[ 0 ] ),
  162. params[ 0 ],
  163. params[ 1 ]);
  164.  
  165. SendClientMessageToAll( -1, String );
  166. Ban( params[ 0 ] );
  167. return 1;
  168. }
  169. CMD:kick( playerid, params[ ] )
  170. {
  171. if ( GetPVarInt( playerid, "Level" ) < 2 )
  172. return SendClientMessage( playerid, -1, "You must be an admin level "COL_LIGHTBLUE"2{FFFFFF} or above.");
  173.  
  174. if ( sscanf( params, "uS", params[ 0 ], params[ 1 ] ) )
  175. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /kick <id> [reason]");
  176.  
  177. if ( !IsPlayerConnected( params[ 0 ] ) )
  178. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  179.  
  180.  
  181. new String[ 256 ];
  182.  
  183. format( String, sizeof String, ""COL_LIGHTBLUE"%s"COL_GREY"( %s | ID: %i){FFFFFF} kicked player "COL_LIGHTBLUE"%s"COL_GREY"( %s | ID: %i ) "COL_LIGHTBLUE"Reason: "COL_GREY"%s",
  184. pName( playerid ),
  185. GetPlayerLevelName( playerid ),
  186. playerid,
  187. pName( params[ 0 ] ),
  188. GetPlayerLevelName( params[ 0 ] ),
  189. params[ 0 ],
  190. params[ 1 ]);
  191.  
  192. SendClientMessageToAll( -1, String );
  193. Kick( params[ 0 ] );
  194. return 1;
  195. }
  196. CMD:myskin( playerid, params[ ] )
  197. {
  198. if ( GetPVarInt( playerid, "Logged" ) == 0 )
  199. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Please "COL_LIGHTBLUE"/login{FFFFFF} to change your skin.");
  200.  
  201. if ( sscanf( params, "d", params[ 0 ] ) )
  202. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /myskin <skin>");
  203.  
  204. if ( !IsValidSkin( params[ 0 ] ) )
  205. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Invalid skin ID.");
  206.  
  207. SetPVarInt( playerid, "Skin", params[ 0 ] );
  208. SetPlayerSkin( playerid, params[ 0 ] );
  209.  
  210. new String[ 129 ];
  211. format( String, sizeof String, "{FFFFFF}You set your time to "COL_LIGHTBLUE"%d{FFFFFF} and it has been saved into your account succesfully!", params[ 0 ] );
  212. SendClientMessage( playerid, -1, String );
  213.  
  214. new PlayerFile[ 13 + MAX_PLAYER_NAME ];
  215.  
  216. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  217. new
  218. INI:PlayerAcc = INI_Open( PlayerFile );
  219. INI_WriteString( PlayerAcc, "MY_SKIN", params[ 0 ]);
  220. INI_Close( PlayerAcc );
  221. return 1;
  222. }
  223. CMD:mytime( playerid, params[ ] )
  224. {
  225. if ( GetPVarInt( playerid, "Logged" ) == 0 )
  226. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Please "COL_LIGHTBLUE"/login{FFFFFF} to change your time.");
  227.  
  228. if ( sscanf( params, "d", params[ 0 ] ) )
  229. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /mytime <hour>");
  230.  
  231. if ( params[ 0 ] < 0 || params[ 0 ] > 24 )
  232. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} You must have forgot the time or what? Loo at your clock, time is from 1 to 24...");
  233. SetPVarInt( playerid, "Time", params[ 0 ] );
  234. SetPlayerTime( playerid, params[ 0 ], 0 );
  235.  
  236. new String[ 129 ];
  237. format( String, sizeof String, "{FFFFFF}You set your time to "COL_LIGHTBLUE"%d{FFFFFF} and it has been saved into your account succesfully!", params[ 0 ] );
  238. SendClientMessage( playerid, -1, String );
  239.  
  240. new PlayerFile[ 13 + MAX_PLAYER_NAME ];
  241.  
  242. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  243. new
  244. INI:PlayerAcc = INI_Open( PlayerFile );
  245. INI_WriteString( PlayerAcc, "MY_TIME", params[ 0 ]);
  246. INI_Close( PlayerAcc );
  247. return 1;
  248. }
  249. CMD:myweather( playerid, params[ ] )
  250. {
  251. if ( GetPVarInt( playerid, "Logged" ) == 0 )
  252. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Please "COL_LIGHTBLUE"/login{FFFFFF} to set your weather.");
  253.  
  254. if ( sscanf( params, "d", params[ 0 ] ) )
  255. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /myweather <weather>");
  256.  
  257. SetPVarInt( playerid, "Weather", params[ 0 ] );
  258. SetPlayerWeather( playerid, params[ 0 ] );
  259.  
  260. new String[ 129 ];
  261. format( String, sizeof String, "{FFFFFF}You set your weather to id "COL_LIGHTBLUE"%d{FFFFFF} and it has been saved into your account succesfully!", params[ 0 ] );
  262. SendClientMessage( playerid, -1, String );
  263.  
  264. new PlayerFile[ 13 + MAX_PLAYER_NAME ];
  265.  
  266. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  267. new
  268. INI:PlayerAcc = INI_Open( PlayerFile );
  269. INI_WriteString( PlayerAcc, "MY_WEATHER", params[ 0 ]);
  270. INI_Close( PlayerAcc );
  271. return 1;
  272. }
  273. CMD:changepass( playerid, params[ ] )
  274. {
  275. if ( !INI_Exist( pName( playerid ) ) )
  276. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} You must be registered to change your pass.Use "COL_LIGHTBLUE"/register{FFFFFF}.");
  277.  
  278. if ( GetPVarInt( playerid, "Logged" ) == 0 )
  279. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Please "COL_LIGHTBLUE"/login{FFFFFF} to change your password.");
  280.  
  281. new NewPass[ 21 ], OldPass[ 21 ];
  282. if ( sscanf( params, "ss", OldPass, NewPass ) )
  283. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /changepass [OLD] [NEW]");
  284.  
  285. new PlayerFile[ 13 + MAX_PLAYER_NAME ];
  286.  
  287. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  288. INI_ParseFile( PlayerFile, "ParsePlayerPass", false, true, playerid );
  289.  
  290. new Password[ 20 ],
  291. String[ 129 ]
  292. ;
  293. GetPVarString( playerid, "pPass", Password, 20 );
  294.  
  295. if ( strcmp( Password, OldPass, false ) != 0 )
  296. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Old password didn't match the one you inserted!");
  297.  
  298. if ( strlen( NewPass ) < 3 || strlen( NewPass ) > 20 )
  299. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} New password may contain Min. 3 Char. and Max. 20 Char.");
  300.  
  301. format( String, sizeof String, "You have changed your password to \""COL_LIGHTBLUE"%s{FFFFFF}\" ", NewPass );
  302. SendClientMessage( playerid, -1, String );
  303.  
  304. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  305. new
  306. INI:PlayerAcc = INI_Open( PlayerFile );
  307. INI_WriteString( PlayerAcc, "OLD_PASSWORD", OldPass);
  308. INI_WriteString( PlayerAcc, "PASSWORD", NewPass);
  309. INI_Close( PlayerAcc );
  310. return 1;
  311. }
  312. CMD:mycmds( playerid, params[ ] )
  313. {
  314. new LongString[ 1024 ];
  315. new Str1[ ] = ""COL_LIGHTBLUE"Available commands you can use{FFFFFF}\n\n\n\
  316. Use "COL_LIGHTBLUE"/myweather{FFFFFF} to set and save your favorite weather.\n\
  317. Use "COL_LIGHTBLUE"/mytime{FFFFFF} to set your time and save it.\n\
  318. Use "COL_LIGHTBLUE"/myskin{FFFFFF} to set your skin and save it, and use it on next login.\n\
  319. If you are a VIP Member use "COL_LIGHTBLUE"/viphelp{FFFFFF} to see available commands for VIP Members.\n";
  320.  
  321. new Str2[ ] = "Use "COL_LIGHTBLUE"/stats{FFFFFF} to view your stats, deats, kills etc!\n\
  322. Use "COL_LIGHTBLUE"/changepass{FFFFFF} to change your accounts's password.";
  323. format( LongString, 1024, "%s%s", Str1, Str2 );
  324. ShowPlayerDialog( playerid, INFO_BOX, DIALOG_STYLE_MSGBOX, "{FFFFFF}My commands", LongString, "Oke", "");
  325. return 1;
  326. }
  327. stock GetPlayerLevelName( playerid )
  328. {
  329. new Llevel[ 14 ];
  330. if ( GetPVarInt( playerid, "Level" ) == 0 ) Llevel = Level0;
  331. if ( GetPVarInt( playerid, "Level" ) == 1 ) Llevel = Level1;
  332. if ( GetPVarInt( playerid, "Level" ) == 2 ) Llevel = Level2;
  333. if ( GetPVarInt( playerid, "Level" ) == 3 ) Llevel = Level3;
  334. return Llevel;
  335. }
  336.  
  337.  
  338. CMD:setlevel( playerid, params[ ] )
  339. {
  340. if ( GetPVarInt( playerid, "Level" ) < 3 && !IsPlayerAdmin( playerid ) )
  341. return SendClientMessage( playerid, -1, "You are not allowed to use this command");
  342.  
  343. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ) )
  344. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /setlevel <id/name> <level> "),SendClientMessage( playerid, -1, "-Check "COL_LIGHTBLUE"/levelranks{FFFFFF} to view each level's name");
  345.  
  346. if ( !IsPlayerConnected( params[ 0 ] ) )
  347. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  348.  
  349. if ( params[ 1 ] < 0 || params[ 1 ] > 3 )
  350. return SendClientMessage( playerid, -1, "You must insert from level "COL_LIGHTBLUE"0{FFFFFF} to "COL_LIGHTBLUE"3{FFFFFF}");
  351.  
  352. if ( GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  353. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  354.  
  355.  
  356. SetPVarInt( params[ 0 ], "Level", params[ 1 ] );
  357. new String[ 256 ];
  358. if ( playerid == params[ 0 ] )
  359. {
  360. format( String, sizeof String, "You made yourself an admin level "COL_LIGHTBLUE"%d{FFFFFF}["COL_LIGHTBLUE"%s{FFFFFF}]", params[ 1 ], GetPlayerLevelName( playerid ) );
  361. SendClientMessage( playerid, -1, String );
  362. }
  363. else
  364. {
  365. format( String, sizeof String, "You made "COL_LIGHTBLUE"%s{FFFFFF} an "COL_LIGHTBLUE"%s{FFFFFF} level "COL_LIGHTBLUE"%d",pName( params[ 0 ] ), GetPlayerLevelName( playerid ), params[ 1 ] );
  366. SendClientMessage( playerid, -1, String );
  367. format( String, sizeof String, "%s( %s ) made you an %s",pName( playerid ), GetPlayerLevelName( playerid ),GetPlayerLevelName( params[ 0 ] ) );
  368. SendClientMessage( params[ 0 ], -1, String );
  369. }
  370. return 1;
  371. }
  372. CMD:setvip( playerid, params[ ] )
  373. {
  374. if ( GetPVarInt( playerid, "Level" ) < 3 )
  375. return SendClientMessage( playerid, -1, "You are not allowed to use this command!");
  376.  
  377. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ) )
  378. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /setvip <id/name> <level> ");
  379.  
  380. if ( !IsPlayerConnected( params[ 0 ] ) )
  381. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  382.  
  383. if ( params[ 1 ] < 0 || params[ 1 ] > 3 )
  384. return SendClientMessage( playerid, -1, "You must insert from level "COL_LIGHTBLUE"0{FFFFFF} to "COL_LIGHTBLUE"3{FFFFFF}");
  385.  
  386. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  387. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  388.  
  389.  
  390. SetPVarInt( params[ 0 ], "VIP Level", params[ 1 ] );
  391. new String[ 256 ];
  392. if ( playerid == params[ 0 ] )
  393. {
  394. format( String, sizeof String, "You made yourself a VIP level "COL_LIGHTBLUE"%d", params[ 1 ]);
  395. SendClientMessage( playerid, -1, String );
  396. }
  397. else
  398. {
  399. format( String, sizeof String, "You made "COL_LIGHTBLUE"%s{FFFFFF} a VIP level %d", pName( params[ 0 ] ),params[ 1 ] );
  400. SendClientMessage( playerid, -1, String );
  401. format( String, sizeof String, "%s( %s ) made you a VIP Level %d",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
  402. SendClientMessage( params[ 0 ], -1, String );
  403. }
  404. return 1;
  405. }
  406. CMD:setmoney( playerid,params[])
  407. {
  408. if ( GetPVarInt( playerid, "Level" ) < 1 )
  409. return SendClientMessage( playerid, -1, "You must be an "#Level1" to use this command");
  410.  
  411. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ) )
  412. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /setmoney <id/name> <money> ");
  413.  
  414. if ( !IsPlayerConnected( params[ 0 ] ) )
  415. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  416.  
  417. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  418. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  419.  
  420. ResetPlayerMoney( params[ 0 ] );
  421. GivePlayerMoney( params[ 0 ], params[ 1 ] );
  422.  
  423. new String[ 245 ];
  424. format( String, sizeof String, "You gave "COL_LIGHTBLUE"%s{FFFFFF} "COL_GREEN"$%d{FFFFFF} moneys.", pName( params[ 0 ] ),params[ 1 ] );
  425. SendClientMessage( playerid, -1, String );
  426. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} set your cash to "COL_GREEN"$%d",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
  427. SendClientMessage( params[ 0 ], -1, String );
  428. return 1;
  429. }
  430. CMD:settime( playerid,params[])
  431. {
  432. if ( GetPVarInt( playerid, "Level" ) < 1 )
  433. return SendClientMessage( playerid, -1, "You must be an "#Level1" to use this command");
  434.  
  435. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ) || params[ 1 ] < 1 || params[ 1 ] > 24 )
  436. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /settime <id/name> <hour> ");
  437.  
  438. if ( !IsPlayerConnected( params[ 0 ] ) )
  439. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  440.  
  441. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  442. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  443.  
  444. SetPlayerTime( params[ 0 ], params[ 1 ], 0 );
  445.  
  446. new String[ 245 ];
  447. format( String, sizeof String, "You set "COL_LIGHTBLUE"%s's{FFFFFF} time to "COL_LIGHTBLUE"%d:00", pName( params[ 0 ] ),params[ 1 ] );
  448. SendClientMessage( playerid, -1, String );
  449. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} set your time to "COL_LIGHTBLUE"%d:00",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
  450. SendClientMessage( params[ 0 ], -1, String );
  451. return 1;
  452. }
  453. CMD:setscore( playerid,params[])
  454. {
  455. if ( GetPVarInt( playerid, "Level" ) < 1 )
  456. return SendClientMessage( playerid, -1, "You must be an "#Level1" to use this command");
  457.  
  458. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ))
  459. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /setscore <id/name> <score> ");
  460.  
  461. if ( !IsPlayerConnected( params[ 0 ] ) )
  462. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  463.  
  464. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  465. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  466.  
  467. SetPlayerScore( playerid, params[ 1 ] );
  468.  
  469. new String[ 245 ];
  470. format( String, sizeof String, "You set "COL_LIGHTBLUE"%s's{FFFFFF} score to "COL_LIGHTBLUE"%d", pName( params[ 0 ] ),params[ 1 ] );
  471. SendClientMessage( playerid, -1, String );
  472. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} set your score to "COL_LIGHTBLUE"%d",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
  473. SendClientMessage( params[ 0 ], -1, String );
  474. return 1;
  475. }
  476. CMD:setcoins( playerid,params[])
  477. {
  478. if ( GetPVarInt( playerid, "Level" ) < 1 )
  479. return SendClientMessage( playerid, -1, "You must be an "#Level1" to use this command");
  480.  
  481. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ))
  482. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /setcoins <id/name> <coins> ");
  483.  
  484. if ( !IsPlayerConnected( params[ 0 ] ) )
  485. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  486.  
  487. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  488. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  489.  
  490. SetPlayerCoins( playerid, params[ 1 ] );
  491.  
  492. new String[ 245 ];
  493. format( String, sizeof String, "You set "COL_LIGHTBLUE"%s's{FFFFFF} coins to "COL_LIGHTBLUE"%d", pName( params[ 0 ] ),params[ 1 ] );
  494. SendClientMessage( playerid, -1, String );
  495. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} set your coins to "COL_LIGHTBLUE"%d",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
  496. SendClientMessage( params[ 0 ], -1, String );
  497. return 1;
  498. }
  499. CMD:setweather( playerid,params[])
  500. {
  501. if ( GetPVarInt( playerid, "Level" ) < 1 )
  502. return SendClientMessage( playerid, -1, "You must be an "#Level1" to use this command");
  503.  
  504. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ) )
  505. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /setweather <id/name> <weather> ");
  506.  
  507. if ( !IsPlayerConnected( params[ 0 ] ) )
  508. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  509.  
  510. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  511. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  512.  
  513. SetPlayerWeather( params[ 0 ], params[ 1 ]);
  514.  
  515. new String[ 245 ];
  516. format( String, sizeof String, "You set "COL_LIGHTBLUE"%s's{FFFFFF} weather to "COL_LIGHTBLUE"%d", pName( params[ 0 ] ),params[ 1 ] );
  517. SendClientMessage( playerid, -1, String );
  518. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} set your weather to "COL_LIGHTBLUE"%d",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
  519. SendClientMessage( params[ 0 ], -1, String );
  520. return 1;
  521. }
  522. CMD:sethealth( playerid,params[])
  523. {
  524. if ( GetPVarInt( playerid, "Level" ) < 1 )
  525. return SendClientMessage( playerid, -1, "You must be an "#Level1" to use this command");
  526.  
  527. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ) )
  528. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /sethealth <id/name> <health> ");
  529.  
  530. if ( !IsPlayerConnected( params[ 0 ] ) )
  531. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  532.  
  533. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  534. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  535.  
  536. SetPlayerHealth( params[ 0 ], params[ 1 ]);
  537.  
  538. new String[ 245 ];
  539. format( String, sizeof String, "You set "COL_LIGHTBLUE"%s's{FFFFFF} health to "COL_LIGHTBLUE"%d", pName( params[ 0 ] ),params[ 1 ] );
  540. SendClientMessage( playerid, -1, String );
  541. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} set your health to "COL_LIGHTBLUE"%d",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
  542. SendClientMessage( params[ 0 ], -1, String );
  543. return 1;
  544. }
  545. CMD:setarmour( playerid,params[])
  546. {
  547. if ( GetPVarInt( playerid, "Level" ) < 1 )
  548. return SendClientMessage( playerid, -1, "You must be an "#Level1" to use this command");
  549.  
  550. if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ) )
  551. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /setarmour <id/name> <armour> ");
  552.  
  553. if ( !IsPlayerConnected( params[ 0 ] ) )
  554. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  555.  
  556. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  557. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  558.  
  559. SetPlayerArmour( params[ 0 ], params[ 1 ]);
  560.  
  561. new String[ 245 ];
  562. format( String, sizeof String, "You set "COL_LIGHTBLUE"%s's{FFFFFF} armour to "COL_LIGHTBLUE"%d", pName( params[ 0 ] ), params[ 1 ] );
  563. SendClientMessage( playerid, -1, String );
  564. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} set your armour to "COL_LIGHTBLUE"%d",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
  565. SendClientMessage( params[ 0 ], -1, String );
  566. return 1;
  567. }
  568. CMD:heal( playerid,params[])
  569. {
  570. if ( GetPVarInt( playerid, "Level" ) < 1 )
  571. return SendClientMessage( playerid, -1, "You must be an "#Level1" to use this command");
  572.  
  573. if ( sscanf( params, "u", params[ 0 ], params[ 1 ] ) )
  574. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /heal <id/name>");
  575.  
  576. if ( !IsPlayerConnected( params[ 0 ] ) )
  577. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  578.  
  579. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  580. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  581.  
  582. SetPlayerHealth( params[ 0 ], 100.0);
  583.  
  584. new String[ 245 ];
  585. format( String, sizeof String, "You healed "COL_LIGHTBLUE"%s", pName( params[ 0 ] ));
  586. SendClientMessage( playerid, -1, String );
  587. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} healed you.",pName( playerid ), GetPlayerLevelName( playerid ));
  588. SendClientMessage( params[ 0 ], -1, String );
  589. return 1;
  590. }
  591. CMD:akill( playerid,params[])
  592. {
  593. if ( GetPVarInt( playerid, "Level" ) < 2 )
  594. return SendClientMessage( playerid, -1, "You must be an "#Level2" to use this command");
  595.  
  596. if ( sscanf( params, "u", params[ 0 ], params[ 1 ] ) )
  597. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /akill <id/name>");
  598.  
  599. if ( !IsPlayerConnected( params[ 0 ] ) )
  600. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  601.  
  602. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  603. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  604.  
  605. SetPlayerHealth( params[ 0 ], 0.0);
  606.  
  607. new String[ 245 ];
  608. format( String, sizeof String, "You killed "COL_LIGHTBLUE"%s", pName( params[ 0 ] ));
  609. SendClientMessage( playerid, -1, String );
  610. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} killed you.",pName( playerid ), GetPlayerLevelName( playerid ));
  611. SendClientMessage( params[ 0 ], -1, String );
  612. return 1;
  613. }
  614. CMD:mute( playerid,params[])
  615. {
  616. if ( GetPVarInt( playerid, "Level" ) < 2 )
  617. return SendClientMessage( playerid, -1, "You must be an "#Level2" to use this command");
  618.  
  619. if ( sscanf( params, "u", params[ 0 ], params[ 1 ] ) )
  620. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /mute <id/name>");
  621.  
  622. if ( GetPVarInt( playerid, "Muted" ) == 1 )
  623. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Player is already muted.");
  624.  
  625. if ( !IsPlayerConnected( params[ 0 ] ) )
  626. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  627.  
  628. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  629. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  630.  
  631. SetPVarInt( params[ 0 ], "Muted", 1 );
  632.  
  633. new String[ 245 ];
  634. format( String, sizeof String, "You muted "COL_LIGHTBLUE"%s", pName( params[ 0 ] ));
  635. SendClientMessage( playerid, -1, String );
  636. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} muted you.",pName( playerid ), GetPlayerLevelName( playerid ));
  637. SendClientMessage( params[ 0 ], -1, String );
  638. return 1;
  639. }
  640. CMD:unmute( playerid,params[])
  641. {
  642. if ( GetPVarInt( playerid, "Level" ) < 2 )
  643. return SendClientMessage( playerid, -1, "You must be an "#Level2" to use this command");
  644.  
  645. if ( sscanf( params, "u", params[ 0 ], params[ 1 ] ) )
  646. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /mute <id/name>");
  647.  
  648. if ( GetPVarInt( playerid, "Muted" ) == 0 )
  649. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Player is already un-muted.");
  650.  
  651. if ( !IsPlayerConnected( params[ 0 ] ) )
  652. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  653.  
  654. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  655. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  656.  
  657. SetPVarInt( params[ 0 ], "Muted", 0 );
  658.  
  659. new String[ 245 ];
  660. format( String, sizeof String, "You unmuted "COL_LIGHTBLUE"%s", pName( params[ 0 ] ));
  661. SendClientMessage( playerid, -1, String );
  662. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} unmuted you.",pName( playerid ), GetPlayerLevelName( playerid ));
  663. SendClientMessage( params[ 0 ], -1, String );
  664. return 1;
  665. }
  666. CMD:freeze( playerid,params[])
  667. {
  668. if ( GetPVarInt( playerid, "Level" ) < 2 )
  669. return SendClientMessage( playerid, -1, "You must be an "#Level2" to use this command");
  670.  
  671. if ( sscanf( params, "u", params[ 0 ], params[ 1 ] ) )
  672. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /freeze <id/name>");
  673.  
  674. if ( GetPVarInt( playerid, "Freeze" ) == 1 )
  675. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Player is already frozen.");
  676.  
  677. if ( !IsPlayerConnected( params[ 0 ] ) )
  678. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  679.  
  680. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  681. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  682.  
  683. SetPVarInt( params[ 0 ], "Freeze", 1 );
  684. TogglePlayerControllable( playerid, false );
  685.  
  686. new String[ 245 ];
  687. format( String, sizeof String, "You frozen "COL_LIGHTBLUE"%s", pName( params[ 0 ] ));
  688. SendClientMessage( playerid, -1, String );
  689. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} frozen you.",pName( playerid ), GetPlayerLevelName( playerid ));
  690. SendClientMessage( params[ 0 ], -1, String );
  691. return 1;
  692. }
  693. CMD:unfreeze( playerid,params[])
  694. {
  695. if ( GetPVarInt( playerid, "Level" ) < 2 )
  696. return SendClientMessage( playerid, -1, "You must be an "#Level2" to use this command");
  697.  
  698. if ( sscanf( params, "u", params[ 0 ], params[ 1 ] ) )
  699. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /freeze <id/name>");
  700.  
  701. if ( GetPVarInt( playerid, "Freeze" ) == 0 )
  702. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Player is already unfrozen.");
  703.  
  704. if ( !IsPlayerConnected( params[ 0 ] ) )
  705. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  706.  
  707. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  708. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  709.  
  710. SetPVarInt( params[ 0 ], "Freeze", 0 );
  711. TogglePlayerControllable( playerid, true );
  712.  
  713. new String[ 245 ];
  714. format( String, sizeof String, "You unfrozen "COL_LIGHTBLUE"%s", pName( params[ 0 ] ));
  715. SendClientMessage( playerid, -1, String );
  716. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} unfrozen you.",pName( playerid ), GetPlayerLevelName( playerid ));
  717. SendClientMessage( params[ 0 ], -1, String );
  718. return 1;
  719. }
  720. CMD:spawn( playerid,params[])
  721. {
  722. if ( GetPVarInt( playerid, "Level" ) < 2 )
  723. return SendClientMessage( playerid, -1, "You must be an "#Level2" to use this command");
  724.  
  725. if ( sscanf( params, "u", params[ 0 ], params[ 1 ] ) )
  726. return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /spawn <id/name>");
  727.  
  728. if ( !IsPlayerConnected( params[ 0 ] ) )
  729. return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected");
  730.  
  731. if (GetPVarInt( playerid, "Level" ) < GetPVarInt( params[ 0 ], "Level" ) )
  732. return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "REASON: Player is higher in grade than you.");
  733.  
  734. SpawnPlayer( params[ 0 ] );
  735.  
  736. new String[ 245 ];
  737. format( String, sizeof String, "You spawned "COL_LIGHTBLUE"%s", pName( params[ 0 ] ) );
  738. SendClientMessage( playerid, -1, String );
  739. format( String, sizeof String, ""COL_LIGHTBLUE"%s( %s ){FFFFFF} spawned you.",pName( playerid ), GetPlayerLevelName( playerid ));
  740. SendClientMessage( params[ 0 ], -1, String );
  741. return 1;
  742. }
  743. CMD:vipgod( playerid,params[])
  744. {
  745. if ( GetPVarInt( playerid, "VIP Level" ) < 1 )
  746. return SendClientMessage( playerid, -1, "You must be an VIP Level 1 to use this command");
  747.  
  748. if ( GetPVarInt( playerid, "God" ) == 0 )
  749. {
  750. SetPVarInt( playerid, "God", 1);
  751. God[ playerid ] = SetTimerEx( "GodTimer", 200, true, "i", playerid );
  752. SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"God Fature{FFFFFF} is now enabled!");
  753. }
  754. else
  755. {
  756. SetPVarInt( playerid, "God", 0);
  757. KillTimer( God[ playerid ] );
  758. SetPlayerHealth( playerid, 100.0 );
  759. SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"God Fature{FFFFFF} is now disabled!");
  760. }
  761. return 1;
  762. }
  763. CMD:vipcargod( playerid,params[])
  764. {
  765. if ( GetPVarInt( playerid, "VIP Level" ) < 1 )
  766. return SendClientMessage( playerid, -1, "You must be an VIP Level 1 to use this command");
  767.  
  768. if ( GetPVarInt( playerid, "CGod" ) == 0 )
  769. {
  770. SetPVarInt( playerid, "CGod", 1);
  771. CGod[ playerid ] = SetTimerEx( "CarGodTimer", 200, true, "i", playerid );
  772. SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Car God Fature{FFFFFF} is now enabled!");
  773. }
  774. else
  775. {
  776. SetPVarInt( playerid, "CGod", 0);
  777. KillTimer( CGod[ playerid ] );
  778. SetVehicleHealth( GetPlayerVehicleID( playerid ), 1000.0 );
  779. SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Car God Fature{FFFFFF} is now disabled!");
  780. }
  781. return 1;
  782. }
  783. CMD:acmds( playerid, params[ ] )
  784. {
  785. if ( GetPVarInt( playerid, "Level" ) < 1 )
  786. return SendClientMessage( playerid, -1, "You must be an Admin level 1 or above to view the commands");
  787.  
  788. new CBox[ 512 ];
  789. format( CBox, sizeof CBox, "{FFFFFF}Current Admin commands\n\n\n\
  790. "COL_RED"Level {FFFFFF}1 "COL_RED"- {FFFFFF}( "COL_RED""Level1" {FFFFFF})\n\
  791. /settime /setweather /sethealth /setarmour /heal /setmoney /setscore\n\n\
  792. "COL_RED"Level {FFFFFF}2 "COL_RED"- {FFFFFF}( "COL_RED""Level2" {FFFFFF})\n");
  793.  
  794. format( CBox, sizeof CBox, "%s/akill /mute /unmute /freeze /unfreeze /kick /spawn\n\n\
  795. "COL_RED"Level {FFFFFF}3 "COL_RED"- {FFFFFF}( "COL_RED""Level3" {FFFFFF})\n\
  796. /gmx /ban\n\n\n\
  797. Please take a look at the Admin Rules -> "COL_RED"/arules", CBox);
  798. ShowPlayerDialog( playerid, INFO_BOX, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admin Commands", CBox, "Oke", "");
  799. return 1;
  800. }
  801. CMD:viphelp( playerid, params[ ] )
  802. {
  803. if ( GetPVarInt( playerid, "Level" ) < 1 )
  804. return SendClientMessage( playerid, -1, "You must be a VIP Member to use this command");
  805.  
  806. ShowPlayerDialog( playerid, INFO_BOX, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admin Commands", "{FFFFFF}Few VIP Commands.\n\n\n\
  807. "COL_LIGHTBLUE"Level {FFFFFF}1\n\
  808. /vipgod\n\n\
  809. "COL_LIGHTBLUE"Level {FFFFFF}2\n\
  810. /vipgod /vipcargod\n\n\
  811. "COL_LIGHTBLUE"Level {FFFFFF}3\n\
  812. /vipgod /vipcargod /vnrg /vinf\n\n\n", "Oke", "");
  813. return 1;
  814. }
  815. CMD:arules( playerid, params[ ] )
  816. {
  817. if ( GetPVarInt( playerid, "Level" ) < 1 )
  818. return SendClientMessage( playerid, -1, "You must be an Admin level 1 or above to view the Admin Rules");
  819.  
  820. new CBox[ 700 ];
  821. format( CBox, sizeof CBox, "{FFFFFF}Current Admin Rules\n\n\n\
  822. "COL_RED"Level {FFFFFF}1 "COL_RED"- {FFFFFF}( "COL_RED""Level1" {FFFFFF})\n\
  823. -Your duty is to ensure a player's pleasure to play on the server, set his time\n\
  824. set his wather, etc.\n\n\
  825. "COL_RED"Level {FFFFFF}2 "COL_RED"- {FFFFFF}( "COL_RED""Level2" {FFFFFF})\n");
  826.  
  827. format( CBox, sizeof CBox, "%s-Your job is to ensure nobody abuses the commands, or insults players\n\
  828. you must take control over mean players and punish them.\n\n\
  829. "COL_RED"Level {FFFFFF}3 "COL_RED"- {FFFFFF}( "COL_RED""Level3" {FFFFFF})\n\
  830. -The "Level3" can do whatever they want, you cannot judge their actions.\n\n\n\
  831. Please take a look at the Admin Commands -> "COL_RED"/acmds", CBox);
  832. ShowPlayerDialog( playerid, INFO_BOX, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admin Commands", CBox, "Oke", "");
  833. return 1;
  834. }
  835. CMD:stats( playerid, paramz[ ] )
  836. {
  837. if ( GetPVarInt( playerid, "Logged" ) == 0 )
  838. return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} To view your stats you must be logged in ");
  839.  
  840. new
  841. iBox[ 1024 ],
  842. RegDate[ 40 ],
  843. pLastOn[ 20 + 20 ],
  844. pLevel = GetPVarInt( playerid, "Level")
  845. ;
  846. GetPVarString( playerid, "Date", RegDate, sizeof RegDate );
  847. GetPVarString( playerid, "On", pLastOn, sizeof pLastOn );
  848.  
  849. format( iBox, sizeof iBox, "{FFFFFF}Hello "COL_LIGHTBLUE"%s{FFFFFF}, these are your stats\n\n\
  850. {FFFFFF}Admin level: "COL_LIGHTBLUE"%s{FFFFFF}["COL_LIGHTBLUE"%d{FFFFFF}]\n\
  851. {FFFFFF}VIP Level: "COL_LIGHTBLUE"%d\n\
  852. {FFFFFF}Moneys: "COL_LIGHTBLUE"%d\n\
  853. {FFFFFF}Score: "COL_LIGHTBLUE"%d\n\
  854. {FFFFFF}Coins: "COL_LIGHTBLUE"%d\n\
  855. {FFFFFF}Kills: "COL_LIGHTBLUE"%d\n\
  856. {FFFFFF}Deaths: "COL_LIGHTBLUE"%d\n\
  857. {FFFFFF}Registration Date: "COL_LIGHTBLUE"%s\n\
  858. {FFFFFF}Interior: "COL_LIGHTBLUE"%d\n",
  859. pName( playerid ),
  860. GetPlayerLevelName( playerid ),
  861. pLevel,
  862. GetPlayerVLevel( playerid ),
  863. GetPlayerMoney( playerid ),
  864. GetPlayerScore( playerid ),
  865. GetPlayerCoins( playerid ),
  866. GetPVarInt( playerid,"Kills" ),
  867. GetPVarInt( playerid,"Deaths" ),
  868. RegDate,
  869. GetPlayerInterior( playerid ) );
  870.  
  871. format( iBox, sizeof iBox, "%s{FFFFFF}Virtual World: "COL_LIGHTBLUE"%d\n\
  872. {FFFFFF}My Favorite Skin: "COL_LIGHTBLUE"%d\n\
  873. {FFFFFF}My Time: "COL_LIGHTBLUE"%d\n\
  874. {FFFFFF}My Weather: "COL_LIGHTBLUE"%d\n\
  875. {FFFFFF}Last On: "COL_LIGHTBLUE"%s\n\
  876. {FFFFFF}Car God: "COL_LIGHTBLUE"%s\n\
  877. {FFFFFF}Player God: "COL_LIGHTBLUE"%s",
  878. iBox,
  879. GetPlayerVirtualWorld( playerid ),
  880. GetMySkin( playerid ),
  881. GetMyTime( playerid ),
  882. GetMyWeather( playerid ),
  883. pLastOn,
  884. GetPVarInt( playerid, "CGod" ) ? (""COL_GREEN"Yes") : (""COL_RED"No"),
  885. GetPVarInt( playerid, "God" ) ? (""COL_GREEN"Yes") : (""COL_RED"No"));
  886.  
  887. ShowPlayerDialog( playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FFFFFF}Your Stats!", iBox, "Ok", "");
  888. return 1;
  889. }
  890. public OnPlayerDeath( playerid, killerid, reason )
  891. {
  892. SetPVarInt( killerid, "Kills", GetPVarInt( playerid, "Kills" ) + 1 );
  893. SetPVarInt( playerid, "Deaths", GetPVarInt( playerid, "Deaths" ) + 1 );
  894. return 1;
  895. }
  896. public OnPlayerText( playerid, text[] )
  897. {
  898. if ( GetPVarInt( playerid, "Muted" ) == 1 && !IsPlayerAdmin( playerid ) )
  899. {
  900. SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} You are muted, you cannot chat!");
  901. }
  902. return 1;
  903. }
  904. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  905. {
  906. switch( dialogid )
  907. {
  908. case DIALOG_REG:
  909. {
  910. if ( response )
  911. {
  912. if ( sscanf( inputtext, "s", inputtext[ 0 ] || strlen( inputtext[ 0 ] ) == 0 ) )
  913. return ShowPlayerDialog( playerid, DIALOG_REG, DIALOG_STYLE_INPUT, "{FFFFFF}Password", ""COL_RED"Error!\n\
  914. {FFFFFF}Please write your desired password.\n",
  915. ">>>", "Exit");
  916. if ( strlen( inputtext[ 0 ] ) < 3 || strlen( inputtext[ 0 ] ) > 20 )
  917. return ShowPlayerDialog( playerid, DIALOG_REG, DIALOG_STYLE_INPUT, "{FFFFFF}Password", ""COL_RED"Error!\n\
  918. {FFFFFF}Please write your desired password.\n\
  919. "COL_RED"#{FFFFFF}Min. 3 Char. Max. 20 Char.",
  920. ">>>", "Exit");
  921. new
  922. PlayerFile[ 13 + MAX_PLAYER_NAME ],
  923. pDate[ 8 + 15 ], //HH:MM:SS + DD.MM.YYYY = 18
  924. pYear,
  925. pMonth,
  926. pDay,
  927. pHour,
  928. pMinute,
  929. pSecond,
  930. pIP[ 20 ],
  931. InfBox[ 512 ]
  932. ;
  933. getdate(pYear, pMonth, pDay ),gettime(pHour, pMinute, pSecond );
  934. GetPlayerIp( playerid, pIP, 20 );
  935.  
  936.  
  937. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  938. format( pDate, sizeof pDate, "%d:%d:%d %d/%d/%d",pHour, pMinute, pSecond , pDay, pMonth, pYear );
  939. format( InfBox, sizeof InfBox, "{FFFFFF}You registered your account with success!\n\n\
  940. "COL_LIGHTBLUE"Account: {FFFFFF}%s\n\
  941. "COL_LIGHTBLUE"Password: {FFFFFF}%s\n\n\
  942. You received "COL_GREEN"$5000{FFFFFF} for registering.\n\
  943. Would you like to login?", pName( playerid ),
  944. inputtext );
  945. ShowPlayerDialog( playerid, DIALOG_LOG, DIALOG_STYLE_MSGBOX, "Login", InfBox, "Yes", "No" );
  946.  
  947.  
  948. new
  949. INI:PlayerAcc = INI_Open( PlayerFile );
  950.  
  951. INI_WriteString( PlayerAcc, "NAME", pName( playerid ) );
  952. INI_WriteString( PlayerAcc, "PASSWORD", inputtext );
  953. INI_WriteString( PlayerAcc, "REG_DATE", pDate );
  954. INI_WriteString( PlayerAcc, "LAST_ON", "First connection" );
  955. INI_WriteInt( PlayerAcc, "MONEYS", 5000 );
  956. INI_WriteInt( PlayerAcc, "SCORE", 15 );
  957. INI_WriteInt( PlayerAcc, "COINS", 15 );
  958. INI_WriteInt( PlayerAcc, "KILLS", 0 );
  959. INI_WriteInt( PlayerAcc, "DEATHS", 0 );
  960. INI_WriteInt( PlayerAcc, "VIP_LEVEL", 0 );
  961. INI_WriteInt( PlayerAcc, "LEVEL", 0 );
  962. INI_WriteInt( PlayerAcc, "MY_SKIN", 0 );
  963. INI_WriteInt( PlayerAcc, "MY_TIME", 12 );
  964. INI_WriteInt( PlayerAcc, "MY_WEATHER", 1 );
  965.  
  966. INI_Close( PlayerAcc );
  967.  
  968. SetPVarString( playerid, "Date", pDate );
  969. SetPVarInt( playerid, "Logged", 0 );
  970. GivePlayerMoney( playerid, 5000 );
  971. SetPlayerScore( playerid, GetPlayerScore( playerid ) + 15 );
  972. SetPlayerCoins( playerid, GetPlayerCoins( playerid ) + 15 );
  973.  
  974.  
  975. }
  976. }
  977. case DIALOG_REG_REQ:
  978. {
  979. if ( response ) cmd_register( playerid, "");
  980. if ( !response ) return 0;
  981.  
  982. }
  983.  
  984. case DIALOG_LOGIN: ShowPlayerDialog( playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "{FFFFFF}Password",
  985. "{FFFFFF}Please write your current password.",
  986. "Login", "Kick");
  987.  
  988. case DIALOG_LOG:
  989. {
  990. if ( response )
  991. ShowPlayerDialog( playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "{FFFFFF}Password", "{FFFFFF}Please write your current password.","Login","Kick");
  992. }
  993. case DIALOG_LOGIN2:
  994. {
  995. if ( !response ) return Kick( playerid );
  996. if ( response )
  997. {
  998. if ( strlen( inputtext ) == 0 )
  999. return ShowPlayerDialog( playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "{FFFFFF}Password", ""COL_RED"Error!\n\
  1000. {FFFFFF}Please write your current password.",
  1001. "Login", "Kick");
  1002.  
  1003. new
  1004. PlayerFile[ 13 + MAX_PLAYER_NAME ],
  1005. Password[ 20 + 1 ]
  1006. ;
  1007. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  1008. INI_ParseFile( PlayerFile, "ParsePlayerPass", false, true, playerid );
  1009. GetPVarString( playerid, "pPass", Password, sizeof Password );
  1010.  
  1011. if ( !strcmp ( inputtext, Password, false ) )
  1012. {
  1013. new
  1014. sTitle[ 21 + MAX_PLAYER_NAME + 25 ],
  1015. sBoxInfo[ 512 ],
  1016. Pdata[ 8 + 15 ]
  1017. ;
  1018.  
  1019. SetPVarInt( playerid, "Logged", 1 );
  1020. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  1021. INI_ParseFile( PlayerFile, "LoadUser", false, true, playerid, true, false );
  1022. GetPVarString( playerid, "Date", Pdata, 8 + 10 );
  1023.  
  1024.  
  1025. if ( GetPVarInt( playerid, "CGod" ) == 1 )
  1026. {
  1027. SetPVarInt( playerid, "CGod", 1);
  1028. CGod[ playerid ] = SetTimerEx( "CarGodTimer", 200, true, "i", playerid );
  1029. }
  1030. if ( GetPVarInt( playerid, "God" ) == 1 )
  1031. {
  1032. SetPVarInt( playerid, "God", 1);
  1033. God[ playerid ] = SetTimerEx( "GodTimer", 200, true, "i", playerid );
  1034. }
  1035. format( sTitle, sizeof sTitle, "{FFFFFF}Welcome back, "COL_LIGHTBLUE"%s{FFFFFF}!", pName( playerid ) );
  1036. if ( GetPVarInt( playerid, "Level" ) == 0 )
  1037. {
  1038. format( sBoxInfo, sizeof sBoxInfo, "{FFFFFF}These are your stats:\n\n\
  1039. {FFFFFF}Rank: "COL_LIGHTBLUE"%s\n\
  1040. {FFFFFF}VIP Level: "COL_LIGHTBLUE"%d\n\
  1041. {FFFFFF}Score: "COL_LIGHTBLUE"%d\n\
  1042. {FFFFFF}Coins: "COL_LIGHTBLUE"%d\n\
  1043. {FFFFFF}Registered on: "COL_LIGHTBLUE"%s\n\n\
  1044. {FFFFFF}To view more stats please type to "COL_LIGHTBLUE"/stats\n\
  1045. {FFFFFF}Type "COL_LIGHTBLUE"/mycmds{FFFFFF} to view your current commands.",
  1046. GetPlayerLevelName( playerid ),
  1047. GetPlayerVLevel( playerid ),
  1048. GetPVarInt( playerid, "Score" ),
  1049. GetPVarInt( playerid, "Coins" ),
  1050. Pdata );
  1051. }
  1052. if ( GetPVarInt( playerid, "Level" ) > 1 )
  1053. {
  1054. format( sBoxInfo, sizeof sBoxInfo, "{FFFFFF}These are your stats:\n\n\
  1055. {FFFFFF}Level: "COL_LIGHTBLUE"%s\n\
  1056. {FFFFFF}VIP Level: "COL_LIGHTBLUE"%d\n\
  1057. {FFFFFF}Score: "COL_LIGHTBLUE"%d\n\
  1058. {FFFFFF}Coins: "COL_LIGHTBLUE"%d\n\
  1059. {FFFFFF}Registered on: "COL_LIGHTBLUE"%s\n\n",
  1060. GetPlayerLevelName( playerid ),
  1061. GetPlayerVLevel( playerid ),
  1062. GetPVarInt( playerid, "Score" ),
  1063. GetPVarInt( playerid, "Coins" ),
  1064. Pdata );
  1065.  
  1066. format( sBoxInfo, sizeof sBoxInfo, "%s{FFFFFF}To view more stats please type to "COL_LIGHTBLUE"/stats\n\
  1067. {FFFFFF}Type "COL_LIGHTBLUE"/mycmds{FFFFFF} to view your current commands.\n\
  1068. "COL_RED"Admin note:{FFFFFF}Use "COL_LIGHTBLUE"/acmds {FFFFFF}and "COL_LIGHTBLUE"/arules {FFFFFF}for commands and Admin rules.",sBoxInfo);
  1069. }
  1070. ShowPlayerDialog(playerid, DIALOG_LOG_DONE, DIALOG_STYLE_MSGBOX, sTitle, sBoxInfo, "Ok", "");
  1071.  
  1072. }
  1073. else ShowPlayerDialog(playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, ""COL_RED"Wrong password...", ""COL_RED"Wrong password!\n{FFFFFF}Please try again.", "Login", "Kick");
  1074.  
  1075.  
  1076. }
  1077. }
  1078. }
  1079. return 1;
  1080. }
  1081.  
  1082. public OnPlayerConnect(playerid)
  1083. {
  1084. if ( !INI_Exist( pName( playerid ) ) )
  1085. ShowPlayerDialog( playerid, DIALOG_REG_REQ, DIALOG_STYLE_MSGBOX, "{FFFFFF}Password", "{FFFFFF}To play you must register an account!", "Ok", "");
  1086. else
  1087. ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_MSGBOX, "{FFFFFF}Password", "{FFFFFF}Your name is registered, would you like to login?", "Yes", "No");
  1088. return 1;
  1089. }
  1090. public OnPlayerRequestSpawn( playerid )
  1091. {
  1092. SetTimerEx("LoadFav", 200, false , "i" , playerid );
  1093. return 1;
  1094. }
  1095. forward LoadFav( playerid );
  1096. public LoadFav( playerid )
  1097. {
  1098. GivePlayerMoney ( playerid, GetPVarInt( playerid, "Moneys" ) );
  1099. SetPlayerScore ( playerid, GetPVarInt( playerid, "Score" ) );
  1100. SetPlayerCoins ( playerid, GetPVarInt( playerid, "Coins" ) );
  1101. SetPlayerWeather( playerid, GetPVarInt( playerid, "Weather" ) );
  1102. SetPlayerTime ( playerid, GetPVarInt( playerid, "Time" ), 0 );
  1103. SetPlayerSkin ( playerid, GetPVarInt( playerid, "Skin" ) );
  1104.  
  1105. SendClientMessage( playerid, -1, "Your favorite things have been loaded! Check "COL_LIGHTBLUE"/stats.");
  1106. }
  1107. public OnPlayerDisconnect(playerid, reason)
  1108. {
  1109. if ( GetPVarInt( playerid, "Logged" ) == 1 && INI_Exist( pName( playerid ) ) )
  1110. {
  1111. new
  1112. PlayerFile[ 13 + MAX_PLAYER_NAME + 1],
  1113. tDate[ 40 ],
  1114. Year,
  1115. Month,
  1116. Day,
  1117. Hour,
  1118. Minute,
  1119. Second
  1120. ;
  1121.  
  1122. format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
  1123. getdate( Year,Month,Day );
  1124. gettime( Hour,Minute,Second );
  1125. format( tDate, sizeof tDate, "%d/%d/%d at %d:%d:%d", Day,Month,Year,Hour,Minute,Second);
  1126.  
  1127. new
  1128. INI:PlayerAcc = INI_Open( PlayerFile );
  1129.  
  1130. INI_WriteInt( PlayerAcc, "MONEYS", GetPlayerMoney( playerid ) );
  1131. INI_WriteInt( PlayerAcc, "SCORE", GetPlayerScore( playerid ) );
  1132. INI_WriteInt( PlayerAcc, "COINS", GetPlayerCoins( playerid ) );
  1133. INI_WriteInt( PlayerAcc, "KILLS", GetPVarInt( playerid, "Kills" ) );
  1134. INI_WriteInt( PlayerAcc, "DEATHS", GetPVarInt( playerid, "Deaths" ) );
  1135. INI_WriteInt( PlayerAcc, "LEVEL", GetPVarInt( playerid, "Level" ) );
  1136. INI_WriteInt( PlayerAcc, "VIP_LEVEL", GetPVarInt( playerid, "VIP Level" ) );
  1137. INI_WriteInt( PlayerAcc, "MY_WEATHER", GetPVarInt( playerid, "Weather" ) );
  1138. INI_WriteInt( PlayerAcc, "MY_TIME", GetPVarInt( playerid, "Time" ) );
  1139. INI_WriteInt( PlayerAcc, "MY_SKIN", GetPVarInt( playerid, "Skin" ) );
  1140. INI_WriteInt( PlayerAcc, "MUTED", GetPVarInt( playerid, "Muted" ) );
  1141. INI_WriteInt( PlayerAcc, "GOD", GetPVarInt( playerid, "God" ) );
  1142. INI_WriteInt( PlayerAcc, "CAR_GOD", GetPVarInt( playerid, "CGod" ) );
  1143. INI_WriteString( PlayerAcc, "LAST_ON", tDate );
  1144. INI_Close( PlayerAcc );
  1145. }
  1146. SetPVarInt( playerid, "Logged", 0 );
  1147. return 1;
  1148. }
  1149. //Stocks
  1150. stock GetPlayerVLevel( playerid ) return GetPVarInt( playerid, "VIP Level" );
  1151. stock GetMySkin( playerid ) return GetPVarInt( playerid, "Skin" );
  1152. stock GetMyTime( playerid ) return GetPVarInt( playerid, "Time" );
  1153. stock GetMyWeather( playerid ) return GetPVarInt( playerid, "Weather" );
  1154.  
  1155.  
  1156. stock IsValidSkin(SkinID)
  1157. {
  1158. if ( ( SkinID == 0 ) ||
  1159. ( SkinID == 7 ) ||
  1160. ( SkinID >= 9 && SkinID <= 41 ) ||
  1161. ( SkinID >= 43 && SkinID <= 64 ) ||
  1162. ( SkinID >= 66 && SkinID <= 73 ) ||
  1163. ( SkinID >= 75 && SkinID <= 85 ) ||
  1164. ( SkinID >= 87 && SkinID <= 118 ) ||
  1165. ( SkinID >= 120 && SkinID <= 148 ) ||
  1166. ( SkinID >= 150 && SkinID <= 207 ) ||
  1167. ( SkinID >= 209 && SkinID <= 264 ) ||
  1168. ( SkinID >= 274 && SkinID <= 288 ) ||
  1169. ( SkinID >= 290 && SkinID <= 299 ) )
  1170. return true;
  1171. else return false;
  1172. }
  1173.  
  1174. stock INI_Exist(nickname[])
  1175. {
  1176. new tmp[255];
  1177. format(tmp,sizeof(tmp),"Accounts/%s.ini",Encode( nickname ) );
  1178. return fexist(tmp);
  1179. }
  1180.  
  1181. stock pName( playerid )
  1182. {
  1183. new Name[ MAX_PLAYER_NAME ];
  1184. GetPlayerName( playerid, Name, sizeof( Name ) );
  1185. return Name;
  1186. }
  1187.  
  1188. //DracoBlue
  1189. stock Encode(nickname[])
  1190. {
  1191. new tmp[255];
  1192. set(tmp,nickname);
  1193. tmp=strreplace("_","_00",tmp);
  1194. tmp=strreplace(";","_01",tmp);
  1195. tmp=strreplace("!","_02",tmp);
  1196. tmp=strreplace("/","_03",tmp);
  1197. tmp=strreplace("\\","_04",tmp);
  1198. tmp=strreplace("[","_05",tmp);
  1199. tmp=strreplace("]","_06",tmp);
  1200. tmp=strreplace("?","_07",tmp);
  1201. tmp=strreplace(".","_08",tmp);
  1202. tmp=strreplace("*","_09",tmp);
  1203. tmp=strreplace("<","_10",tmp);
  1204. tmp=strreplace(">","_11",tmp);
  1205. tmp=strreplace("{","_12",tmp);
  1206. tmp=strreplace("}","_13",tmp);
  1207. tmp=strreplace(" ","_14",tmp);
  1208. tmp=strreplace("\"","_15",tmp);
  1209. tmp=strreplace(":","_16",tmp);
  1210. tmp=strreplace("|","_17",tmp);
  1211. tmp=strreplace("=","_18",tmp);
  1212. return tmp;
  1213. }
  1214. stock set(dest[],source[]) {
  1215. new count = strlen(source);
  1216. new i=0;
  1217. for (i=0;i<count;i++) {
  1218. dest[i]=source[i];
  1219. }
  1220. dest[count]=0;
  1221. }
  1222. stock strreplace(trg[],newstr[],src[]) {
  1223. new f=0;
  1224. new s1[255];
  1225. new tmp[255];
  1226. format(s1,sizeof(s1),"%s",src);
  1227. f = strfind(s1,trg);
  1228. tmp[0]=0;
  1229. while (f>=0) {
  1230. strcat(tmp,ret_memcpy(s1, 0, f));
  1231. strcat(tmp,newstr);
  1232. format(s1,sizeof(s1),"%s",ret_memcpy(s1, f+strlen(trg), strlen(s1)-f));
  1233. f = strfind(s1,trg);
  1234. }
  1235. strcat(tmp,s1);
  1236. return tmp;
  1237. }
  1238. ret_memcpy(source[],index=0,numbytes) {
  1239. new tmp[255];
  1240. new i=0;
  1241. tmp[0]=0;
  1242. if (index>=strlen(source)) return tmp;
  1243. if (numbytes+index>=strlen(source)) numbytes=strlen(source)-index;
  1244. if (numbytes<=0) return tmp;
  1245. for (i=index;i<numbytes+index;i++) {
  1246. tmp[i-index]=source[i];
  1247. if (source[i]==0) return tmp;
  1248. }
  1249. tmp[numbytes]=0;
  1250. return tmp;
  1251. }
  1252. forward GodTimer( playerid );
  1253. public GodTimer( playerid )
  1254. {
  1255. if ( GetPVarInt( playerid, "God" ) == 0 ) KillTimer( God[ playerid ] );
  1256. SetPlayerHealth( playerid, 999999999.0 );
  1257. }
  1258. forward CarGodTimer( playerid );
  1259. public CarGodTimer( playerid )
  1260. {
  1261. if ( GetPVarInt( playerid, "CGod" ) == 0 ) KillTimer( CGod[ playerid ] );
  1262. if ( IsPlayerInAnyVehicle( playerid ) == 1 )
  1263. {
  1264. RepairVehicle( GetPlayerVehicleID( playerid ) );
  1265. SetVehicleHealth( GetPlayerVehicleID( playerid ), 9999.0 );
  1266. }
  1267. }
  1268. forward CallInfernus(playerid);
  1269. public CallInfernus(playerid)
  1270. {
  1271. if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
  1272. new Float: X, Float: Y, Float: Z, Float: Ang;
  1273. GetPlayerPos(playerid, X, Y, Z);
  1274. GetPlayerFacingAngle(playerid, Ang);
  1275. PutPlayerInVehicle(playerid, pInfernus[playerid], 0);
  1276. SetVehiclePos(pInfernus[playerid], X, Y, Z);
  1277. SetVehicleZAngle(pInfernus[playerid], Ang);
  1278. SetVehicleHealth(pInfernus[playerid], 1000.0);
  1279. LinkVehicleToInterior(pInfernus[playerid], GetPlayerInterior(playerid));
  1280. SendClientMessage( playerid, -1, "-Personal "COL_LIGHTBLUE"Infernus{FFFFFF} called!");
  1281. }
  1282. forward CreateInfernus( playerid );
  1283. public CreateInfernus(playerid)
  1284. {
  1285. if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
  1286. new Float: X, Float: Y, Float: Z, Float: Ang;
  1287. GetPlayerPos(playerid, X, Y, Z);
  1288. GetPlayerFacingAngle(playerid, Ang);
  1289. pInfernus[playerid] = CreateVehicle(411, X, Y, Z+3, Ang, 75,3, 5000000);
  1290. PutPlayerInVehicle(playerid, pInfernus[playerid], 0);
  1291. LinkVehicleToInterior(pInfernus[playerid], GetPlayerInterior(playerid));
  1292. printf("Personal Infernus created for %s.", pName(playerid));
  1293. SendClientMessage( playerid, -1, "-Personal "COL_LIGHTBLUE"Infernus{FFFFFF} created!");
  1294. for(new i=0; i < MAX_PLAYERS; i++)
  1295. {
  1296. if (IsPlayerConnected(i) && i != playerid)
  1297. {
  1298. SetVehicleParamsForPlayer(pInfernus[playerid], i, 0, 1);
  1299. }
  1300. }
  1301. }
  1302. forward CallNRG(playerid);
  1303. public CallNRG(playerid)
  1304. {
  1305. if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
  1306. new Float: X, Float: Y, Float: Z, Float: Ang;
  1307. GetPlayerPos(playerid, X, Y, Z);
  1308. GetPlayerFacingAngle(playerid, Ang);
  1309. PutPlayerInVehicle(playerid, pNrg500[playerid], 0);
  1310. SetVehiclePos(pNrg500[playerid], X, Y, Z);
  1311. SetVehicleZAngle(pNrg500[playerid], Ang);
  1312. SetVehicleHealth(pNrg500[playerid], 1000.0);
  1313. LinkVehicleToInterior(pNrg500[playerid], GetPlayerInterior(playerid));
  1314. SendClientMessage( playerid, -1, "-Personal "COL_LIGHTBLUE"NRG-500{FFFFFF} called");
  1315. }
  1316. forward CreateNRG(playerid);
  1317. public CreateNRG(playerid)
  1318. {
  1319. if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
  1320. new Float: X, Float: Y, Float: Z, Float: Ang;
  1321. GetPlayerPos(playerid, X, Y, Z);
  1322. GetPlayerFacingAngle(playerid, Ang);
  1323. pNrg500[playerid] = CreateVehicle(522, X, Y, Z+3, Ang, 75,3, 5000000);
  1324. PutPlayerInVehicle(playerid, pNrg500[playerid], 0);
  1325. LinkVehicleToInterior(pNrg500[playerid], GetPlayerInterior(playerid));
  1326. printf("Personal NRG created for %s.", pName(playerid));
  1327. SendClientMessage( playerid, -1, "-Personal "COL_LIGHTBLUE"NRG-500{FFFFFF} created!");
  1328. for(new i=0; i < MAX_PLAYERS; i++)
  1329. {
  1330. if (IsPlayerConnected(i) && i != playerid)
  1331. {
  1332. SetVehicleParamsForPlayer(pNrg500[playerid], i, 0, 1);
  1333. }
  1334. }
  1335. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement