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: argument type mismatch (argument 2) (
/showthread.php?tid=633852)
argument type mismatch (argument 2) -
akib - 08.05.2017
Hi
i am trying to make a anti cheat include
added anti money hack but having problem with health
Code:
Код:
new float:health[MAX_PLAYERS];
new float:oldHealth[MAX_PLAYERS];
stock ASetPlayerHealth(playerid,heal) {
GetPlayerHealth(playerid,oldHealth); //Giving error in this line
SetPlayerHealth(playerid,heal);
health[playerid] = heal; //warning 213: tag mismatch
new m[126];
format(m,sizeof(m),"%i",health[playerid]);
SendClientMessage(playerid,COLOR_RED,m);
return 1;
}
Re: argument type mismatch (argument 2) -
Banditul18 - 08.05.2017
PHP код:
new float:health[MAX_PLAYERS];
new float:oldHealth[MAX_PLAYERS];
stock ASetPlayerHealth(playerid,Float:heal) {
GetPlayerHealth(playerid,oldHealth[playerid]); //Forgot about playerid
SetPlayerHealth(playerid,heal);
health[playerid] = heal; //forgot about Float tag of heal parameter
new m[126];
format(m,sizeof(m),"%0.1f",health[playerid]);//health is a float not integer
SendClientMessage(playerid,COLOR_RED,m);
return 1;
}