small help please - 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: small help please (
/showthread.php?tid=337043)
small help please -
Youice - 24.04.2012
hello!!
I just need help in this error:
Code:
error 036: empty statement
Here is code that I have made my self! :
Code:
public HealthChecker(i)
{
new Float:health;
health = GetPlayerHealth(i, health);
for(new a=0;a<MAX_PLAYERS; a++)
{
if(!IsPlayerConnected(i))
{
if(i, health >= 101); // ERROR is here!
Ban(i);
}
else if(IsPlayerAdmin(i))
{
SendClientMessage(i, COLOR_GREEN, "Health Checker::{FF0000} Im starting to check peoples health , dont worry ;)");
}
}
return 1;
}
Re: small help please -
ViniBorn - 24.04.2012
pawn Code:
public HealthChecker()
{
new Float:health;
for(new a, b = GetMaxPlayers(); a != b; a++)
{
if(!IsPlayerConnected(a))
continue;
if(IsPlayerAdmin(a))
{
SendClientMessage(a, COLOR_GREEN, "Health Checker::{FF0000} Im starting to check peoples health , dont worry ;)");
continue;
}
GetPlayerHealth(a, health);
if(health >= 101) // ERROR is here!
Ban(a);
}
return 1;
}
Re: small help please -
Pinguinn - 24.04.2012
When using the ' if ' statement, you should not place a semicolon at the end of the line.
pawn Code:
public HealthChecker(i)
{
new Float:health;
health = GetPlayerHealth(i, health);
for(new a=0;a<MAX_PLAYERS; a++)
{
if(!IsPlayerConnected(i))
{
if(i, health >= 101) {
Ban(i);
}
}
else if(IsPlayerAdmin(i))
{
SendClientMessage(i, COLOR_GREEN, "Health Checker::{FF0000} Im starting to check peoples health , dont worry ;)");
}
}
return 1;
}
Re: small help please -
Youice - 24.04.2012
LOL I have solved it like "Pinguinn" but my self : D and Thanks very much for you all(two)!!!!!!!!!!!!!!!!
+rep for you bro.s!!
Edit: here is the code that I create::
Code:
public HealthChecker(i)
{
new Float:health;
health = GetPlayerHealth(i, health);
for(new a=0;a<MAX_PLAYERS; a++)
{
if(!IsPlayerConnected(i))
{
for(new b=101; b<health; b++)
{
Ban(i);
}
}
else if(IsPlayerAdmin(i))
{
SendClientMessage(i, COLOR_GREEN, "Health Checker::{FF0000} Im starting to check peoples health , dont worry ;)");
}
}
return 1;
}