Problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem (
/showthread.php?tid=214611)
Problem -
Face9000 - 21.01.2011
Hi all,i create this functions only for VIP players,to get every minute +5 hp to their health:
pawn Код:
forward VIPHP();
public VIPHP()
{
for (new i=0;i<MAX_PLAYERS; i++)
{
if(PlayerVip[playerid] == 1)
{
new Float:health;
GetPlayerHealth(i, health);
SetPlayerHealth(i, health +5);
}
return 1;
}
I created timer,but what's wrong?
I get tons of errors.
Re: Problem -
_Tommy - 21.01.2011
Well post your errors.
EDIT: you forgot to close your function..
pawn Код:
forward VIPHP(playerid);
public VIPHP(playerid)
{
for (new i=0;i<MAX_PLAYERS; i++)
{
if(PlayerVip[playerid] == 1)
{
new Float:health;
GetPlayerHealth(i, health);
SetPlayerHealth(i, health +5);
}
}
return 1;
}
Also, there is no "playerid" in your function. Look what I did, and retype your function calling playerid aswell.
Re: Problem -
Face9000 - 21.01.2011
Ok fixed,i use the "i" cuz i made a loop:
for (new i=0;i<MAX_PLAYERS; i++)