SA-MP Forums Archive
error 035: argument type mismatch (argument 2) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 035: argument type mismatch (argument 2) (/showthread.php?tid=645379)



error 035: argument type mismatch (argument 2) - MariusAdv - 25.11.2017

Hello, I have a problem with "/fly" and "/stopfly":
Код:
CMD:fly(playerid, params[])
{
	StartFly(playerid);
	SetPlayerHealth(playerid, "99999999");                   //LINE 393
	SetPVarInt(playerid, "Fly", 1);
	return 1;
}

CMD:stopfly(playerid, params[])
{
	StopFly(playerid);
	SetPlayerHealth(playerid, "99");                              // LINE 401
	SetPVarInt(playerid, "Fly", 0);
	return 1;
}
I put InitFly on OnPlayerConnect and some more SetPVarInT all over there.:
Код:
SetPVarInt(playerid, "Fly", 0);
	InitFly(playerid);
Error:
Код:
C:\Users\Marius\Desktop\rpg v0.0.1\gamemodes\rpg.pwn(393) : error 035: argument type mismatch (argument 2)
C:\Users\Marius\Desktop\rpg v0.0.1\gamemodes\rpg.pwn(401) : error 035: argument type mismatch (argument 2)



Re: error 035: argument type mismatch (argument 2) - 1fret - 25.11.2017

Quote:
Originally Posted by MariusAdv
Посмотреть сообщение
Hello, I have a problem with "/fly" and "/stopfly":
Код:
CMD:fly(playerid, params[])
{
	StartFly(playerid);
	SetPlayerHealth(playerid, "99999999");                   //LINE 393
	SetPVarInt(playerid, "Fly", 1);
	return 1;
}

CMD:stopfly(playerid, params[])
{
	StopFly(playerid);
	SetPlayerHealth(playerid, "99");                              // LINE 401
	SetPVarInt(playerid, "Fly", 0);
	return 1;
}
I put InitFly on OnPlayerConnect and some more SetPVarInT all over there.:
Код:
SetPVarInt(playerid, "Fly", 0);
	InitFly(playerid);
Error:
Код:
C:\Users\Marius\Desktop\rpg v0.0.1\gamemodes\rpg.pwn(393) : error 035: argument type mismatch (argument 2)
C:\Users\Marius\Desktop\rpg v0.0.1\gamemodes\rpg.pwn(401) : error 035: argument type mismatch (argument 2)
Change this
PHP код:
SetPlayerHealth(playerid"99999999"); 
to
PHP код:
SetPlayerHealth(playerid99999999); 
same for this
PHP код:
SetPlayerHealth(playerid"99"); 
to
PHP код:
SetPlayerHealth(playerid,99); 
The ("") is only used for strings


Re: error 035: argument type mismatch (argument 2) - MariusAdv - 25.11.2017

Quote:
Originally Posted by 1fret
Посмотреть сообщение
Change this
PHP код:
SetPlayerHealth(playerid"99999999"); 
to
PHP код:
SetPlayerHealth(playerid99999999); 
same for this
PHP код:
SetPlayerHealth(playerid"99"); 
to
PHP код:
SetPlayerHealth(playerid,99); 
The ("") is only used for strings
Thank you!


I need some help with that: (Sorry I'm beginner.)
Код:
if(IsPlayerAdmin(playerid)) return SCM(playerid, -1, "* Nu ai admin!");
	//if(PlayerInfo[playerid][pAdmin] == 0) return SCM(playerid, -1, "* Nu ai admin!");
	if(MarkPos[playerid][0] == 0) return SCM(playerid, -1, "* Nu ai salvat o pozitie! (/mark)");
	if(GetPlayerState(playerid == PLAYER_STATE_DRIVER) SetVehiclePos(GetPlayerVehicleID(playerid), MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);
	else SetVehiclePos(playerid, MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);
	SCM(playerid, -1, "Te-ai teleportat cu success!");
	return 1;
}
Sorry, I am from Romania.

Error:
Код:
error 001: expected token: ")", but found "-identifier-"



Re: error 035: argument type mismatch (argument 2) - 1fret - 25.11.2017

Quote:
Originally Posted by MariusAdv
Посмотреть сообщение
Thank you!


I need some help with that: (Sorry I'm beginner.)
Код:
if(IsPlayerAdmin(playerid)) return SCM(playerid, -1, "* Nu ai admin!");
	//if(PlayerInfo[playerid][pAdmin] == 0) return SCM(playerid, -1, "* Nu ai admin!");
	if(MarkPos[playerid][0] == 0) return SCM(playerid, -1, "* Nu ai salvat o pozitie! (/mark)");
	if(GetPlayerState(playerid == PLAYER_STATE_DRIVER) SetVehiclePos(GetPlayerVehicleID(playerid), MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);
	else SetVehiclePos(playerid, MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);
	SCM(playerid, -1, "Te-ai teleportat cu success!");
	return 1;
}
Sorry, I am from Romania.

Error:
Код:
error 001: expected token: ")", but found "-identifier-"
which line shows the error


Re: error 035: argument type mismatch (argument 2) - DRIFT_HUNTER - 25.11.2017

if(GetPlayerState(playerid
You forgot bracket

pawn Код:
if(IsPlayerAdmin(playerid)) return SCM(playerid, -1, "* Nu ai admin!");
    //if(PlayerInfo[playerid][pAdmin] == 0) return SCM(playerid, -1, "* Nu ai admin!");
    if(MarkPos[playerid][0] == 0) return SCM(playerid, -1, "* Nu ai salvat o pozitie! (/mark)");
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehiclePos(GetPlayerVehicleID(playerid), MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);
    else SetVehiclePos(playerid, MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);
    SCM(playerid, -1, "Te-ai teleportat cu success!");
    return 1;
}



Re: error 035: argument type mismatch (argument 2) - MariusAdv - 25.11.2017

if(GetPlayerState(playerid == PLAYER_STATE_DRIVER) SetVehiclePos(GetPlayerVehicleID(playerid), MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);


Re: error 035: argument type mismatch (argument 2) - 1fret - 25.11.2017

Quote:
Originally Posted by MariusAdv
Посмотреть сообщение
if(GetPlayerState(playerid == PLAYER_STATE_DRIVER) SetVehiclePos(GetPlayerVehicleID(playerid), MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);
try this it havent been tested
PHP код:
    new pState GetPlayerState(playerid);
    if(
pState == PLAYER_STATE_DRIVER)
    {
        
SetVehiclePos(GetPlayerVehicleID(playerid), MarkPos[playerid][0], MarkPos[playerid][1], MarkPos[playerid][2]);
    } 



Re: error 035: argument type mismatch (argument 2) - MariusAdv - 25.11.2017

I solved! Thanks for all guys!