2021-03-12, 08:42 AM
PHP Code:
CMD:duel(playerid, params[]) {
? ? ? ? new string[128], id;
? ? ? ? if(InvitedDuel[playerid] == true) return SendClientMessage(playerid,0xF41917AA,"??[DUEL]?? : Have you invited someone, wait Expire Invitation");
? ? ? ? if(UsingArena == true) return SendClientMessage(playerid,0xF41917AA,"??[DUEL]?? : At the time the Arena is Being Used");
? ? ? ? if(sscanf(params, "r", id)) return SendClientMessage(playerid,0xF41917AA,"??[DUEL]?? : You must enter the ID of the player following the Way (/duel [playerid])");
? ? ? ? if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xF41917AA,"??[DUEL]?? : This player not connected.");
? ? ? ? if(id == playerid) return SendClientMessage(playerid,0xF41917AA,"??[DUEL]?? : You can not invite the Self");
? ? ? ? if(InvitedDuel[id] == true) return SendClientMessage(playerid,0xF41917AA,"??[DUEL]?? : Currently the player is in a Duel, wait..");
? ? ? ? new name[MAX_PLAYER_NAME];
? ? ? ? GetPlayerName(playerid, name, sizeof(name));
? ? ? ? format(string, sizeof(string), "??[DUEL]?? : %s This inviting you to a \n Duel Runing (Press Accept to Accept Duel)",name);
? ? ? ? ShowPlayerDialog(id,DIALOG_DUEL,DIALOG_STYLE_MSGBOX,"??[DUEL]?? :",string,"Accept", "No");
? ? ? ? GameTextForPlayer(id,"~r~DUE~w~LO !", 2500, 3);
? ? ? ? InvitedDuel[id] = true;
? ? ? ? IdDuel[id] = playerid;
? ? ? ? SetTimerEx("ExpireDuel",15000,false,"ii",id,playerid);
? ? ? ? return 1;
}