SA-MP Forums Archive
is this possible ? - 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: is this possible ? (/showthread.php?tid=538113)



is this possible ? - iAnonymous - 19.09.2014

Is it possible that player don't get damage with sniper but gets damage with other weapons ?

http://*********/vVK2MLOSaGo


Re: is this possible ? - IceCube! - 19.09.2014

If you mean can you do this with your script yes:

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage

If you mean is this a valid hack, yes it is. The player can decide which weapon to have God Mode on.

Is it an SAMP Bug no.


Re: is this possible ? - iAnonymous - 19.09.2014

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
If you mean can you do this with your script yes:

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage

If you mean is this a valid hack, yes it is. The player can decide which weapon to have God Mode on.

Is it an SAMP Bug no.
thanks buddy
Very informative


Re: is this possible ? - Pottus - 19.09.2014

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
If you mean can you do this with your script yes:

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage

If you mean is this a valid hack, yes it is. The player can decide which weapon to have God Mode on.

Is it an SAMP Bug no.
That won't work correctly what happens if the player has 40 health and gets shots with sniper then that player would die so you can't just set the health back with that callback. It actually requires a skin hit system which should be used anyways since the stock lagcomp is junk.


Re: is this possible ? - Abagail - 19.09.2014


pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ)
{
if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID && weaponid == WEAPON_SNIPER)
{
if(SniperGod[playerid] == true) return 0;
}
return true;
}
This should work, although I could be wrong... The bullet should desync, - stopping any harm to the target player. Sorry for my bad indentation(I scripted it inside the reply box).



Re: is this possible ? - Pottus - 19.09.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
I believe OnPlayerWeaponShot gets called before the player would die, how-ever I am not entirely sure. In that case, OnPlayerWeaponShot could be substitued. Example,

pawn Код:
public OnPlayerWeaponShot(....)
{
   if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID && weaponid == WEAPON_SNIPER)
{
if(SniperGod[playerid] == true) return 0;
}
return true;
}
Although I could be wrong about this, how-ever I am pretty sure this would work fine.
That could work but is probably not the ideal solution.


Re: is this possible ? - Abagail - 19.09.2014

That is true, how-ever it is ideal for someone who doesn't necessarily want to use a hit box system. It does it's basic purpose how-ever if you needed to a more effective solution could be thought of, but this should be sufficient.