Author Topic: warn command  (Read 2804 times)

0 Members and 1 Guest are viewing this topic.

Pain

  • Guest
warn command
« on: March 23, 2013, 06:59:01 am »
first:
[pawn]new warn[MAX_PLAYERS] = 0;[/pawn]
OnPlayerDisconnect:
[pawn]warn[playerid] = 0;[/pawn]
OnPlayerCommandText:
[pawn]   if (strcmp(cmd, "warn", true) == 0){
      if (IsPlayerAdmin(playerid)) {
         tmp = strtok(cmdtext, idx);
         newvar = FindPlayerIDFromString(tmp);
         if (!strlen(tmp)) {
            SendClientMessage(playerid, COLOR_GREEN, "USAGE: /c warn <name/id>");
         } else {
            if (newvar != INACTIVE_PLAYER_ID) {
               GameTextForPlayer(newvar,"~y~Admin warned you!");
               format(szMsg,sizeof(szMsg),"Admin [ %s ] warned [%i] %s!",gPlayers[playerid],newvar,gPlayers[newvar]);
               SendClientMessageToAll(COLOR_GREEN, szMsg);
               warn[newvar]++;
               if (warn[newvar] >= 3) {
                  Kick(newvar);
                  warn[newvar] = 0;
               }
            }
         }
      } else {
           SendClientMessage(playerid, COLOR_GREEN, " You have not access to use the command!");
        }
   return 1;[/pawn]
hope you like

Offline Doom

  • Made Man
  • ***
  • Posts: 105
    • View Profile
Re: warn command
« Reply #1 on: March 23, 2013, 07:03:36 am »
Very nice  as a starter ;) Good job

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: warn command
« Reply #2 on: March 23, 2013, 02:35:25 pm »
Nice Man, Good Job  ;D

Offline Fire_Head

  • Street Thug
  • *
  • Posts: 35
    • View Profile
Re: warn command
« Reply #3 on: March 23, 2013, 09:36:09 pm »
Nice Try :)