Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:tmduelcount(playerid,params[]) {
- if(PlayerInfo[playerid][TM] >= 6) {
- new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
- if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp) || !IsNumeric(tmp2)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /tmduelcount [player1 id] [player2 id]");
- new player1 = strval(tmp), player2 = strval(tmp2), string[128], annostring[128];
- if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
- if(IsPlayerConnected(player2) && player2 != INVALID_PLAYER_ID) {
- if(PlayerInfo[player1][TM] == 0) {
- format(string,sizeof(string),"ERROR: Player %s isn't [TM] member.", pName(player1)); return SendClientMessage(playerid,0xFF0000FF,string);
- }
- if(PlayerInfo[player2][TM] == 0) {
- format(string,sizeof(string),"ERROR: Player %s isn't [TM] member.", pName(player2)); return SendClientMessage(playerid,0xFF0000FF,string);
- }
- CMDMessageToTM(playerid,"TMDUELCOUNT");
- format(annostring, sizeof(annostring), "~b~%s ~r~vs ~b~%s", pName(player1), pName(player2));
- for(new i = 0; i < MAX_PLAYERS; i++) if(PlayerInfo[i][TM]) {
- GameTextForPlayer(i, annostring, 4000, 3);
- }
- cdt[player1] = 6;
- SetTimerEx("Duel",1000,0,"dd", player1, player2);
- if(PlayerInfo[playerid][TM] == 1)
- 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) );
- return 1;
- } else return SendClientMessage(playerid, 0xFF0000FF, "Player2 is not connected.");
- } else return SendClientMessage(playerid, 0xFF0000FF, "Player1 is not connected.");
- } 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", "");
- }
Add Comment
Please, Sign In to add comment