problem with public onplayerupdate thing -
hardstop - 21.04.2010
Код:
C:\DOCUME~1\Hardsop\Desktop\APOKAL~1\Server\GAMEMO~1\mygm.pwn(123) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
i added this
public OnPlayerUpdate(playerid)
{
if(HealthAmount <= 20)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
}
return 1;
}
and i have these on my defines
Код:
new Float:HealthAmount
GetPlayerHealth(playerid, HealthAmount);
Re: problem with public onplayerupdate thing -
Nero_3D - 21.04.2010
Also "expected token:
token, but found
token" means that the token (the first) was expected from the compiler but he found token (the second)
pawn Код:
new Float:HealthAmount // here is the problem - the compiler wants a semicolon but just found a identifier
GetPlayerHealth(playerid, HealthAmount);
//so we add a semicolon
new Float:HealthAmount; //done
GetPlayerHealth(playerid, HealthAmount);
Re: problem with public onplayerupdate thing -
hardstop - 21.04.2010
yeh i got it fixed now but it doesnt tele to location i want when hp 20
public OnPlayerUpdate(playerid)
{
if(HealthAmount == 20)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
}
return 1;
}
Re: problem with public onplayerupdate thing -
CAR - 21.04.2010
If you want to teleport players when the HP is 20 OR lower (for example: 5, 10, 15)
Use this:
pawn Код:
public OnPlayerUpdate(playerid)
{
if(HealthAmount <= 20)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
}
return 1;
}
Re: problem with public onplayerupdate thing -
hardstop - 21.04.2010
1 warning: (17039) : warning 217: loose indentation
Код:
public OnPlayerUpdate(playerid)
{
new Float:HealthAmount; //done
GetPlayerHealth(playerid, HealthAmount);
if(HealthAmount <= 20)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
}
return 1;
}
how can i make that it teleports 1 time because when i have 20 hp it is going to teleport me 1000000000000000000000000 times
Re: problem with public onplayerupdate thing -
CAR - 21.04.2010
You can set the health more. Like 100 (full) Example:
pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:HealthAmount; //done
GetPlayerHealth(playerid, HealthAmount);
if(HealthAmount <= 20)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
SetPlayerHealth(playerid, 100);
}
return 1;
}
Re: problem with public onplayerupdate thing -
hardstop - 21.04.2010
Thanks