SA-MP Forums Archive
Health 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: Health problem (/showthread.php?tid=64697)

Pages: 1 2


Health problem - leon_sharped - 06.02.2009

How do I stop falling Health? Help please.


Re: Health problem - My_Waffles_Bitch_L0L - 06.02.2009

wht u mean with falling health? :P


Re: Health problem - leon_sharped - 06.02.2009

yes. hp


Re: Health problem - kc - 06.02.2009

search for "godmode"?


Re: Health problem - leon_sharped - 06.02.2009

mode: underworld


Re: Health problem - MPKaboose - 06.02.2009

make a timer for a player you want to stop this and make it set the players health to 100

pawn Код:
new playergod[playerid];
//UnderGameModeInit
SetTimer("God",1000,1);
//Any where
forward God();
public God()
{
  for (new i = 0;i < MAX_PLAYERS;i ++)
  {
    if (playergod[i] == 1)
    {
      SetPlayerHealth(i,100);
    }
  }
  return 1;
}
//OnPlayerCommandText
if(strcmp(cmdtext, "/god", true) == 0)
{
  playergod[playerid] = 1;
}

if(strcmp(cmdtext, "/notgod", true) == 0)
{
  playergod[playerid] = 0;
}



Re: Health problem - leon_sharped - 06.02.2009

Error:

nefartas.pwn(139) : error 017: undefined symbol "playerid"
nefartas.pwn(139) : error 009: invalid array size (negative, zero or out of bounds)


139: new playergod[playerid];


Re: Health problem - MPKaboose - 06.02.2009

put this on the top of your script

pawn Код:
new playergod[playerid];



Re: Health problem - leon_sharped - 06.02.2009

Yes, I put it there.


Re: Health problem - Jefff - 06.02.2009

Код:
new playergod[playerid];
xD !

Код:
new playergod[200];



Re: Health problem - leon_sharped - 06.02.2009

thanks


Re: Health problem - MPKaboose - 06.02.2009

remove


Re: Health problem - MPKaboose - 06.02.2009

Quote:
Originally Posted by Jefff
Код:
new playergod[playerid];
xD !

Код:
new playergod[200];
that is for a playerid that is not a string

Edit: what you made there will never work what he whants


Re: Health problem - Streetplaya - 06.02.2009

Quote:
Originally Posted by ArcticFox
Quote:
Originally Posted by Jefff
Код:
new playergod[playerid];
xD !

Код:
new playergod[200];
that is for a playerid that is not a string

Edit: what you made there will never work what he whants
It will work 200 stands for MAX_PLAYERS


Re: Health problem - MPKaboose - 06.02.2009

Quote:
Originally Posted by !MaVe
Quote:
Originally Posted by ArcticFox
Quote:
Originally Posted by Jefff
Код:
new playergod[playerid];
xD !

Код:
new playergod[200];
that is for a playerid that is not a string

Edit: what you made there will never work what he whants
It will work 200 stands for MAX_PLAYERS
AHH i confused playerid with MAX_PLAYERS sorry all


Re: Health problem - Mikep - 06.02.2009

Fox, theres no need for a timer!

SetPlayerHealth(playerid, 100000); << Godmode


Re: Health problem - Lazarus - 06.02.2009

If you want it just against weapons

pawn Код:
//OnGameModeInit
SetTeamCount(2);

//OnPlayerConnect
SetPlayerTeam(playerid, 0);



Re: Health problem - MPKaboose - 06.02.2009

Quote:
Originally Posted by Mikeshake
Fox, theres no need for a timer!

SetPlayerHealth(playerid, 100000); << Godmode
Thanks for telling me I didn't know that


Re: Health problem - Streetplaya - 06.02.2009

But that will make the health bar flickering


Re: Health problem - Mikep - 06.02.2009

So?