toggle player -
bugheada - 31.01.2013
is player freeze ( TogglePlayerControllable ) I can kill him, its bug 0.3x or not ?
Re: toggle player -
Bakr - 31.01.2013
Was the function behavior changed in 0.3x? It use to make the frozen player invincible.
Re: toggle player -
Roach_ - 31.01.2013
You can use:
pawn Код:
SetPlayerHealth(playerid, (Float:0x7F800000));
0x7F800000 - Is defined as INFINITY in SA:MP...
Re: toggle player -
Meta - 02.02.2013
Before 0.3x players were invulnerable when frozen.
Beating and kicking does damage.
All weapons (except for RPGs, grenades and sniper rifles) do damage.
Explosions and fire (like from flame throwers) do nothing.
Drowning does nothing.
Tested with woot.
Re : toggle player -
scott1 - 02.02.2013
Yes this had to be fixed
for rp dead, afk system ...
Max
Re: toggle player -
Kyle - 02.02.2013
IT IS NOT A BUG.
But what I think should happen is freezing modes / types.
Re: toggle player -
Bakr - 02.02.2013
If you are referring to earlier versions (I am yet to test anything on 0.3x) then no, players were invincible when they were frozen (TogglePlayerControllable(playerid, false)). I had MANY scripts all the way back from 0.2x relying on that to make players unable to be damaged. It may have been a bug or part of the API not being stable, but it sure was consistent (by that, I mean every time).
Re: toggle player -
Bakr - 02.02.2013
Yes, but this is what I was referring to:
Quote:
Originally Posted by ******
The old method you HAD to make the player invulnerable - now scripters get the choice.
|
That is not the case, you had to make the player vulnerable. They were invulnerable by default.
Re: toggle player -
Bakr - 02.02.2013
Oh, gotcha. Sorry for the misunderstanding.
Re: toggle player -
woot - 02.02.2013
Quote:
Originally Posted by KyleSmith
IT IS NOT A BUG.
|
If it's not a bug but a changed/fixed(?) feature, then it's bugged anyways - because the player doesn't take damage from snipers / explosions / flamethrowers / ... - and it hasn't been mentioned in the changelog! So I guess it wasn't intended.
Re: toggle player -
Whitetiger - 03.02.2013
What a tremendous shame. There was a "bug" (no idea if it was intended or not) with "The most popular cheat for sa-mp, which may or may not be censored on this forum", if you where frozen with TogglePlayerControllable, you would take damage if you were using it, and you wouldn't take damage if you wern't using it, was actually a fantastic cheat detection tool, as even when it was in panic mode, this detection would still work.
Re: toggle player -
-Prodigy- - 03.02.2013
No worries, samp dies on every release
Re : toggle player -
scott1 - 04.02.2013
So wi not simply add an param to the func?
TogglePlayerControlable(playerid,toggle,invulnerab ility);
Max
Re: Re : toggle player -
Riddick94 - 04.02.2013
Quote:
Originally Posted by scott1
So wi not simply add an param to the func?
TogglePlayerControlable(playerid,toggle,invulnerab ility);
Max
|
You can script it. But cameramove parameter would be good to have. But there's no chance i guess because in SA we did not seen frozen player with camera movements, only frozen camera and player.
Re: toggle player -
Pottus - 04.02.2013
This is such an annoying fix and really causes problems with existing code that was based around the player not taking damage when TogglePlayerControllable() is used. I don't dispute the decision I dispute not being able to use the the old method.
Re: toggle player -
niCe - 04.02.2013
I also think that some of the functions shouldn't be changed in way how they work, to keep the compatiblity with the scripts.
Re: toggle player -
Jefff - 06.02.2013
Old version TogglePlayerControllable(playerid, toggle); was better and normal ! with no kill! I dont know why he change this omg ;/ better add second function TogglePlayerControllableEx(playerid, toggle); and HERE hp can go down
Re: toggle player -
Bakr - 06.02.2013
Quote:
Originally Posted by Jefff
Old version TogglePlayerControllable(playerid, toggle); was better and normal ! with no kill! I dont know why he change this omg ;/ better add second function TogglePlayerControllableEx(playerid, toggle); and HERE hp can go down
|
Quote:
Originally Posted by Y_Less
Anyway, it is simple enough to hook the function if you do still want the old version.
|
Okay.
Re: toggle player -
Jefff - 06.02.2013
With GetPlayerHealth +TogglePlayerControllable + SetPlayerHealth? xD no thanks ! i want only freeze without chcecking player health
Re: toggle player -
Bakr - 06.02.2013
I'm not even sure if this is the up to date hook method or if this works. I'm just giving you an example (I basically copied and pasted from the tutorial by Lordz™).
pawn Code:
#include <a_samp>
static
Float: g_PlayerToggleHealth[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
g_PlayerToggleHealth[playerid] = 0.00;
CallLocalFunction("L_OnPlayerConnect", "i", playerid);
}
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect L_OnPlayerConnect
forward L_OnPlayerConnect(playerid);
stock TogglePlayerControllableEx(playerid, bool: toggle)
{
if(!toggle && g_PlayerToggleHealth[playerid] == 0.00)
{
GetPlayerHealth(playerid, g_PlayerToggleHealth[playerid]);
SetPlayerHealth(playerid, (Float:0x7F800000));
}
else if(toggle && g_PlayerToggleHealth[playerid] != 0.00)
{
SetPlayerHealth(playerid, g_PlayerToggleHealth[playerid]);
g_PlayerToggleHealth[playerid] = 0.00;
}
TogglePlayerControllable(playerid, toggle);
}
#if defined _ALS_TogglePlayerControllable
#undef TogglePlayerControllable
#else
#define _ALS_TogglePlayerControllable
#endif
#define TogglePlayerControllable TogglePlayerControllableEx