Scripting/Squirrel/Functions/Players/IsSyncBlocked
From VC-MP Wiki
Returns if the player is syncblocked. You can either get or set the value.
Contents |
Syntax
bool Player.IsSyncBlocked
Player.IsSyncBlocked = bool
Arguments
- bool - Toggle the syncblock to on (true) or off (false)
Example
This command will return if the player is syncblocked.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "syncblock" ) { if ( player.IsSyncBlocked == false ) MessagePlayer( "You are not syncblocked.", player ); else if ( player.IsSyncBlocked == true ) MessagePlayer( "You are syncblocked.", player ); } }
Example 2
This command will syncblock the player.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "iblock" ) { player.IsSyncBlocked = true; } }
and this command will disable the syncblock:
function onPlayerCommand( player, cmd, text ) { if ( cmd == "iunlock" ) { player.IsSyncBlocked = false; } }
Notes
The call onPlayerCommand and function MessagePlayer were used in these examples. More info about it on its page.
