[FilterScript] Anti - Cheat Health endless
#1

My is simple scriptfiles. Author: ko2;

PHP код:
#include a_samp
new bool:Spawn[MAX_PLAYERS], timer
public 
OnPlayerSpawn(playerid

    
Spawn[playerid] = true
    return 
1

public 
OnPlayerConnect(playerid

    
Spawn[playerid] = false

public 
OnPlayerDeath(playerid

    
Spawn[playerid] = false

public 
OnFilterScriptInit()

    
timer SetTimer("AntiH",5000,1); 
    return 
1;

public 
OnFilterScriptExit()

    
KillTimer(timer); 
    return 
1;

forward AntiH(); 
public 
AntiH() 

    for(new 
i;i<GetMaxPlayers()-1;i++) 
    { 
        if(!
IsPlayerConnected(i)) return 0
        new 
Float:healthp,string[128], name[24]; 
        
GetPlayerHealth(i,healthp); 
        
GetPlayerName(i,name,sizeof(name)); 
        if(
healthp == 0.0 && Spawn[i] == true
        { 
            
format(string,sizeof(string),"%s(%d) is uses infinite health.",name,i); 
            
SendClientMessageToAll(0xFF0000FF,string); 
            
SetTimerEx("KickF",1000,0,"i",i); 
        } 
    } 
    return 
1;

forward KickF(playerid); 
public 
KickF(playerid

    
Kick(playerid); 

Reply
#2

Quote:

format(string,sizeof(string),"%s(%d) is used health endless.",name,i);

Hmmm, ****** translate ? LOL ?!
Reply
#3

Quote:
Originally Posted by DarkyTheAngel
Посмотреть сообщение
Hmmm, ****** translate ? LOL ?!
Did you have a question?
Reply
#4

PHP код:
SetTimerEx("KickF",1000,0,"u",i); 
"u" ? its not a sscanf

Quote:
Placeholder Meaning
i Stands for an integer parameter.
d Exactly the same as i.
a Passes an array, the next parameter must be an integer ("i") with the array's size. [CURRENTLY UNUSABLE]
s Stands for a string parameter. [CURRENTLY UNUSABLE]
f Stands for a float parameter.
b Stands for a boolean parameter.
Reply
#5

Thanks. I am corrected.
Reply
#6

Yeah.

Quote:

format(string,sizeof(string),"%s(%d) is uses infinite health.",name,i);

Here, why you did you use i instead of playerid ?
Reply
#7

i - id player.
Reply
#8

Quote:
Originally Posted by ko2
Посмотреть сообщение
i - id player.
LOL.Dude, i know this.But you can do this:

Quote:

forward AntiH(playerid);
public AntiH(playerid)

Instead of this:

Quote:

forward AntiH();
public AntiH()

BTW, nice.Good job.
Reply
#9

Thanks. My English is beginner. I study English is intermediate.
Quote:

forward AntiH(playerid);
public AntiH(playerid)

Then insert in OnPlayerConnect.
Reply
#10

does it work 100% ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)