#1

There is a Function for GetPlayerToggleControllable? Thanks...
Reply
#2

Yes, there is.
Quote:

TogglePlayerControllable(playerid, 0); //freeze

TogglePlayerControllable(playerid, 1); //unfreeze

Reply
#3

There is no native function for that. However, you can make one yourself.

Simply hook the function TogglePlayerControllable, and depending on the result, set a variable for the player. Then you can make a custom function "GetPlayerToggleControllable" to return that variable.

This thread would help you with hooking the function: https://sampforum.blast.hk/showthread.php?tid=187195

EDIT:

@Hayden: He's trying to get the toggle, not set it.
Reply
#4

pawn Код:
stock
    togglePlayerControllableEx ( playerid , toggle )
{
    SetPVarInt ( playerid , "Controllable", toggle );
    TogglePlayerControllable ( playerid, toggle );
}

stock
    getPlayerControlStatus ( playerid )
{
    return GetPVarInt ( playerid, "Controllable", toggle );
}
Reply
#5

Quote:
Originally Posted by Grim_
Посмотреть сообщение
There is no native function for that. However, you can make one yourself.

Simply hook the function TogglePlayerControllable, and depending on the result, set a variable for the player. Then you can make a custom function "GetPlayerToggleControllable" to return that variable.

This thread would help you with hooking the function: https://sampforum.blast.hk/showthread.php?tid=187195

EDIT:

@Hayden: He's trying to get the toggle, not set it.
oh crap, didn't read the question properly.
Reply
#6

Forget my complicated method, just use what RetardedWolf has posted.

Irrelevant: This forum requires that you wait 120 seconds between posts. Please try again in 6 seconds.
Reply
#7

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Forget my complicated method, just use what RetardedWolf has posted.

Irrelevant: This forum requires that you wait 120 seconds between posts. Please try again in 6 seconds.
Would there be any differences if you hook it?
Reply
#8

The difference would be that you could still use TogglePlayerControllable rather than a completely different function.
Reply
#9

No, they would do the exact same thing, except with hooking the function you can maintain the original function's name.

This forum requires that you wait 120 seconds between posts. Please try again in 56 seconds.

^ Always late due to that damn thing.
Reply
#10

Ahn Ok, i had not thought, Thanks for Help Hayden_Bruin and Grim_.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)