SA-MP Forums Archive
OnPlayerWeaponShoot - 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: OnPlayerWeaponShoot (/showthread.php?tid=622320)



OnPlayerWeaponShoot - MerryDeer - 20.11.2016

Hi,

There is problem, When you shoot and OnPlayerWeaponShoot called with type hittype = 1 to player when shoot, not always you take damage, like using skin modifications, i'am making anti-god, and this is barrier for me, it's possible to check if onplayerweaponshoot, will hurt player, call onplayertakedamage or it's gta bugg, and impossible.


Re: OnPlayerWeaponShoot - SickAttack - 20.11.2016

This is getting ridiculous, please stop with these threads. Start testing, debugging, posting code. This section is for requesting help on code...


Re: OnPlayerWeaponShoot - GoldenLion - 20.11.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
This is getting ridiculous, please stop with these threads. Start testing, debugging, posting code. This section is for requesting help on code...
I know right man! Finally someone understands me. I wrote a whole story at his thread about it and I bet he didn't even look at it. He's acting like a bot. You deserve some reputation man.

EDIT: Damn, I can't give you reputation because I already gave you. I'll do that once I can.


Re: OnPlayerWeaponShoot - TwinkiDaBoss - 20.11.2016

You can just simply use OnPlayerWeaponShot since I noticed that OnPlayerTakeDamage doesnt get called sometimes in these cases.

I even used OnPlayerWeaponShot to make a reliable anti HP hack.

Example code
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ) {
    if(
hittype == BULLET_HIT_TYPE_PLAYER) {
        if(
IsPlayerConnected(hitid)) {
            
printf("%s was shot",GetName(hittid));
                        
//add custom health check here and there you go, simplest anti health hack
        
}
    }
    return 
1;




Re: OnPlayerWeaponShoot - SickAttack - 20.11.2016

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
You can just simply use OnPlayerWeaponShot since I noticed that OnPlayerTakeDamage doesnt get called sometimes in these cases.

I even used OnPlayerWeaponShot to make a reliable anti HP hack.

Example code
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ) {
    if(
hittype == BULLET_HIT_TYPE_PLAYER) {
        if(
IsPlayerConnected(hitid)) {
            
printf("%s was shot",GetName(hittid));
                        
//add custom health check here and there you go, simplest anti health hack
        
}
    }
    return 
1;

If you aren't aware of the bug with the callback, look it up.

Checking if the player is connected isn't needed, btw.


Re: OnPlayerWeaponShoot - ISmokezU - 20.11.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
If you aren't aware of the bug with the callback, look it up.

Checking if the player is connected isn't needed, btw.
What's the bug exactly?


Re: OnPlayerWeaponShoot - MerryDeer - 21.11.2016

Problem is that, how i mention if player use skin modifications, when you shoot, onplayerweaponshoot could get called, how hp not lower, but player is not cheat.