SA-MP Forums Archive
Code 1 error - 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)
+--- Thread: Code 1 error (/showthread.php?tid=628111)



Code 1 error - DerickClark - 06.02.2017

Код:
if(IsPlayerConnected(i) && SetPlayerHealth(i, 100.0));
Код:
: error 036: empty statement
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Code 1 error - AndreiWow - 06.02.2017

if(IsPlayerConnected(i) && SetPlayerHealth(i, 100.0))

You don't need to add ';' at the end of an if


Re: Code 1 error - DerickClark - 06.02.2017

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
if(IsPlayerConnected(i) && SetPlayerHealth(i, 100.0))

You don't need to add ';' at the end of an if
i get alots of error


Re: Code 1 error - AndreiWow - 06.02.2017

Show me the errors then.. also why do you use && SetPlayerHealth(i, 100.0)) What...

What do you want to do..


Re: Code 1 error - DerickClark - 06.02.2017

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
Show me the errors then.. also why do you use && SetPlayerHealth(i, 100.0)) What...

What do you want to do..
Код:
error 036: empty statement
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Code 1 error - AndreiWow - 06.02.2017

Dont use && SetPlayerHealth(i, 100.0)), it won't work, tell me what you want to do..


Re: Code 1 error - JesterlJoker - 06.02.2017

If you want to set the players health of I to one hundred then you can do this.
PHP код:
if(IsPlayerConnected(i))
{
       
SetPlayerHealth(i100.0);
       return 
1;

if you wanna knoaw if the players health is 100.0
then do this
PHP код:
if(IsPlayerConnected(i) && GetPlayerHealth(i))
{
   
//initiate killing sequence because we set the player health to 99 for anti health hack.




Re: Code 1 error - Vince - 06.02.2017

IsPlayerConnected is redundant in so many cases because most functions have an inbuilt connection check. You really don't need it nearly as much as you think that you do. If the player isn't connected those function will simply return 0.