Duel command problem
#6

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_CHOOSE_WEAPON:
        {
            if !
response *then return true;
            switch(
listitem)
            {
                case 
0gCurrentDuelWeaponID 24;
                case 
1..3gCurrentDuelWeaponID 25+listitem;
                case 
4gCurrentDuelWeaponID 31;
                case 
5gCurrentDuelWeaponID 25;
                
            }
             
format(strsizeof(str), ""RED"[DUEL] "LIGHTBLUE"%s(%d) has challenged you for a duel with "PREMIUM"%s"LIGHTBLUE"! (Use /accept or /deny)"GetName(playerid), playeridgetWeaponName(.id=gCurrentDuelWeaponID));
            
SendClientMessage(PlayerInfo[playerid][DuelTargetID], -1str);
            
PlayerInfo[PlayerInfo[playerid][DuelTargetID]][IsWaiting] = 1;
        }
    }
    return 
true;
}
getWeaponName(id)
{
    new 
str[15];
    switch(
id)
    {
        case 
24str "Desert Eagle";
        case 
25str "Shotgun";
        case 
26str "Sawn Off";
        case 
27str "Combat Shotgun";
        case 
28str "Micro SMG/UZI";
        case 
31str "M4";
    }
    return 
str;
}
CMD:duel (playeridparams[])
{
    if 
gIsDuelActive == *then return SendClientMessage(playerid, -1""RED"ERROR: "GREY"A duel is already active!");
    if 
PlayerInfo[playerid][IsInDuel] == *then return SendClientMessage(playerid, -1""RED"ERROR: "GREY"You are already in a duel!");
    if 
sscanf(params"u"params[0]) *then return SendClientMessage(playerid, -1""RED"USAGE: "WHITE"/duel [ID]");
    if 
params[0] == INVALID_PLAYER_ID *then return SendClientMessage(playerid, -1""RED"ERROR: "GREY"Invalid player ID!");
    if 
PlayerInfo[params[0]][NoDuelRequests] == *then return SendClientMessage(playerid, -1""RED"ERROR: "GREY"The player has duel requests disabled!");
    if 
PlayerInfo[params[0]][IsWaiting] == *then return SendClientMessage(playerid, -1""RED"ERROR: "GREY"The player is waiting for another duel!");
    
PlayerInfo[playerid][IsWaiting] = 1;
    
PlayerInfo[playerid][DuelTargetID] = params[0];
    
ShowPlayerDialog(playeridDIALOG_CHOOSE_WEAPONDIALOG_STYLE_LIST""PREMIUM"Choose weapon for duel:""• Desert Eagle\n• Sawn Off Shotgun\n• Combat Shotgun\n• Micro SMG/Uzi\n• M4\n• Shotgun""Select""Cancel");
    return 
1;

Reply


Messages In This Thread
Duel command problem - by SyntaxQ - 24.05.2014, 04:21
Re: Duel command problem - by Stinged - 24.05.2014, 05:00
Re: Duel command problem - by SyntaxQ - 24.05.2014, 05:17
Re: Duel command problem - by JM_Millers - 24.05.2014, 05:26
Re: Duel command problem - by JM_Millers - 24.05.2014, 05:31
Re: Duel command problem - by JM_Millers - 24.05.2014, 05:43
Re: Duel command problem - by SyntaxQ - 24.05.2014, 05:55
Re: Duel command problem - by JM_Millers - 24.05.2014, 06:00
Re: Duel command problem - by JM_Millers - 24.05.2014, 06:03
Re: Duel command problem - by Threshold - 24.05.2014, 06:05

Forum Jump:


Users browsing this thread: 3 Guest(s)