Qustion..
#1

Helllo!,

Guys i want to ask, i learning C# lang and there are in C# some cmd Called "While" , so nice idea to say in script of samp :

Quote:

while(Health>100) //If Get Player health more than 100 Player got auto ban.
{
Ban(playerid);
}

Guys look at this maybe worked

Quote:

new Float:health = GetPlayerHealth(playerid);

while(health>100)
{
Ban(playerid);
}

But i fail with "Health" what can i put in? Is this possible to do ??
Reply
#2

See.. FIRSTLY use

pawn Код:
if(health>100)

Quote:
Originally Posted by [M.A]Angel[M.A]
Посмотреть сообщение
Helllo!,


But i fail with "Health" what can i put in? Is this possible to do ??
and i didnt get this question..

if u wanna make a health check timer...

pawn Код:
OnGameModeInit()
{
SetTimer("HealthCheck",10,1);
}
forward HealthCheck();
public HealthCheck()
{
for(new i ; i < MAX_PLAYERS ; i++)
{
if(IsPlayerConnected(i))
{
new Health = GetPlayerHealth(i);
if(Health>100)
{
Ban(i);
}
}
}
}
Now this code .. will check all the time.. ALL PLAYERS.. if any player's health goes above hundread.. he be banned
Reply
#3

Thanks Too much! , perfect solution!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)