Help about, something better then TogglePlayerControllable
#1

Ok, here's my question, When i use TogglePlayerControllable(playerid, false); It totaly toggles the controllable to 0,
but i want that the player still can get damage and can rotate the camera.

Is there a function or some sort, to do this?

P.S. I am dutch so my English may be rubbish sometimes.
Reply
#2

I think it's impossible.
Reply
#3

Make a timer and constantly set his position to one spot
Reply
#4

Quote:
Originally Posted by .:NoZer0:.
Ok, here's my question, When i use TogglePlayerControllable(playerid, false); It totaly toggles the controllable to 0,
but i want that the player still can get damage and can rotate the camera.

Is there a function or some sort, to do this?

P.S. I am dutch so my English may be rubbish sometimes.
no not yet maybe in 0.3 it will allow damage. while your players TogglePlayerControllable(playerid, false);

Quote:
Originally Posted by dice7
Make a timer and constantly set his position to one spot
that would waste a lot of time doing that.


what are you trying to do toggle some one and shoot them?? or just testing?
Reply
#5

Shady91, what are you on?
There's no change in TogglePlayerControllable() noted for 0.3 release and there won't be since the function is used in many places and would probably screw up some scripts.
Also, how is it a waste of time to set one player to a certain position? :/
Reply
#6

Quote:
Originally Posted by Shady91
Quote:
Originally Posted by dice7
Make a timer and constantly set his position to one spot
that would waste a lot of time doing that.
Really? I don't think you would need a lot of time to create a timer (SetTimer/SetTimerEx) with SetPlayerPos.
Reply
#7

Quote:
Originally Posted by Frankylez
Shady91, what are you on?
There's no change in TogglePlayerControllable() noted for 0.3 release and there won't be since the function is used in many places and would probably screw up some scripts.
Also, how is it a waste of time to set one player to a certain position? :/
i didnt say there was any change in it and if this guy couldnt figure that he had to Make a timer and constantly set his position to one spot then it probly 95% chance he dosent no how to so to save him the time or trying i said there no point and i wanted to no why he wanted to make damage to someone while there TogglePlayerControllable(0).
Reply
#8

Maybe this way could work (didn't tried it): set one of the animations on the player and at OnPlayerKeyStateChange return 0 if he tries to cancel the animation. He should get hurted while he is playing an animation.
Reply
#9

try this
pawn Код:
// put this in the top of the script
new fTimer[MAX_PLAYERS];

stock JA_TogglePlayerControllable(playerid, bool:toggle)
{
    switch(toggle)
    {
      case true: { fTimer[playerid] = SetTimerEx("FreezePlayer", 1, true, "i", playerid); }
      case false: { KillTimer(fTimer[playerid]); }
    }
    return 1;
}

forward FreezePlayer(playerid);
public FreezePlayer(playerid)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X, Y, Z);
    SetCameraBehindPlayer(playerid);
    return 1;
}
now when you like to freeze the player
use "JA_TogglePlayerControllable(playerid, toggle);"
Reply
#10

Quote:
Originally Posted by ► James_Alex
try this
pawn Код:
// put this in the top of the script
new fTimer[MAX_PLAYERS];

stock JA_TogglePlayerControllable(playerid, bool:toggle)
{
    switch(toggle)
    {
      case true: { fTimer[playerid] = SetTimerEx("FreezePlayer", 1, true, "i", playerid); }
      case false: { KillTimer(fTimer[playerid]); }
    }
    return 1;
}

forward FreezePlayer(playerid);
public FreezePlayer(playerid)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X, Y, Z);
    SetCameraBehindPlayer(playerid);
    return 1;
}
now when you like to freeze the player
use "JA_TogglePlayerControllable(playerid, toggle);"
I tried that too, it worked but it isn't the nicest solution because Timers eat server recources.
That's why i posted this question, i wanted to know if there where other solutions.

I am now trying with the Animation idea of Don Correlli
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)