jlalt

KFCount

Mar 27th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 KB | None | 0 0
  1. #define KFMCOUNT 5
  2. new KFCount = KFMCOUNT;
  3. CMD:kfcount(playerid,params[]) {
  4.    if(PlayerInfo[playerid][KF] >= 7) {
  5.       SetTimer("KFCount1", 1000, 0);
  6.       return 1;
  7.    } else return SendClientMessage(playerid, red,"ERROR: You need to be KF member rank 7 to use this command");
  8. }
  9.  
  10. forward public KFCount1();
  11. public KFCount1() {
  12.    if(KFCount > 0) {
  13.      for(new i = 0; i < MAX_PLAYERS; i++) {
  14.          if(IsPlayerConnected(i) && PlayerInfo[i][KF] > 0) {
  15.              new string[10];
  16.              format(string,sizeof string,"~w~%d",KFCount);
  17.              GameTextForPlayer(i, string, 1000, 6);
  18.              TogglePlayerControllable(i, 0);
  19.          }
  20.      }
  21.      KFCount --;
  22.      SetTimer("KFCount1", 1000, 0);
  23.      return 1;
  24.    }
  25.    else if(KFCount <= 0) {
  26.       for(new i = 0; i < MAX_PLAYERS; i++) {
  27.           if(IsPlayerConnected(i) && PlayerInfo[i][KF] > 0) {
  28.             GameTextForPlayer(i,"~r~GO GO GO", 3000, 6);
  29.             TogglePlayerControllable(i, 1);
  30.           }
  31.       }
  32.    }
  33.    KFCount = 5;
  34.    return 1;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment