if(team[i] == TEAM_HUMAN)
{
GetHealth(i,hp);
if(hp < 80)
{
GiveHealth(i,hp+3.5);
stock GetHealth(playerid) { return pInfo[playerid][pHealth]; }
//stock GiveHealth(playerid { return pInfo[playerid][pHealth] ++; )
pInfo[i][pHealth] += 3.5;
new Float:healthx;
GetPlayerHealth( playerid, healthx );
pInfo[ playerid ][ pHealth ] = healthx;
if( team[ i ] == TEAM_HUMAN )
{
new Float:hp;
GetPlayerHealth( i, hp );
if( hp < 80 )
{
SetPlayerHealth( i, hp + 3.5 );
}
}
|
I really don't know what can this ever work.
Try this maybe it will be okay. 1. Why u use another stocks.. there are already functions to get health or to set health. 2. GetPlayerHealth( playerid, Float:health_amount ), is the fuction to get the health. Example: PHP Code:
YOUR CODE IT WILL WORK IF U USE THIS: PHP Code:
if there exist already fuctions for this and u can use it for sure. |
new Float:hp;
GetHealth( i, hp );
GetHealth( playerid, health ) return pInfo[ playerid ][ pHealth ] = health;
GiveHealth( playerid, health ) return pInfo[ playerid ][ pHealth ] += health;
|
"dude" i'm a girl but that's ok, i try to make your functions work. Let me see.
1. So u get the health with this: GetHealth( i, hp );. Did u defined somewhere that hp ? PHP Code:
PHP Code:
PHP Code:
|
C:\Users\xc0de\Desktop\tst\gamemodes\zm1.pwn(2800) : warning 213: tag mismatch C:\Users\xc0de\Desktop\tst\gamemodes\zm1.pwn(2802) : error 036: empty statement C:\Users\xc0de\Desktop\tst\gamemodes\zm1.pwn(2803) : warning 213: tag mismatch
{
GetHealth(i,hp);
if(hp < 80)
{;
GiveHealth(i,3.5);
|
Show me the errors on lines.. tell me what lines are the errors :]]
I know that's the code but write in front of them the lines numbers, please. |
GiveHealth( playerid, health )
GiveHealth( playerid, Float:health )
|
PHP Code:
PHP Code:
|
stock DoctorShield()
{
new Float:X,Float:Y,Float:Z,Float:hp,str[128];
GetObjectPos(DocShield,X,Y,Z);
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,4.5,X,Y,Z))
{
if(team[i] == TEAM_HUMAN)
{
GetHealth(i,Float:hp);
if(hp < 80);
{
GiveHealth(i,3.5);
format(str,sizeof(str),"~n~~n~~n~~n~~g~GETTING HEALED BY DOCTOR SHIELD~w~ (NEW HP: %.2f HP)",hp);
GameTextForPlayer(i,str,1000,5);
}
else
{
GameTextForPlayer(i,"~n~~n~~n~~n~~r~YOU HAVE ENOUGH HP TO SURVIVE",1000,5);
}
}
}
}
return 1;
}
stock DoctorShield()
{
new Float:X,Float:Y,Float:Z,Float:hp,str[128];
GetObjectPos(DocShield,X,Y,Z);
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,4.5,X,Y,Z))
{
if(team[i] == TEAM_HUMAN)
{
GetPlayerHealth(i,hp);
if(hp < 80)
{
SetPlayerHealth(i,hp+3.5);
format(str,sizeof(str),"~n~~n~~n~~n~~g~GETTING HEALED BY DOCTOR SHIELD~w~ (NEW HP: %.2f HP)",hp);
GameTextForPlayer(i,str,1000,5);
}
else
{
GameTextForPlayer(i,"~n~~n~~n~~n~~r~YOU HAVE ENOUGH HP TO SURVIVE",1000,5);
}
}
}
}
return 1;
}