Guest User

Zh3r0

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