jlalt

shoot

Aug 11th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.13 KB | None | 0 0
  1. CMD:tmduelcount(playerid,params[]) {
  2.     if(PlayerInfo[playerid][TM] >= 6) {
  3.         new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
  4.         if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp) || !IsNumeric(tmp2)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /tmduelcount [player1 id] [player2 id]");
  5.  
  6.         new player1 = strval(tmp), player2 = strval(tmp2), string[128], annostring[128];
  7.         if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
  8.             if(IsPlayerConnected(player2) && player2 != INVALID_PLAYER_ID) {
  9.  
  10.                 if(PlayerInfo[player1][TM] == 0) {
  11.                     format(string,sizeof(string),"ERROR: Player %s isn't [TM] member.", pName(player1)); return SendClientMessage(playerid,0xFF0000FF,string);
  12.                 }
  13.  
  14.                 if(PlayerInfo[player2][TM] == 0) {
  15.                     format(string,sizeof(string),"ERROR: Player %s isn't [TM] member.", pName(player2)); return SendClientMessage(playerid,0xFF0000FF,string);
  16.                 }
  17.                 CMDMessageToTM(playerid,"TMDUELCOUNT");
  18.                 format(annostring, sizeof(annostring), "~b~%s ~r~vs ~b~%s", pName(player1), pName(player2));
  19.                 for(new i = 0; i < MAX_PLAYERS; i++) if(PlayerInfo[i][TM]) {
  20.                     GameTextForPlayer(i, annostring, 4000, 3);
  21.                 }
  22.                 cdt[player1] = 6;
  23.                 SetTimerEx("Duel",1000,0,"dd", player1, player2);
  24.  
  25.                 if(PlayerInfo[playerid][TM] == 1)
  26.                 format(string, sizeof(string), "{414141}[TM] | {FFFFFF}\"%s\" {FFFF00}has activated countdown between {800000}\"%s\" {FFFF00}and {800000}\"%s\" !", pName(playerid), pName(player1), pName(player2) );
  27.                 return 1;
  28.             } else return SendClientMessage(playerid, 0xFF0000FF, "Player2 is not connected.");
  29.         } else return SendClientMessage(playerid, 0xFF0000FF, "Player1 is not connected.");
  30.     } else return ShowPlayerDialog(playerid, 40, DIALOG_STYLE_MSGBOX, "{ff0000}ERROR", "{ffff00}You need to be atleast{414141} [TM] - The Mafia {ffff00}rank 6 to use this command!", "Close", "");
  31. }
Add Comment
Please, Sign In to add comment