Advertisement
Guest User

Admin Commands ENG

a guest
Jun 1st, 2016
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.53 KB | None | 0 0
  1. /*
  2. ONLY RECON(LATER WITH ADMIN LEVEL)
  3. OTHER VERSION ARE IN DEVELOPEMENT IN THIS TIME
  4. */
  5. #include <a_samp> // thank for the sa-mp team
  6. #include <izcmd> // thank for yashas for IZCMD
  7. #include <sscanf2> // thank for maddinat0r for sscanf2
  8.  
  9. #define FILTERSCRIPT // define filterscript
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. #define COULEUR_GRIS 0xAFAFAFAA
  14. #define COULEUR_VERT 0x33AA33AA
  15. #define COULEUR_ROUGE 0xAA3333AA
  16. #define COULEUR_JAUNE 0xFFFF00AA
  17. #define COULEUR_BLANC 0xFFFFFFAA
  18. #define COULEUR_BLEU 0x0000BBAA
  19. #define COULEUR_BLEUCLAIR 0x33CCFFAA
  20. #define COULEUR_ORANGE 0xFF9900AA
  21.  
  22. public OnFilterScriptInit()
  23. {
  24.     print("----------------[Admin Filterscript Loaded]----------------");
  25.     print("By Xxsnake601xX or Eymeric69 v1.0");
  26.     print("----------------[Admin Filterscript Loaded]----------------");
  27.     return 1;
  28. }
  29. new bool:muter[MAX_PLAYERS];
  30.  
  31. CMD:cmdsadmin(playerid, params[])
  32. {
  33.     if(IsPlayerConnected(playerid))
  34.     {
  35.         if(IsPlayerAdmin(playerid))
  36.         {
  37.             SendClientMessage(playerid, COULEUR_ROUGE, "--------------------------[HELP COMMANDS ADMIN]--------------------------");
  38.             SendClientMessage(playerid, COULEUR_BLEU, "/muter /unmuter /ban /kick /givemoney /removeweapon /godmodeon /godmodeoff");
  39.             SendClientMessage(playerid, COULEUR_BLEU, "/clearchat /dutyadmin /dutyadmin /version");
  40.             SendClientMessage(playerid, COULEUR_ROUGE, "--------------------------[HELP COMMANDS ADMIN]--------------------------");
  41.             return 1;
  42.         }
  43.         else
  44.         {
  45.             SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] You must to be administrator");
  46.         }
  47.     }
  48.     else
  49.     {
  50.         SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You are not connected on the server");
  51.     }
  52.     return 1;
  53. }
  54.  
  55. CMD:version(playerid, params[])
  56. {
  57.     SendClientMessage(playerid, COULEUR_BLEUCLAIR, "version : 1.0");
  58.     return 1;
  59. }
  60.  
  61. CMD:ban(playerid, params[])
  62. {
  63.     new nomadmin[24], cibleid, raison[128], string[128];
  64.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] You must to be administrator");
  65.     if(sscanf(params, "us[128]", cibleid, raison)) return SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] Usage: /ban [id] [reason]");
  66.     if(!IsPlayerConnected(cibleid)) return SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] This Player is not connected");
  67.     GetPlayerName(playerid, nomadmin, sizeof(nomadmin));
  68.     format(string, sizeof(string),"l'administrator: %s ban you for: %s", nomadmin, raison);
  69.     SendClientMessage(cibleid, COULEUR_ROUGE, string);
  70.     Ban(cibleid);
  71.     return 1;
  72. }
  73.  
  74. CMD:kick(playerid, params[])
  75. {
  76.     new nomadmin[24], cibleid, raison[128], string[128];
  77.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] You must to be administrator");
  78.     if(sscanf(params, "us[128]", cibleid, raison)) return SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] Usage: /kick [id] [reason]");
  79.     if(!IsPlayerConnected(cibleid)) return SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] This Player is not connected.");
  80.     GetPlayerName(playerid, nomadmin, sizeof(nomadmin));
  81.     format(string, sizeof(string),"l'administrator: %s kick you for: %s", nomadmin, raison);
  82.     SendClientMessage(cibleid, COULEUR_ROUGE, string);
  83.     Kick(cibleid);
  84.     return 1;
  85. }
  86.  
  87. CMD:muter(playerid, params[])
  88. {
  89.     new cibleid, minutes, raison[128], string[128];
  90.     if(!IsPlayerConnected(cibleid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] This Player is not connected.");
  91.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  92.     if(muter[cibleid] == true) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] Ce joueur est déjà muter");
  93.     if(sscanf(params,"uis[128]", cibleid, minutes, raison)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERREUR] Usage: /muter [id] [minutes] [reason]");
  94.     format(string, sizeof(string), "L'Administrateur %s à muté %s pour %d minutes: %s", PlayerName(playerid), PlayerName(cibleid), minutes, raison);
  95.     SendClientMessageToAll(COULEUR_ROUGE, string);
  96.     SetTimerEx("Unmute", minutes*60000, false, "i", cibleid);
  97.     muter[cibleid] = true;
  98.     return 1;
  99. }
  100.  
  101. PlayerName(playerid)
  102. {
  103.     new name[MAX_PLAYER_NAME];
  104.     GetPlayerName(playerid,name,sizeof(name));
  105.     return name;
  106. }
  107.  
  108. forward Unmute(playerid);
  109. public Unmute(playerid)
  110. {
  111.     muter[playerid] = false;
  112.     SendClientMessage(playerid, COULEUR_ROUGE, "You've been automatically unmuted by the server.");
  113.     return 1;
  114. }
  115.  
  116. CMD:unmuter(playerid, params[])
  117. {
  118.     new cibleid, string[128];
  119.     if(!IsPlayerConnected(cibleid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] This Player is not connected.");
  120.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  121.     if(sscanf(params, "u", cibleid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR]Usage: For cancel mute: /unmuter [id]");
  122.     format(string, sizeof(string), "You mute has been cancelled by administrator: %s", PlayerName(playerid));
  123.     SendClientMessage(cibleid, COULEUR_ROUGE, string);
  124.     format(string, sizeof(string), "Administrator %s have been cancelled you mute player %s", PlayerName(playerid), PlayerName(cibleid));
  125.     SendClientMessageToAll(COULEUR_ROUGE, string);
  126.     KillTimer(Unmute(playerid));
  127.     muter[cibleid] = false;
  128.     return 1;
  129. }
  130.  
  131. CMD:givemoney(playerid,params[])
  132. {
  133.     new ID, montant, nom[MAX_PLAYERS], string[128], nom2[MAX_PLAYERS], string1[128];
  134.     if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] Ce joueur n'est pas connecté.");
  135.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  136.     if(sscanf(params, "ui", ID, montant)) return SendClientMessage(playerid, -1, "[ERROR] Usage: /donnerargent [id] [montant]");
  137.     GetPlayerName(ID, nom2, sizeof(nom2));
  138.     format(string1, sizeof(string1),"You have give to player %s with a amount of: %i Euro(s).", nom2, montant);
  139.     SendClientMessage(playerid, COULEUR_ROUGE, string1);
  140.     GetPlayerName(playerid, nom, sizeof(nom));
  141.     format(string, sizeof(string), "%s(%d) You have give: $%i", nom, playerid, montant);
  142.     SendClientMessage(ID, COULEUR_ROUGE, string);
  143.     GivePlayerMoney(ID, montant);
  144.     return 1;
  145. }
  146.  
  147. CMD:removeweapon(playerid, params[])
  148. {
  149.     new cibleid, string[128], nom[MAX_PLAYERS];
  150.     if(!IsPlayerConnected(cibleid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] Ce joueur n'est pas connecté.");
  151.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  152.     if(sscanf(params, "u", cibleid)) return SendClientMessage(playerid, -1, "[ERROR] Usage: /retirerarme [id] ");
  153.     GetPlayerName(playerid ,nom, sizeof(nom));
  154.     format(string, sizeof(string),"Administrator: %s have remove your weapons.", nom);
  155.     SendClientMessage(cibleid, COULEUR_ROUGE, string);
  156.     ResetPlayerWeapons(cibleid);
  157.     return 1;
  158. }
  159.  
  160. COMMAND:godmodeon(playerid, params[])
  161. {
  162.     if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] Vous n'ètes pas connecter.");
  163.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  164.     if (GetPVarInt(playerid, "GODMODEON") == 1) return SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] You are the already the god !");
  165.     SetPlayerHealth(playerid, 254000);
  166.     SendClientMessage(playerid, COULEUR_BLEUCLAIR, "You are a god");
  167.     return 1;
  168. }
  169. COMMAND:godmodeoff(playerid, params[])
  170. {
  171.     if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You are not connected.");
  172.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  173.     if (GetPVarInt(playerid, "GODMODEON") == 1)
  174.     return SendClientMessage(playerid, -1, "[ERROR] You are not already a god do /godmodeon for become a god !");
  175.     SetPlayerHealth(playerid, 100);
  176.     SendClientMessage(playerid, 0xFFFFFFF, "You are now a human");
  177.     return 1;
  178. }
  179.  
  180. new effacer;
  181. COMMAND:clearchat(playerid, params[])
  182. {
  183.     if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You are not connected.");
  184.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  185.     new string[128], stringdeux[129], name[MAX_PLAYER_NAME];
  186.     GetPlayerName(playerid, name, sizeof(name));
  187.     while(effacer < 200)
  188.     {
  189.         format(string, sizeof(string), "");
  190.         SendClientMessageToAll(-1, string);
  191.         effacer++;
  192.     }
  193.     format(stringdeux, sizeof(stringdeux), "Chat cleared by an admin");
  194.     SendClientMessageToAll(COULEUR_ROUGE, stringdeux);
  195.     return 1;
  196. }
  197.  
  198. COMMAND:dutyadmin(playerid, params[])
  199. {
  200.     if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You are not connected.");
  201.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  202.     new AdminName[24];
  203.     new string[128];
  204.     GetPlayerName(playerid, AdminName, sizeof(AdminName));
  205.     format(string, sizeof(string),"Administrator %s is now in duty !", AdminName);
  206.     SendClientMessageToAll(COULEUR_BLEUCLAIR, string);
  207.     SetPlayerSkin(playerid, 217);
  208.     SendClientMessage(playerid, COULEUR_BLEUCLAIR, "You become an admin in duty !");
  209.     // under working SetPlayerColor(playerid, COULEUR_ROUGE);
  210.     return 1;
  211. }
  212.  
  213. COMMAND:stopdutyadmin(playerid, params[])
  214. {
  215.     if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You are not connected.");
  216.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COULEUR_ROUGE, "[ERROR] You must to be administrator");
  217.     new AdminName[24];
  218.     new string[128];
  219.     GetPlayerName(playerid, AdminName, sizeof(AdminName));
  220.     format(string, sizeof(string),"Administrator %s is now in normal player !", AdminName);
  221.     SendClientMessageToAll(COULEUR_BLEUCLAIR, string);
  222.     SetPlayerSkin(playerid, 48);
  223.     SendClientMessage(playerid, COULEUR_BLEUCLAIR, "You are now a normal player !");
  224.     return 1;
  225. }
  226.  
  227. public OnFilterScriptExit()
  228. {
  229.     print("----------------[Admin Filterscript Deloaded]----------------");
  230.     print("By Xxsnake601xX or Eymeric69 v1.0");
  231.     print("----------------[Admin Filterscript Deloaded]----------------");
  232.     return 1;
  233. }
  234.  
  235. #else
  236.  
  237. main()
  238. {
  239.     print("\n----------------------------------");
  240.     print(" Blank Gamemode by your name here");
  241.     print("----------------------------------\n");
  242. }
  243.  
  244. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement