Error 035: argument type mismatch(argument 1) -
bernardo - 12.02.2011
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.
Re: Error 035: argument type mismatch(argument 1) -
Donny_k - 12.02.2011
Код:
GetPlayerName(plo, giveplayer, sizeof(giveplayer));
Argument 1 (second argument) should be a string not an integer.
Re: Error 035: argument type mismatch(argument 1) -
bernardo - 12.02.2011
i dont understand very well , im a newbie. :P
Can you change the code?
Re: Error 035: argument type mismatch(argument 1) -
HyperZ - 12.02.2011
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;
}
Re: Error 035: argument type mismatch(argument 1) -
bernardo - 12.02.2011
Same Error. :S
Re: Error 035: argument type mismatch(argument 1) -
Medal Of Honor team - 12.02.2011
show us you error line
Re: Error 035: argument type mismatch(argument 1) -
bernardo - 12.02.2011
Код:
C:\Users\Ben\Desktop\Server GTA\Gamemode RP\BEN.pwn(41639) : error 035: argument type mismatch (argument 1)
Re: Error 035: argument type mismatch(argument 1) -
HyperZ - 12.02.2011
lol, Show us that Code which is on line '41639'.
Re: Error 035: argument type mismatch(argument 1) -
bernardo - 12.02.2011
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;
}
Re: Error 035: argument type mismatch(argument 1) -
HyperZ - 12.02.2011
Show us only that error
Line not full command.