[Ajuda] duelo
#1

pawn Код:
CMD:duel(playerid,params[])
{
    new dueloid,String[150];

    if(sscanf(params,"d",dueloid)) return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");
    if(dueloid > 1 || dueloid < 2) return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");

    switch(dueloid)
    {
        case 1:
        {
            GivePlayerWeapon(playerid,27,9999);
            GivePlayerWeapon(playerid,33,9999);
        }
        case 2:
        {
            GivePlayerWeapon(playerid,31,9999);
            GivePlayerWeapon(playerid,25,9999);
        }
    }
    return 1;
}
quando digito /duel 1 ou 2 fala SERVER: Unknow Command.
Reply
#2

pawn Код:
CMD:duel(playerid,params[])
{
    new dueloid,String[150];

    if(sscanf(params,"i",dueloid)) return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");
    if(dueloid > 1 || dueloid < 2) return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");

    switch(dueloid)
    {
        case 1:
        {
            GivePlayerWeapon(playerid,27,9999);
            GivePlayerWeapon(playerid,33,9999);
        }
        case 2:
        {
            GivePlayerWeapon(playerid,31,9999);
            GivePlayerWeapon(playerid,25,9999);
        }
    }
    return 1;
}
Reply
#3

jб tentei com "i" nгo foi ..
Reply
#4

pawn Код:
CMD:duel(playerid, params[])
{
    new dueloid, String[150];
    if(sscanf(params,"i", dueloid)) return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");
    if(dueloid > 1 || dueloid < 2) return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");

    switch(dueloid)
    {
        case 1:
        {
            GivePlayerWeapon(playerid,27,9999);
            GivePlayerWeapon(playerid,33,9999);
            return 1;
        }
        case 2:
        {
            GivePlayerWeapon(playerid,31,9999);
            GivePlayerWeapon(playerid,25,9999);
            return 1;
        }
    }
    return 1;
}
Se nгo der, verifica seu sscanf tambйm.
Reply
#5

oq vc mudou? nгo vi nada ai..
Reply
#6

Tenta isto:

pawn Код:
CMD:duel(playerid,params[])
{
    new dueloid, aname[MAX_PLAYER_NAME];
    if(sscanf(params,"d",dueloid)) return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");
    if(dueloid > 2 || dueloid < 1) return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");
    GetPlayerName(playerid, aname, sizeof(aname));

    switch(dueloid)
    {
        case 1:
        {
            GivePlayerWeapon(playerid, 27, 9999);
            GivePlayerWeapon(playerid, 33, 9999);
            printf("%s escolheu duel 1", aname);
        }
        case 2:
        {
            GivePlayerWeapon(playerid, 31, 9999);
            GivePlayerWeapon(playerid, 25, 9999);
            printf("%s escolheu duel 2", aname);
        }
    }
    return 1;
}
O comando funciona? O que aparece no console?
Se nгo funcionar, atualize as suas includes!
Reply
#7

pawn Код:
CMD:duel(playerid, params[])
{
    new dueloid;
    if(sscanf(params,"i", dueloid))
        return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");
    if(dueloid > 2 || dueloid < 1)
        return SendClientMessage(playerid,Cinza,"use: /duel <1-2>");

    GivePlayerWeapon(playerid, dueloid == 1 ? (27) : (31), 9999);
    GivePlayerWeapon(playerid, dueloid == 1 ? (33) : (25), 9999);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)