[AJUDA] Erro em result
#1

Ta dando erro na linha: SetPlayerHoldingObject(giveplayerid, result, 2);

No result...
Como tirar o erro?

pawn Код:
if(strcmp(cmd, "/op", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /op [Id Do Jogador] [id do objeto]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(admtrampando[playerid] < 1)
                {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/profadmin)");
                return 1;
                }
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "USE: USE: /op [Id Do Jogador] [id do objeto]");
                            return 1;
                        }
                       
                        new Float:X, Float:Y, Float:Z;
                        GetPlayerPos(giveplayerid,Float:X, Float:Y, Float:Z);
                        SetPlayerHoldingObject(giveplayerid, result, 2);

                        format(string, 256, "Admin %s Botou o Objeto Numero: %s Em: %s",sendername, giveplayer, (result));
                        ABroadCast(COLOR_YELLOW,string,1);
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d Nгo estб on.", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
Reply
#2

qual seria o erro? nome do erro?
Reply
#3

pawn Код:
Erro: F:\samp\gamemodes\BRL.pwn(28573) : error 035: argument type mismatch (argument 2)

Linha: SetPlayerHoldingObject(giveplayerid, result, 2);
Reply
#4

espere alguem resolver, eu realmente nгo entendi o.o
Reply
#5

Tenta:


pawn Код:
SetPlayerHoldingObject(giveplayerid, (result), 2);
Reply
#6

pawn Код:
Erro: F:\samp\gamemodes\BRL.pwn(28573) : error 035: argument type mismatch (argument 2)

Linha: SetPlayerHoldingObject(giveplayerid, (result), 2);
Reply
#7

(result) - й para ser usado em uma string, e SetPlayerHoldingObject nгo й uma string.
Reply
#8

LoL, para que um comando tгo grande?

Tente assim, menor, mais bonito e que funciona:

pawn Код:
if(strcmp(cmd, "/op", true) == 0)
{
    new giveplayerid,tmp[256],idx,objeto,string[256];
    tmp = strtok(cmdtext, idx);
    giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    objeto = strval(tmp);
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(!strlen(tmp)) SendClientMessage(playerid, COLOR_GREY, "/op [playerid] [id do objeto]");
    else if(!strlen(tmp)) SendClientMessage(playerid, COLOR_GREY, "/op [playerid] [id do objeto]");
    else if (PlayerInfo[playerid][pAdmin] == 0) SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode fazer isto.");
    else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_GREY, "Jogador nгo existe.");
    else if(admtrampando[playerid] == 0) SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/profadmin)");
    else
    {
        format(string, 256, "Admin %s Botou o Objeto Numero: %d Em: %s",sendername, objeto, giveplayer);
        ABroadCast(COLOR_YELLOW,string,1);
        //O adm й galinha para botar? lol
        SetPlayerHoldingObject(giveplayerid, objeto, 2);
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
(result) - й para ser usado em uma string, e SetPlayerHoldingObject nгo й uma string.
Tragico

Nгo tem outra forma de fazer isso?
definir um numero para o result... sei la

@Post acima

pawn Код:
F:\samp\gamemodes\BRL.pwn(28530) : warning 219: local variable "giveplayerid" shadows a variable at a preceding level
F:\samp\gamemodes\BRL.pwn(28530) : warning 219: local variable "tmp" shadows a variable at a preceding level
F:\samp\gamemodes\BRL.pwn(28530) : warning 219: local variable "idx" shadows a variable at a preceding level
F:\samp\gamemodes\BRL.pwn(28530) : warning 219: local variable "string" shadows a variable at a preceding level

Linha: new giveplayerid,tmp[256],idx,objeto,string[256];
lol @ //O adm й galinha para botar? lol
Reply
#10

Dб uma olhada no que te passei acima, se der erros tenta adaptar que vocк consegue.

@Edit: Delete....

delete o: giveplayerid, tmp[256], idx, string[256];

Pois eles jб estгo definidos em seu gamemode.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)