Make Commands Without Sccanf
#1

pawn Код:
dcmd_duel(playerid, params[])
{
        new
            giveplayerid,
                weapon[128],
                price;
        new string[256];
        new sendername[MAX_PLAYER_NAME];
        new giveplayername[MAX_PLAYER_NAME];
        if (sscanf(params, "isi", giveplayerid,weapon,price))
        {
                SendClientMessage(playerid, COLOR_YELLOW, "[VT ERROR] Right Usage: /dual [playerid] [weapon] [amount]");
                SendClientMessage(playerid, COLOR_YELLOW, "Duel weapons: deagle, mp5, chainsaw, silpist, combatsg, shotgun");
                return 1;
        }
        else
        {
            if(playerid != giveplayerid)
            {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
                    if(strcmp("deagle", weapon, true, 6) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 24;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 24;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 24;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 24;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("mp5", weapon, true, 3) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 29;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 29;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 29;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 29;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("chainsaw", weapon, true, 8) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 9;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 9;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 9;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 9;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("silpist", weapon, true, 7) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 23;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 23;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 23;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 23;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("combatsg", weapon, true, 8) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 27;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 27;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 27;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 27;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("shotgun", weapon, true, 7) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 25;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 25;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 25;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 25;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no duel rooms free, wait till a duel ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a duel");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a duel, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the duel fee");
                    }
                    else return SendClientMessage(playerid, COLOR_YELLOW, "Right Usage: /duel [playerid] [weapon] [amount]");
                }
                else return SendClientMessage(playerid, RED, "You cant duel yourself");
        }
}






how to make this command without sscanf ?

pawn Код:
if (sscanf(params, "isi", giveplayerid,weapon,price))
Reply
#2

Quote:
Originally Posted by Aloushi
Посмотреть сообщение
pawn Код:
dcmd_duel(playerid, params[])
{
        new
            giveplayerid,
                weapon[128],
                price;
        new string[256];
        new sendername[MAX_PLAYER_NAME];
        new giveplayername[MAX_PLAYER_NAME];
        if (sscanf(params, "isi", giveplayerid,weapon,price))
        {
                SendClientMessage(playerid, COLOR_YELLOW, "[VT ERROR] Right Usage: /dual [playerid] [weapon] [amount]");
                SendClientMessage(playerid, COLOR_YELLOW, "Duel weapons: deagle, mp5, chainsaw, silpist, combatsg, shotgun");
                return 1;
        }
        else
        {
            if(playerid != giveplayerid)
            {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
                    if(strcmp("deagle", weapon, true, 6) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 24;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 24;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 24;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 24;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("mp5", weapon, true, 3) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 29;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 29;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 29;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 29;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("chainsaw", weapon, true, 8) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 9;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 9;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 9;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 9;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("silpist", weapon, true, 7) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 23;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 23;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 23;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 23;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("combatsg", weapon, true, 8) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 27;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 27;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 27;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 27;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no dual rooms free, wait till a dual ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a dual");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a dual, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the dual fee");
                }
                    if(strcmp("shotgun", weapon, true, 7) == 0)
                {
                    if(GetPlayerMoney(playerid) >= price)
                    {
                        if(Inventation[giveplayerid] == -1)
                        {
                            if(InventationSent[playerid] == -1)
                            {
                                    if(InDual[playerid] == 0)
                                    {
                                        if(InDual[giveplayerid] == 0)
                                        {
                                                    if(DualRoom1 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        Inventationprice[giveplayerid] = price;
                                                        DualRoom1price = price;
                                                        DualRoom1 = playerid;
                                                        WeaponDualRoom1 = 25;
                                                        return 1;
                                                    }
                                                    else if(DualRoom2 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom2price = price;
                                                        DualRoom2 = playerid;
                                                        WeaponDualRoom2 = 25;
                                                        return 1;
                                                    }
                                                    else if(DualRoom3 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom3price = price;
                                                        DualRoom3 = playerid;
                                                        WeaponDualRoom3 = 25;
                                                        return 1;
                                                    }
                                                    else if(DualRoom4 == -1)
                                                    {
                                                        SetTimerEx("inventationremove", 30000, 0, "i", playerid);
                                                        format(string, sizeof(string), "%s has sent you a 1 vs. 1 duel with a desert eagle for $%d, /acceptduel or /declineduel", sendername, price);
                                                        SendClientMessage(giveplayerid, GREEN, string);
                                                        format(string, sizeof(string), "you sent %s a 1 vs. 1 duel with a desert eagle for $%d", giveplayername, price);
                                                        SendClientMessage(playerid, GREEN, string);
                                                        InventationSent[playerid] = giveplayerid;
                                                        Inventation[giveplayerid] = playerid;
                                                        DualRoom4price = price;
                                                        DualRoom4 = playerid;
                                                        WeaponDualRoom4 = 25;
                                                        return 1;
                                                    }
                                                    else return SendClientMessage(playerid, RED, "there are no duel rooms free, wait till a duel ends");
                                                                }
                                                                else return SendClientMessage(playerid, RED, "This player is already in a duel");
                                                        }
                                                        else return SendClientMessage(playerid, RED, "you are still in a duel, end it first");
                                                }
                                                else return SendClientMessage(playerid, RED, "You already sent an inventation, wait 30 seconds or wait till the other player declines");
                                        }
                                        else return SendClientMessage(playerid, RED, "This player already got an inventation");
                    }
                    else return SendClientMessage(playerid, RED, "You can't afford the duel fee");
                    }
                    else return SendClientMessage(playerid, COLOR_YELLOW, "Right Usage: /duel [playerid] [weapon] [amount]");
                }
                else return SendClientMessage(playerid, RED, "You cant duel yourself");
        }
}






