Advertisement
Guest User

Update of Simple Admin commands script By lewis1682

a guest
Apr 29th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 20.05 KB | None | 0 0
  1. // Admin Script v0.1 by lewis1682 - DO NOT REMOVE ANY CREDITS
  2. #define FILTERSCRIPT
  3.  
  4. #include <a_samp>
  5. #include <ZCMD>
  6. #include <sscanf2>
  7. #include <bud>
  8.  
  9. #undef MAX_PLAYERS
  10. #define MAX_PLAYERS 15
  11.  
  12. #define MIN_CHAR 4
  13. #define MAX_CHAR 10
  14. #define ADMIN_PASS "jokeradmin"
  15.  
  16. #define COLOR_ADMIN 0xA188FFFF
  17. #define COLOR_RED 0xFF0000FF
  18. #define COLOR_GREY 0x808080FF
  19. #define COLOR_YELLOW 0xFFFF00FF
  20.  
  21. enum pData
  22. {
  23.     Admin
  24. };
  25. new IsAdmin[MAX_PLAYERS][pData];
  26. new warns[MAX_PLAYERS];
  27. new bool:muted[MAX_PLAYERS];
  28. new Float:posx[MAX_PLAYERS];
  29. new Float:posy[MAX_PLAYERS];
  30. new Float:posz[MAX_PLAYERS];
  31. new bool:spectating[MAX_PLAYERS];
  32. new bool:godmode[MAX_PLAYERS];
  33. forward KickPublic(playerid);
  34. public KickPublic(playerid) { Kick(playerid); }
  35.  
  36. forward BanPublic(playerid);
  37. public BanPublic(playerid) {Ban(playerid); }
  38. stock KickWithMessage(playerid, message[])
  39. {
  40.     TogglePlayerSpectating(playerid,true);
  41.     SendClientMessageToAll(COLOR_RED, message);
  42.     SetTimerEx("KickPublic", 1000, 0, "d", playerid);   //Delay of 1 second before kicking the player so he recieves the message
  43. }
  44. stock BanWithMessage(playerid, message[])
  45. {
  46.     TogglePlayerSpectating(playerid,true);
  47.     SendClientMessageToAll(COLOR_RED, message);
  48.     SetTimerEx("BanPublic", 1000, 0, "d", playerid);
  49. }  
  50. public OnFilterScriptInit()
  51. {
  52.     print("\n--------------------------------------");
  53.     print("Admin Script V0.1 by lewis1682 - Loaded -");
  54.     print("--------------------------------------\n");
  55.    
  56.     BUD::Setting( opt.Database, "Players.db" );
  57.     BUD::Setting(opt.Asynchronous,true);
  58.     BUD::Setting(opt.KeepAliveTime,3000);
  59.    
  60.     BUD::Initialize();
  61.    
  62.     BUD::VerifyColumn( "Admin" , BUD::TYPE_NUMBER,0);
  63.     return 1;
  64. }
  65.  
  66. public OnFilterScriptExit()
  67. {
  68.     print("\n--------------------------------------");
  69.     print("Admin Script V0.1 by lewis1682 - Unloaded");
  70.     print("--------------------------------------\n")
  71.     return 1;
  72. }
  73.  
  74. CMD:duty(playerid,params[])
  75. {
  76.     new pass[64],string[86],pName[MAX_PLAYER_NAME+1];
  77.     new password[11];
  78.     password =  ADMIN_PASS; //change to what you like!
  79.     if(IsAdmin[playerid][Admin] == 1) return SendClientMessage(playerid,COLOR_GREY,"You are already on duty as admin");
  80.     if(sscanf(params,"s",pass)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /duty [Password]");
  81.     GetPlayerName(playerid,pName,sizeof(pName));
  82.     if(strcmp(password,pass)== 0)
  83.     {
  84.         format(string,sizeof(string),"Admin: %s is now on duty!",pName);
  85.         SendClientMessageToAll(COLOR_YELLOW,string);
  86.         SendClientMessage(playerid,COLOR_GREY,"You are now on admin duty /acmds to see a list of admin commands");
  87.         SetPlayerColor(playerid,COLOR_ADMIN);
  88.         IsAdmin[playerid][Admin] = 1;
  89.         AllowPlayerTeleport( playerid, 1 );
  90.         return 1;
  91.     }
  92.     else
  93.     {
  94.         SendClientMessage(playerid,COLOR_RED,"Wrong password!");
  95.     }
  96.     return 1;
  97. }
  98.  
  99. CMD:kick(playerid,params[])
  100. {
  101.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  102.     new id, reason[68], pName[MAX_PLAYER_NAME+1],aName[MAX_PLAYER_NAME+1],string[MAX_PLAYER_NAME+1+68+MAX_PLAYER_NAME+1];
  103.     if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /kick [ID] [Reason]");
  104.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  105.     GetPlayerName(id,pName,sizeof(pName));
  106.     GetPlayerName(playerid,aName,sizeof(aName));
  107.     format(string,sizeof(string),"[ADMIN CMD] %s was kicked by %s. Reason: %s",pName,aName,reason);
  108.     KickWithMessage(id,string);
  109.     new astring[MAX_PLAYER_NAME+1+68];
  110.     format(astring,sizeof(astring),"You have kicked player %s",pName);
  111.     new dstring[128+1];
  112.     format(dstring,sizeof(dstring),"You were kicked by %s.\nThe given reason was: %s.",aName,reason);
  113.     ShowPlayerDialog(id,3,DIALOG_STYLE_MSGBOX,"You were kicked",dstring,"Okay","");
  114.     PlayerPlaySound(id,1137,0,0,0);
  115.     SendClientMessage(playerid,COLOR_GREY,astring);
  116.     return 1;
  117. }
  118. CMD:ban(playerid,params[])
  119. {
  120.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  121.     new id, reason[68], pName[MAX_PLAYER_NAME+1],aName[MAX_PLAYER_NAME+1],string[MAX_PLAYER_NAME+1+68+MAX_PLAYER_NAME+1];
  122.     if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /ban [ID] [Reason]");
  123.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  124.     GetPlayerName(id,pName,sizeof(pName));
  125.     GetPlayerName(playerid,aName,sizeof(aName));
  126.     format(string,sizeof(string),"[ADMIN CMD] %s was banned by %s. Reason: %s",pName,aName,reason);
  127.     BanWithMessage(id,string);
  128.     new astring[MAX_PLAYER_NAME+1+68];
  129.     format(astring,sizeof(astring),"You have banned player %s",pName);
  130.     new dstring[128+1];
  131.     format(dstring,sizeof(dstring),"You were banned by %s.\nThe given reason was: %s.",aName,reason);
  132.     ShowPlayerDialog(id,3,DIALOG_STYLE_MSGBOX,"You were banned",dstring,"Okay","");
  133.     PlayerPlaySound(id,1137,0,0,0);
  134.     SendClientMessage(playerid,COLOR_GREY,astring);
  135.     return 1;
  136. }
  137. CMD:warn(playerid,params[])
  138. {  
  139.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  140.     new id, reason[68], pName[MAX_PLAYER_NAME+1],aName[MAX_PLAYER_NAME+1],string[MAX_PLAYER_NAME+1+68+MAX_PLAYER_NAME+1];
  141.     if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /warn [ID] [Reason]");
  142.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  143.     GetPlayerName(id,pName,sizeof(pName));
  144.     GetPlayerName(playerid,aName,sizeof(aName));
  145.     warns[id]++;
  146.     if(warns[id] == 1) format(string,sizeof(string),"[ADMIN CMD]%s was warned by %s for: %s (1/3)",pName,aName,reason);
  147.     if(warns[id] == 2) format(string,sizeof(string),"[ADMIN CMD]%s was warned by %s for: %s (2/3)",pName,aName,reason);
  148.     if(warns[id] == 3)
  149.     {
  150.         format(string,sizeof(string),"[ADMIN CMD]%s was warned by %s for: %s (3/3)",pName,aName,reason);
  151.         new wstring[MAX_PLAYER_NAME+1+68];
  152.         format(wstring,sizeof(wstring),"[ADMIN BOT] %s was automatically kicked for having 3 warnings!",pName);
  153.         KickWithMessage(id,wstring);
  154.     }
  155.     SendClientMessageToAll(COLOR_RED,string);
  156.     return 1;
  157. }  
  158. CMD:goto(playerid,params[])
  159. {
  160.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  161.     new id;
  162.     new Float:x,Float:y,Float:z;
  163.     if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /goto [id]");
  164.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  165.     GetPlayerPos(id,Float:x,Float:y,Float:z);
  166.     SendClientMessage(playerid,COLOR_GREY,"You have teleported!");
  167.     SetPlayerPos(playerid,Float:x,Float:y,Float:z);
  168.     return 1;
  169. }
  170. CMD:get(playerid,params[])
  171. {
  172.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  173.     new id;
  174.     new Float:x,Float:y,Float:z;
  175.     if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /get [id]");
  176.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  177.     GetPlayerPos(playerid,Float:x,Float:y,Float:z);
  178.     SendClientMessage(id,COLOR_GREY,"You have teleported!");
  179.     SetPlayerPos(id,Float:x,Float:y,Float:z);
  180.     return 1;
  181. }
  182. CMD:mute(playerid,params[])
  183. {
  184.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  185.     new id, reason[68], pName[MAX_PLAYER_NAME+1],aName[MAX_PLAYER_NAME+1],string[MAX_PLAYER_NAME+1+68+MAX_PLAYER_NAME+1];
  186.     if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /mute [ID] [Reason]");
  187.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  188.     if(muted[id] == true) return SendClientMessage(playerid,COLOR_GREY,"This player is already muted!");
  189.     GetPlayerName(playerid,aName,sizeof(aName));
  190.     GetPlayerName(id,pName,sizeof(pName));
  191.     format(string,sizeof(string),"[ADMIN CMD] %s was muted by %s. Reason: %s",pName,aName,reason);
  192.     SendClientMessageToAll(COLOR_RED,string);
  193.     SendClientMessage(id,COLOR_RED,"You are muted and cannot speak!");
  194.     SendClientMessage(playerid,COLOR_GREY,"Player muted!");
  195.     muted[id] = true;
  196.     return 1;
  197. }
  198. CMD:unmute(playerid,params[])
  199. {
  200.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  201.     new id, pName[MAX_PLAYER_NAME+1],aName[MAX_PLAYER_NAME+1],string[MAX_PLAYER_NAME+1+68+MAX_PLAYER_NAME+1];
  202.     if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /unmute [ID]");
  203.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  204.     if(muted[id] == false) return SendClientMessage(playerid,COLOR_GREY,"This player is not muted!");  
  205.     GetPlayerName(playerid,aName,sizeof(aName));
  206.     GetPlayerName(id,pName,sizeof(pName))
  207.     format(string,sizeof(string),"[ADMIN CMD] %s was unmuted by %s",pName,aName);
  208.     SendClientMessageToAll(COLOR_RED,string);
  209.     muted[id] = false;
  210.     SendClientMessage(id,COLOR_GREY,"You are unmuted!");
  211.     SendClientMessage(playerid,COLOR_GREY,"Player unmuted!");
  212.     return 1;
  213. }  
  214. CMD:slap(playerid,params[])
  215. {
  216.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  217.     new id;
  218.     if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /slap [ID]");
  219.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  220.     new Float:X,Float:Y,Float:Z;
  221.     GetPlayerPos(id,X,Y,Z);
  222.     SetPlayerPos(id,X,Y,Z+4);
  223.     PlayerPlaySound(id,1190,X,Y,Z+2);
  224.     SendClientMessage(playerid,COLOR_GREY,"Player slaped");
  225.     SendClientMessage(id,COLOR_RED,"You were slaped by an admin");
  226.     return 1;
  227. }
  228. CMD:say(playerid,params[])
  229. {
  230.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  231.     new message[128],string[128],pName[MAX_PLAYER_NAME+1];
  232.     if(sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /say [Message]");
  233.     GetPlayerName(playerid,pName,sizeof(pName));
  234.     format(string,sizeof(string),"[ADMIN]{FFFF00} %s(%i):{FF0000} %s",pName,playerid,message);
  235.     SendClientMessageToAll(COLOR_RED,string);
  236.     return 1;
  237. }
  238. CMD:spec(playerid,params[])
  239. {
  240.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  241.     new id;
  242.     if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /spec [ID]");
  243.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  244.     GetPlayerPos(playerid,posx[playerid],posy[playerid],posz[playerid]);
  245.     TogglePlayerSpectating(playerid,true);
  246.     PlayerSpectatePlayer(playerid,id);
  247.     SendClientMessage(playerid,COLOR_GREY,"Now spectating player");
  248.     spectating[playerid] = true;
  249.     return 1;
  250. }
  251. CMD:specoff(playerid,params[])
  252. {
  253.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  254.     if(spectating[playerid] == false) return SendClientMessage(playerid,COLOR_RED,"You are not spectating!");
  255.     TogglePlayerSpectating(playerid,false);
  256.     SetPlayerPos(playerid,posx[playerid],posy[playerid],posz[playerid]);
  257.     spectating[playerid] = false;
  258.     SetPlayerPos(playerid,posx[playerid],posy[playerid],posz[playerid]);
  259.     return 1;
  260. }
  261. CMD:givemoney(playerid,params[])
  262. {
  263.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  264.     new id,ammount,aName[MAX_PLAYER_NAME+1],string[126];
  265.     if(sscanf(params,"ui",id,ammount)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /givemoney [ID] [ammount]");
  266.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  267.     GetPlayerName(playerid,aName,sizeof(aName));
  268.     GivePlayerMoney(id,ammount);
  269.     format(string,sizeof(string),"[ADMIN CMD] %s has given you %i",aName,ammount);
  270.     SendClientMessage(id,COLOR_ADMIN,string);
  271.     SendClientMessage(playerid,COLOR_GREY,"The player recieved the money!");
  272.     return 1;
  273. }
  274. CMD:godmode(playerid,params[])
  275. {
  276.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  277.     if(godmode[playerid] == true)
  278.     {
  279.         SetPlayerHealth(playerid,100.0);
  280.         godmode[playerid] = false;
  281.         return SendClientMessage(playerid,COLOR_GREY,"God mode has been switched off!");
  282.     }
  283.     SetPlayerHealth(playerid,1000000000);
  284.     SendClientMessage(playerid,COLOR_GREY,"You are now in god mode!");
  285.     godmode[playerid] = true;
  286.     return 1;
  287. }
  288. CMD:id(playerid,params[])
  289. {
  290.     new id,pName[MAX_PLAYER_NAME+1],string[MAX_PLAYER_NAME+1+68];
  291.     if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /id [ID]");
  292.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
  293.     GetPlayerName(id,pName,sizeof(pName));
  294.     format(string,sizeof(string),"** %s(%i) **",pName,id);
  295.     return 1;
  296. }
  297. CMD:register(playerid,params[])
  298. {
  299.    new pass[128];
  300.    new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name));
  301.    if(sscanf(params,"s[128]",pass)) return SendClientMessage(playerid,-1,"USAGE: /register [password]");
  302.    if(BUD::IsNameRegistered(name) == true) return SendClientMessage(playerid,-1,"You're already register!");
  303.    if(strlen(pass) < MIN_CHAR || strlen(pass) > MAX_CHAR)
  304.    {
  305.       new string[128];
  306.       format(string,sizeof(string),"Password be min %d and max %d char",MIN_CHAR,MAX_CHAR);
  307.       SendClientMessage(playerid,-1,string);
  308.    }
  309.    else
  310.    {
  311.      BUD::RegisterName(name,pass);
  312.      SendClientMessage(playerid,-1,"You successfull register");
  313.      new userid = BUD::GetNameUID(name);
  314.      BUD::MultiSet(userid, "i", "Admin", 0);
  315.    }
  316.    return 1;
  317. }
  318. CMD:login(playerid,params[])
  319. {
  320.    new pass[128];
  321.    new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name));
  322.    if(sscanf(params,"s[128]",pass)) return SendClientMessage(playerid,-1,"USAGE: /login [login]");
  323.    if(GetPVarInt(playerid,"Logged") == 1) return SendClientMessage(playerid,-1,"You're already logged in");
  324.    if(BUD::IsNameRegistered(name) == false) return SendClientMessage(playerid,-1,"You're not register!");
  325.    if(strlen(pass) < MIN_CHAR || strlen(pass) > MAX_CHAR)
  326.    {
  327.       new string[128];
  328.       format(string,sizeof(string),"Password be min %d and max %d char",MIN_CHAR,MAX_CHAR);
  329.       SendClientMessage(playerid,-1,string);
  330.       return 0;
  331.    }
  332.    else
  333.    {
  334.      if(BUD::CheckAuth(name,pass) == true)
  335.      {
  336.         SendClientMessage(playerid,-1,"You successfull logged in");
  337.         SetPVarInt(playerid,"Logged",1);
  338.         new userid = BUD::GetNameUID(name);
  339.         BUD::MultiGet(userid,"i","Admin",Admin);
  340.         IsAdmin[playerid][Admin] = Admin;
  341.         return 1;
  342.      }
  343.      else
  344.      {
  345.          SendClientMessage(playerid,COLOR_RED,"Invalid password");
  346.      }
  347.    }
  348.    return 1;
  349. }
  350. CMD:a(playerid,params[])
  351. {
  352.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  353.     new message[126],pName[MAX_PLAYER_NAME+1],string[MAX_PLAYER_NAME+1+126];
  354.     if(sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /a [Message]");
  355.     GetPlayerName(playerid,pName,sizeof(pName));
  356.     format(string,sizeof(string),"[ADMIN CHAT] %s: %s",pName,message);
  357.     for(new i = 0; i < MAX_PLAYERS; i++)
  358.     {
  359.         if(!IsPlayerConnected(i)) continue;
  360.         if(IsAdmin[i][Admin] == 1) return SendClientMessage(i,COLOR_RED,string);
  361.     }
  362.     return 1;
  363. }
  364. CMD:sethealth(playerid,params[])
  365. {
  366.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  367.     new id,health;
  368.     if(sscanf(params,"uu",id,health)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /sethealth [ID] [Health]");
  369.     SetPlayerHealth(id,health);
  370.     SendClientMessage(playerid,COLOR_GREY,"Players health has been set");
  371.     SendClientMessage(id,COLOR_RED,"An admin has changed your health level");
  372.     return 1;
  373. }
  374. CMD:setarmour(playerid,params[])
  375. {
  376.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  377.     new id,health;
  378.     if(sscanf(params,"uu",id,health)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /setarmour [ID] [Health]");
  379.     SetPlayerArmour(id,health);
  380.     SendClientMessage(playerid,COLOR_GREY,"Players armour has been set");
  381.     SendClientMessage(id,COLOR_RED,"An admin has changed your armour level");
  382.     return 1;
  383. }
  384.  
  385. CMD:acmds(playerid,params[])
  386. {
  387.     if(IsAdmin[playerid][Admin] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not admin!");
  388.  
  389.     SendClientMessage(playerid,COLOR_GREY,"/kick [ID] [Reason] To kick a player from the server");
  390.     SendClientMessage(playerid,COLOR_GREY,"/ban [ID] [Reason] Bans a player from the server");
  391.     SendClientMessage(playerid,COLOR_GREY,"/warn [ID] [Reason] Warns a player, players are kicked after 3 warnings");
  392.     SendClientMessage(playerid,COLOR_GREY,"/goto [ID] Teleports you to a selected player");
  393.     SendClientMessage(playerid,COLOR_GREY,"/get [ID] Teleports the player to you");
  394.     SendClientMessage(playerid,COLOR_GREY,"/mute [ID] [Reason] Mutes a player from the chat with a reason");
  395.     SendClientMessage(playerid,COLOR_GREY,"/unmute [ID] Unmutes the player");
  396.     SendClientMessage(playerid,COLOR_GREY,"/slap [ID] Will slap a player on the Z axis. Will also slap a player out of a car");
  397.     SendClientMessage(playerid,COLOR_GREY,"/say [Message] Shows a message to all players");
  398.     SendClientMessage(playerid,COLOR_GREY,"/spec [ID] Spectates the selected player");
  399.     SendClientMessage(playerid,COLOR_GREY,"/specoff Stops you spectating");
  400.     SendClientMessage(playerid,COLOR_GREY,"/givemoney [ID] [Ammount] Gives the player a certain amount of money");
  401.     SendClientMessage(playerid,COLOR_GREY,"/godmode Toggles your godmode on and off");
  402.     SendClientMessage(playerid,COLOR_GREY,"/a [Message] Admin chat, players cannont see this only admin");
  403.     SendClientMessage(playerid,COLOR_GREY,"/sethealth [ID] [Health] Sets a players health, 1000000 will make them godmode");
  404.     SendClientMessage(playerid,COLOR_GREY,"/setarmour [ID] [Armour] Sets the players armour level");
  405.     SendClientMessage(playerid,COLOR_GREY,"/acmds shows this list");
  406.    
  407.     return 1;
  408. }
  409. CMD:credits(playerid,params[])
  410. {
  411.     SendClientMessage(playerid,COLOR_YELLOW,"Admin Scripts made by - lewis1682");
  412.     return 1;
  413. }
  414. public OnPlayerRequestClass(playerid, classid)
  415. {
  416.     return 1;
  417. }
  418.  
  419. public OnPlayerConnect(playerid)
  420. {
  421.     new pName[MAX_PLAYER_NAME+1], string[MAX_PLAYER_NAME+1+128];
  422.     GetPlayerName(playerid,pName,sizeof(pName));
  423.     format(string,sizeof(string),"** %s has joined the server **",pName);
  424.     SendClientMessageToAll(COLOR_GREY,string);
  425.     warns[playerid] = 0;
  426.     muted[playerid] = false;
  427.     spectating[playerid] = false;
  428.     godmode[playerid] = false;
  429.     //loading
  430.     SetPVarInt(playerid,"Logged",0);
  431.     if(BUD::IsNameRegistered(pName) == false)
  432.     {
  433.          SendClientMessage(playerid,COLOR_RED,"You are not register.! please use /register");
  434.     }
  435.     else
  436.     {
  437.          SendClientMessage(playerid,COLOR_RED,"You are register.! please use /login");
  438.     }
  439.     return 1;
  440. }
  441.  
  442. public OnPlayerDisconnect(playerid, reason)
  443. {
  444.     new pName[MAX_PLAYER_NAME+1],string[MAX_PLAYER_NAME+1+128];
  445.     GetPlayerName(playerid,pName,sizeof(pName));
  446.     switch(reason)
  447.     {
  448.         case 0: format(string,sizeof(string),"** %s has left the server (Timeout) **",pName);
  449.         case 1: format(string,sizeof(string),"** %s has left the server (Leaving) **",pName);
  450.         case 2: format(string,sizeof(string),"** %s has left the server (Kicked) **",pName);       
  451.     }
  452.     //saving
  453.     if(BUD::IsNameRegistered(pName) == true)
  454.     {
  455.     new userid = BUD::GetNameUID(pName);
  456.     BUD::MultiSet(userid,"i","Admin",IsAdmin[playerid][Admin]);
  457.     }
  458.     //other
  459.     warns[playerid] = 0;
  460.     muted[playerid] = false;
  461.     spectating[playerid] = false;
  462.     godmode[playerid] = false;
  463.     SetPVarInt(playerid,"Logged",0);
  464.     return 1;
  465. }
  466.  
  467. public OnPlayerSpawn(playerid)
  468. {
  469.     return 1;
  470. }
  471.  
  472. public OnPlayerDeath(playerid, killerid, reason)
  473. {
  474.     return 1;
  475. }
  476.  
  477. public OnVehicleSpawn(vehicleid)
  478. {
  479.     return 1;
  480. }
  481.  
  482. public OnVehicleDeath(vehicleid, killerid)
  483. {
  484.     return 1;
  485. }
  486.  
  487. public OnPlayerText(playerid, text[])
  488. {
  489.     if(muted[playerid] == true)
  490.     {
  491.         SendClientMessage(playerid,COLOR_RED,"You are muted and cannot speak in the main chat!");
  492.         return 0;
  493.     }
  494.     return 1;
  495. }
  496.  
  497. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  498. {
  499.     if(IsAdmin[playerid][Admin] == 0) return 0;
  500.     SetPlayerPosFindZ(playerid, fX, fY, fZ);
  501.     return 1;
  502. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement