Error 035: argument type mismatch(argument 1)
#1

Hi, I have this problem on this command.
pawn Код:
if(strcmp(cmd, "/goto", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Dica: /goto [playerid]");
                return 1;
            }
            new Float:plocx,Float:plocy,Float:plocz;
            new plo;
            plo = ReturnUser(tmp);
            if (IsPlayerConnected(plo))
            {
                if(plo != INVALID_PLAYER_ID)
                {
                    if (PlayerInfo[playerid][pAdmin] >= 3)
                    {
                        GetPlayerPos(plo, plocx, plocy, plocz);
                        if(PlayerInfo[plo][pInt] > 0)
                        {
                            SafeSetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
                            PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
                        }
                        else
                        {
                            SafeSetPlayerInterior(playerid,0);
                        }
                        if (GetPlayerState(playerid) == 2)
                        {
                            new tmpcar = GetPlayerVehicleID(playerid);
                            SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
                            TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
                        }
                        else
                        {
                            SafeSetPlayerPos(playerid,plocx,plocy+2, plocz);
                        }
                        SetPlayerVirtualWorld(playerid, PlayerInfo[plo][pVirWorld]);
                        GetPlayerName(plo, giveplayer, sizeof(giveplayer));
                        //format(string, sizeof(string), "%s teleportou-se para %s", sendername, giveplayer);
                        GameTextForPlayer("~y~Um Admin teleportou-se para ti, ~y~ Imobiliza o teu veнculo!",7500,3);
                        DisablePlayerCheckpoint(playerid);
                        OnPlayerExitFood(playerid);
                        if(BizzEntered[plo] != 9999)
                        {
                            BizzEntered[playerid] = BizzEntered[plo];
                        }
                        TelesLog(string);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "Nгo estбs autorizado a usar este comando!");
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d nгo й um jogador vбlido.", plo);
                SendClientMessage(playerid, COLOR_GRAD1, string);
                return 1;
            }
        }
        return 1;
    }
Anyone can repair this for me?

Thanks.
Reply
#2

Код:
GetPlayerName(plo, giveplayer, sizeof(giveplayer));
Argument 1 (second argument) should be a string not an integer.
Reply
#3

i dont understand very well , im a newbie. :P

Can you change the code?
Reply
#4

Try this:
pawn Код:
if(strcmp(cmd, "/goto", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Dica: /goto [playerid]");
                return 1;
            }
            new Float:plocx,Float:plocy,Float:plocz;
            new giveplayer2[MAX_PLAYER_NAME];
            new plo;
            plo = ReturnUser(tmp);
            if (IsPlayerConnected(plo))
            {
                if(plo != INVALID_PLAYER_ID)
                {
                    if (PlayerInfo[playerid][pAdmin] >= 3)
                    {
                        GetPlayerPos(plo, plocx, plocy, plocz);
                        if(PlayerInfo[plo][pInt] > 0)
                        {
                            SafeSetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
                            PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
                        }
                        else
                        {
                            SafeSetPlayerInterior(playerid,0);
                        }
                        if (GetPlayerState(playerid) == 2)
                        {
                            new tmpcar = GetPlayerVehicleID(playerid);
                            SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
                            TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
                        }
                        else
                        {
                            SafeSetPlayerPos(playerid,plocx,plocy+2, plocz);
                        }
                        SetPlayerVirtualWorld(playerid, PlayerInfo[plo][pVirWorld]);
                        GetPlayerName(plo, giveplayer2, sizeof(giveplayer2));
                        //format(string, sizeof(string), "%s teleportou-se para %s", sendername, giveplayer2);
                        GameTextForPlayer("~y~Um Admin teleportou-se para ti, ~y~ Imobiliza o teu veнculo!",7500,3);
                        DisablePlayerCheckpoint(playerid);
                        OnPlayerExitFood(playerid);
                        if(BizzEntered[plo] != 9999)
                        {
                            BizzEntered[playerid] = BizzEntered[plo];
                        }
                        TelesLog(string);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "Nгo estбs autorizado a usar este comando!");
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d nгo й um jogador vбlido.", plo);
                SendClientMessage(playerid, COLOR_GRAD1, string);
                return 1;
            }
        }
        return 1;
    }
Reply
#5

Same Error. :S
Reply
#6

show us you error line
Reply
#7

Код:
C:\Users\Ben\Desktop\Server GTA\Gamemode RP\BEN.pwn(41639) : error 035: argument type mismatch (argument 1)
Reply
#8

lol, Show us that Code which is on line '41639'.
Reply
#9

Initially is this one:
pawn Код:
if(strcmp(cmd, "/goto", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Dica: /goto [playerid]");
                return 1;
            }
            new Float:plocx,Float:plocy,Float:plocz;
            new plo;
            plo = ReturnUser(tmp);
            if (IsPlayerConnected(plo))
            {
                if(plo != INVALID_PLAYER_ID)
                {
                    if (PlayerInfo[playerid][pAdmin] >= 3)
                    {
                        GetPlayerPos(plo, plocx, plocy, plocz);
                        if(PlayerInfo[plo][pInt] > 0)
                        {
                            SafeSetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
                            PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
                        }
                        else
                        {
                            SafeSetPlayerInterior(playerid,0);
                        }
                        if (GetPlayerState(playerid) == 2)
                        {
                            new tmpcar = GetPlayerVehicleID(playerid);
                            SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
                            TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
                        }
                        else
                        {
                            SafeSetPlayerPos(playerid,plocx,plocy+2, plocz);
                        }
                        SetPlayerVirtualWorld(playerid, PlayerInfo[plo][pVirWorld]);
                        GetPlayerName(plo, giveplayer, sizeof(giveplayer));
                        //format(string, sizeof(string), "%s teleportou-se para %s", sendername, giveplayer);
                        GameTextForPlayer("~y~Um Admin teleportou-se para ti, ~y~ Imobiliza o teu veнculo!",7500,3);
                        DisablePlayerCheckpoint(playerid);
                        OnPlayerExitFood(playerid);
                        if(BizzEntered[plo] != 9999)
                        {
                            BizzEntered[playerid] = BizzEntered[plo];
                        }
                        TelesLog(string);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "Nгo estбs autorizado a usar este comando!");
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d nгo й um jogador vбlido.", plo);
                SendClientMessage(playerid, COLOR_GRAD1, string);
                return 1;
            }
        }
        return 1;
    }
But now i have this one changed by you (Clive).

pawn Код:
if(strcmp(cmd, "/goto", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Dica: /goto [playerid]");
                return 1;
            }
            new Float:plocx,Float:plocy,Float:plocz;
            new giveplayer2[MAX_PLAYER_NAME];
            new plo;
            plo = ReturnUser(tmp);
            if (IsPlayerConnected(plo))
            {
                if(plo != INVALID_PLAYER_ID)
                {
                    if (PlayerInfo[playerid][pAdmin] >= 3)
                    {
                        GetPlayerPos(plo, plocx, plocy, plocz);
                        if(PlayerInfo[plo][pInt] > 0)
                        {
                            SafeSetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
                            PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
                        }
                        else
                        {
                            SafeSetPlayerInterior(playerid,0);
                        }
                        if (GetPlayerState(playerid) == 2)
                        {
                            new tmpcar = GetPlayerVehicleID(playerid);
                            SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
                            TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
                        }
                        else
                        {
                            SafeSetPlayerPos(playerid,plocx,plocy+2, plocz);
                        }
                        SetPlayerVirtualWorld(playerid, PlayerInfo[plo][pVirWorld]);
                        GetPlayerName(plo, giveplayer2, sizeof(giveplayer2));
                        //format(string, sizeof(string), "%s teleportou-se para %s", sendername, giveplayer2);
                        GameTextForPlayer("~y~Um Admin teleportou-se para ti, ~y~ Imobiliza o teu veнculo!",7500,3);
                        DisablePlayerCheckpoint(playerid);
                        OnPlayerExitFood(playerid);
                        if(BizzEntered[plo] != 9999)
                        {
                            BizzEntered[playerid] = BizzEntered[plo];
                        }
                        TelesLog(string);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "Nгo estбs autorizado a usar este comando!");
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d nгo й um jogador vбlido.", plo);
                SendClientMessage(playerid, COLOR_GRAD1, string);
                return 1;
            }
        }
        return 1;
    }
Reply
#10

Show us only that error Line not full command.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)