#1

Can someone please can make this script to use for dcmd?

pawn Код:
new cmd[128],idx;

    cmd = strtok(cmdtext, idx);
    if(!strcmp("/duel", cmd, true))
    {
        new id,tmp[3][80],w1,w2,string[128];

        tmp[0] = strtok(cmdtext, idx);
        tmp[1] = strtok(cmdtext, idx);
        tmp[2] = strtok(cmdtext, idx);
       
        id = strval(tmp[0]);
        w1 = strval(tmp[1]);
        w2 = strval(tmp[2]);
       
        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(!IsValidWeapon(w1) || !IsValidWeapon(w2))
            return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : Use Valids Weapons IDs");
           
        if(!strlen(tmp[1]) || !strlen(tmp[2]))
            return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : Use /duel [id] [wep1] [wep2]");
           
        if(!strlen(tmp[0]))
            return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : You must enter the ID of the player following the Way (/duel [playerid])");

        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[24];
        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);
        IdDuel[id] = playerid;
        wep1[id] = w1;
        wep2[id] = w2;
        SetTimerEx("ExpireDuel",15000,false,"ii",id,playerid);
        return true;
    }
    return false;
}
Reply
#2

Wrong section.

https://sampforum.blast.hk/showthread.php?tid=187229

Thats a Bigger thing to do. Use that post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)