SA-MP Forums Archive
Get? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Get? (/showthread.php?tid=187523)



Get? - Bogdanovic - 03.11.2010

There is a Function for GetPlayerToggleControllable? Thanks...


Re: Get? - Haydz - 03.11.2010

Yes, there is.
Quote:

TogglePlayerControllable(playerid, 0); //freeze

TogglePlayerControllable(playerid, 1); //unfreeze




Re: Get? - Grim_ - 03.11.2010

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.


Re: Get? - Retardedwolf - 03.11.2010

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

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



Re: Get? - Haydz - 03.11.2010

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.


Re: Get? - Grim_ - 03.11.2010

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.


Re: Get? - Retardedwolf - 03.11.2010

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?


Re: Get? - Simon - 03.11.2010

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


Re: Get? - Grim_ - 03.11.2010

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.


Re: Get? - Bogdanovic - 03.11.2010

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