Guest User

Untitled

a guest
Jun 29th, 2014
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.02 KB | None | 0 0
  1. if(strcmp(cmd, "/makeleader", true) == 0)
  2.     {
  3.         if(IsPlayerConnected(playerid))
  4.         {
  5.             tmp = strtok(cmdtext, idx);
  6.             if(!strlen(tmp))
  7.             {
  8.                 SyntaxMessage(playerid, "/makeleader [playerid/name] [number]");
  9.                 return 1;
  10.             }
  11.             new para1;
  12.             para1 = ReturnUser(tmp);
  13.             if(IsPlayerNPC(para1)) return 1;
  14.             tmp = strtok(cmdtext, idx);
  15.             if(!strlen(tmp))
  16.             {
  17.                 SyntaxMessage(playerid, "/makeleader [playerid/name] [number]");
  18.                 return 1;
  19.             }
  20.             new faction;
  21.             faction = strval(tmp);
  22.             if(faction < 0 || faction > MAX_FACTIONS) { format(string, sizeof(string), "Faction ID can't be below 0 or above %d.", MAX_FACTIONS); SendClientMessage(playerid, GREY, string); return 1; }
  23.             if(faction != 0 && !FactionInfo[faction][FactionExists]) return SendClientMessage(playerid, GREY, "Invalid faction ID.");
  24.             if(PlayerInfo[playerid][pAdmin] >= 99999 || PlayerInfo[playerid][pFactionMod] > 0)
  25.             {
  26.                 if(IsPlayerConnected(para1))
  27.                 {
  28.                     if(para1 != INVALID_PLAYER_ID)
  29.                     {
  30.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  31.                         GetPlayerName(para1, giveplayer, sizeof(giveplayer));
  32.                         PlayerInfo[para1][pRank] = (faction) ? (6) : (0);
  33.                         MakeLeaderOf(para1, faction);
  34.                         format(string, sizeof(string), "WARNING :- You have given %s the leadership-badge of the %s orgnizaiton.", giveplayer,FactionInfo[faction][FactionName]);
  35.                         SendClientMessage(playerid, LIGHTBLUE, string);
  36.                         format(string, sizeof(string), "WARNING :- Adminstrator %s has given you the leadership-badge of the %s orgnization.",sendername,FactionInfo[faction][FactionName]);
  37.                         SendClientMessage(para1, COLOR_LIGHTRED, string);
  38.                         PlayerInfo[para1][pLeader] = faction;
  39.                         PlayerInfo[para1][pMember] = faction;
  40.                         PlayerInfo[para1][pDivision] = 0;
  41.                         SetPlayerToTeamColor(para1);
  42.                         OnPlayerSave(para1);
  43.                     }
  44.                 }
  45.             }
  46.             else
  47.             {
  48.                 SendClientMessage(playerid, GREY, "    You are not authorized to use that command.");
  49.             }
  50.         }
  51.         return 1;
  52.     }
Advertisement
Add Comment
Please, Sign In to add comment