how to make this command without sscanf ?

pawn Код:
if (sscanf(params, "isi", giveplayerid,weapon,price))
I dont recommend it... You would need shietloads of snippets/functions and the script will be 100x larger than with sscanf it would. Besides, why would you want to do that?
Reply
#3

I'm never use sscanf to my GM i need to make it without sscanf
Reply
#4

your gamemode seems a gf, using dcmd which is slow as fuck. and now, wanting to not use sscanf... just start looking for strok.(slow as fuck aswell.)
Reply
#5

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
your gamemode seems a gf, using dcmd which is slow as fuck. and now, wanting to not use sscanf... just start looking for strok.(slow as fuck aswell.)
first of all i need a help not a comment of your idea
Reply
#6

I personaly suggest just to go with sscanf and zcmd, they both seem to run fast with me then any other function, but its your choice.
Reply
#7

Quote:
Originally Posted by Socan
Посмотреть сообщение
I personaly suggest just to go with sscanf and zcmd, they both seem to run fast with me then any other function, but its your choice.
yeah i know sscanf and zcmd good but i need this command without sscanf or zcmd thanks my choice
Reply
#8

Dude, just include sscanf, and use it. You don't need to convert everything, just start to use it now, and honestly, only a low ammount of people here, remembers(Or ever knew) how to use, like my case, i started with sscanf....

It's not hard at all to #include <sscanf2> and add it to plugins.
Reply
#9

Quote:
Originally Posted by ricardo178
Посмотреть сообщение
Dude, just include sscanf, and use it. You don't need to convert everything, just start to use it now, and honestly, only a low ammount of people here, remembers(Or ever knew) how to use, like my case, i started with sscanf....

It's not hard at all to #include <sscanf2> and add it to plugins.
man im not noob scripter i know but i use it in admin system only and i want to add duel system to GM because my GM without sscanf2 i hit it i need my GM work fine without Sccanf Plugin
Reply
#10

My own opinion is sscanf is much fast then any other method (if there is), and server owner's will like to get their server's work in the best shape and best performance.

Just use sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)