SA-MP Forums Archive
[FilterScript] Anti - Cheat Health endless - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Anti - Cheat Health endless (/showthread.php?tid=418388)



Anti - Cheat Health endless - ko2 - 24.02.2013

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); 




Re: Anti - Cheat Health endless - DarkyTheAngel - 24.02.2013

Quote:

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

Hmmm, ****** translate ? LOL ?!


Re: Anti - Cheat Health endless - ko2 - 24.02.2013

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


Re: Anti - Cheat Health endless - Mance - 24.02.2013

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.



Re: Anti - Cheat Health endless - ko2 - 24.02.2013

Thanks. I am corrected.


Re: Anti - Cheat Health endless - DarkyTheAngel - 24.02.2013

Yeah.

Quote:

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

Here, why you did you use i instead of playerid ?


Re: Anti - Cheat Health endless - ko2 - 24.02.2013

i - id player.


Re: Anti - Cheat Health endless - DarkyTheAngel - 24.02.2013

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.


Re: Anti - Cheat Health endless - ko2 - 24.02.2013

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

forward AntiH(playerid);
public AntiH(playerid)

Then insert in OnPlayerConnect.


Re: Anti - Cheat Health endless - Emily_Miku - 22.06.2013

does it work 100% ?