argument type mismatch (argument 2)
#1

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;
}
Reply
#2

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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)