Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.51 KB | None | 0 0
  1.     if(strcmp(cmd, "/declareawesome", true) == 0)
  2.     {
  3.         if(IsPlayerConnected(playerid))
  4.         {
  5.             tmp = strtok(cmdtext, idx);
  6.             if(!strlen(tmp))
  7.             {
  8.                 SendClientMessage(playerid, COLOR_WHITE, "USAGE: /declareawesome [playerid/PartOfName] [reason]");
  9.                 return 1;
  10.             }
  11.             giveplayerid = ReturnUser(tmp);
  12.             if(IsPlayerNPC(giveplayerid)) return 1;
  13.             if(PlayerInfo[playerid][pAdmin] >= 2)
  14.             {
  15.                 if(IsPlayerConnected(giveplayerid))
  16.                 {
  17.                     if(giveplayerid != INVALID_PLAYER_ID)
  18.                     {
  19.                         GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  20.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  21.                         new length = strlen(cmdtext);
  22.                         while ((idx < length) && (cmdtext[idx] <= ' '))
  23.                         {
  24.                             idx++;
  25.                         }
  26.                         new offset = idx;
  27.                         new result[96];
  28.                         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  29.                         {
  30.                             result[idx - offset] = cmdtext[idx];
  31.                             idx++;
  32.                         }
  33.                         result[idx - offset] = EOS;
  34.                         if(!strlen(result))
  35.                         {
  36.                             SendClientMessage(playerid, COLOR_WHITE, "USAGE: /declareawesome [playerid/PartOfName] [reason]");
  37.                             return 1;
  38.                            
  39.                             GetPlayerIp(playerid, IP, sizeof(IP));
  40.                             format(logstring, sizeof(logstring), "%s [%d/%d/%d] Name: %s Key: %s Reason: Spam.", IP, day, month, year,sendername,PlayerInfo[playerid][pKey]);
  41.                             BanLog(logstring);
  42.                             format(string, sizeof(string), "AdmCmd: %s was banned, reason: Spam.", sendername);
  43.                             SendClientMessageToAll(COLOR_LIGHTRED, string);
  44.                             PlayerInfo[playerid][pBand] = 3;
  45.                             PlayerInfo[playerid][pPermBand] = 1;
  46.                             BanEx(playerid, "Banned By: Autoban Reason: Spam");
  47.                            
  48.                             return 1;
  49.                         }
  50.                         if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
  51.                         {
  52.                             GetPlayerIp(playerid, IP, sizeof(IP));
  53.                             format(logstring, sizeof(logstring), "%s [%d/%d/%d] Name: %s Key: %s Reason: no awesome mang.", IP, day, month, year,sendername,PlayerInfo[playerid][pKey]);
  54.                             BanLog(logstring);
  55.                             format(string, sizeof(string), "AdmCmd: %s is Awesome, reason: Attempting to make another admin Awesome.", sendername);
  56.                             SendClientMessageToAll(COLOR_LIGHTRED, string);
  57.                             PlayerInfo[playerid][pBand] = 3;
  58.                             PlayerInfo[playerid][pPermBand] = 1;
  59.                             BanEx(playerid, "LOOOOL BRIAN WRIGHT IS COOL GUY!");
  60.                            
  61.                             return 1;
  62.                         }
  63.                         GetPlayerIp(giveplayerid, IP, sizeof(IP));
  64.                         format(logstring, sizeof(logstring), "%s [%d/%d/%d] Name: %s Key: %s is cool mang: %s Reason: %s", IP, day, month, year,giveplayer,PlayerInfo[giveplayerid][pKey], sendername, (result));
  65.                         BanLog(logstring);
  66.                         format(string, sizeof(string), "AdmCmd: %s was trolled by %s, reason: %s", giveplayer, sendername, (result));
  67.                         SendClientMessageToAll(COLOR_LIGHTRED, string);
  68.                         PlayerInfo[giveplayerid][pBand] = 3;
  69.                         format(banstring, sizeof(banstring), "lol By: %s Reason: %s", sendername, (result)); //modified
  70.                         BanEx(giveplayerid, banstring); //modified
  71.                         UseAdmCmdTimer[playerid]++;
  72.                         SetTimerEx("UseAdmCmd",3*1000,0,"i",playerid); //3 seconds
  73.                         return 1;
  74.                     }
  75.                 }
  76.                 else
  77.                 {
  78.                     format(string, sizeof(string), "   %d is not an active player !", giveplayerid);
  79.                     SendClientMessage(playerid, COLOR_GRAD1, string);
  80.                 }
  81.             }
  82.             else
  83.             {
  84.                 SendClientMessage(playerid, COLOR_GRAD2, "   You are not authorized to use that command !");
  85.             }
  86.         }
  87.         return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement