toggle player
#1

is player freeze ( TogglePlayerControllable ) I can kill him, its bug 0.3x or not ?
Reply
#2

Was the function behavior changed in 0.3x? It use to make the frozen player invincible.
Reply
#3

You can use:
pawn Код:
SetPlayerHealth(playerid, (Float:0x7F800000));
0x7F800000 - Is defined as INFINITY in SA:MP...
Reply
#4

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.
Reply
#5

Yes this had to be fixed

for rp dead, afk system ...

Max
Reply
#6

IT IS NOT A BUG.

But what I think should happen is freezing modes / types.
Reply
#7

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).
Reply
#8

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.
Reply
#9

Oh, gotcha. Sorry for the misunderstanding.
Reply
#10

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.
Reply
#11

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.
Reply
#12

No worries, samp dies on every release
Reply
#13

So wi not simply add an param to the func?

TogglePlayerControlable(playerid,toggle,invulnerab ility);

Max
Reply
#14

Quote:
Originally Posted by scott1
View Post
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.
Reply
#15

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.
Reply
#16

I also think that some of the functions shouldn't be changed in way how they work, to keep the compatiblity with the scripts.
Reply
#17

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
Reply
#18

Quote:
Originally Posted by Jefff
View Post
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.
Reply
#19

With GetPlayerHealth +TogglePlayerControllable + SetPlayerHealth? xD no thanks ! i want only freeze without chcecking player health
Reply
#20

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)