nikitafloy Posted April 24, 2014 Posted April 24, 2014 function toggleFRWindow() local currentFreezeStatus = isElementFrozen ( localPlayer ) -- false only if not skinsA[getElementModel(localPlayer)] then if not currentFreezeStatus then if isWindowOpen(wndMain) then showCursor(false) hideAllWindows() colorPicker.closeSelect() else showCursor(true) showAllWindows() end end end end addCommandHandler('fr', toggleFRWindow) Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
Vinctus Posted April 24, 2014 Posted April 24, 2014 replace isWindowOpen with isElement hi i script and stuff
nikitafloy Posted April 24, 2014 Author Posted April 24, 2014 replace isWindowOpen with isElement Not an element. How can I disable Freeroam frozen for a player? Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
Vinctus Posted April 24, 2014 Posted April 24, 2014 setElementFrozen(theguy, false) hi i script and stuff
nikitafloy Posted April 24, 2014 Author Posted April 24, 2014 setElementFrozen(theguy, false) I must check this before visible GUI. Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
Dealman Posted April 24, 2014 Posted April 24, 2014 A GUI Window is an element. Either way, you can use guiGetVisible to check whether it is visible or not. If this is not what you're looking for, I remain greatly confused as to what you're trying to do. If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
nikitafloy Posted April 24, 2014 Author Posted April 24, 2014 A GUI Window is an element.Either way, you can use guiGetVisible to check whether it is visible or not. If this is not what you're looking for, I remain greatly confused as to what you're trying to do. local currentFreezeStatus = isElementFrozen ( localPlayer ) -- false only If a person is frozen, it returns false. I understand that is not an element localPlayer. Then how can I disable a person to use frozen F1? thx. Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
myonlake Posted April 24, 2014 Posted April 24, 2014 If that returns false, then you must make sure you use setElementFrozen when you freeze a player. It should work right now. If I helped you, please click the like button on the right Thanks!
nikitafloy Posted April 24, 2014 Author Posted April 24, 2014 If that returns false, then you must make sure you use setElementFrozen when you freeze a player. It should work right now. Use from admin. addEvent ( "onPlayerFreeze", false ) function aSetPlayerFrozen ( player, state ) if ( toggleAllControls ( player, not state, true, false ) ) then aPlayers[player]["freeze"] = state triggerEvent ( "onPlayerFreeze", player, state ) local vehicle = getPedOccupiedVehicle( player ) if vehicle then setElementFrozen ( vehicle, state ) end return true end return false end Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
myonlake Posted April 24, 2014 Posted April 24, 2014 It doesn't seem to setElementFrozen the player element. Add that in the code. If I helped you, please click the like button on the right Thanks!
Dealman Posted April 24, 2014 Posted April 24, 2014 That freezes the vehicle, not the player. isElementFrozen(getPedOccupiedVehicle(localPlayer)) If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
nikitafloy Posted April 24, 2014 Author Posted April 24, 2014 It doesn't seem to setElementFrozen the player element. Add that in the code. user and vehicle together elseif ( action == "freeze" ) then if ( isPlayerFrozen ( player ) ) then action = "un"..action end aSetPlayerFrozen ( player, not isPlayerFrozen ( player ) ) Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
myonlake Posted April 24, 2014 Posted April 24, 2014 It doesn't make any sense, because the script never executes setElementFrozen on the player element - only on a possible vehicle element, which is very awkward. It does use isElementFrozen though, but yeah, that's not much use when it doesn't even use the native functionality. If I helped you, please click the like button on the right Thanks!
nikitafloy Posted April 24, 2014 Author Posted April 24, 2014 It doesn't make any sense, because the script never executes setElementFrozen on the player element - only on a possible vehicle element, which is very awkward. It does use isElementFrozen though, but yeah, that's not much use when it doesn't even use the native functionality. what can i do? How can I hide for frozen F1 player? Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
myonlake Posted April 24, 2014 Posted April 24, 2014 Replace that old aSetPlayerFrozen with this one. function aSetPlayerFrozen( player, state ) if ( toggleAllControls( player, not state, true, false ) ) then aPlayers[ player ][ "freeze" ] = state setElementFrozen( player, state ) local vehicle = getPedOccupiedVehicle( player ) if ( vehicle ) then setElementFrozen( vehicle, state ) end triggerEvent( "onPlayerFreeze", player, state ) return true end return false end If I helped you, please click the like button on the right Thanks!
nikitafloy Posted April 24, 2014 Author Posted April 24, 2014 Replace that old aSetPlayerFrozen with this one. function aSetPlayerFrozen( player, state ) if ( toggleAllControls( player, not state, true, false ) ) then aPlayers[ player ][ "freeze" ] = state setElementFrozen( player, state ) local vehicle = getPedOccupiedVehicle( player ) if ( vehicle ) then setElementFrozen( vehicle, state ) end triggerEvent( "onPlayerFreeze", player, state ) return true end return false end Thanks, I used what you wrote in the first post. How i can ban cmd for frozen user? addEventHandler("onPlayerCommand", resourceRoot, function(cmd) local accPlayer = getAccountPlayer ( source ) if tonumber(getAccountData ( accPlayer, "jail-time" )) > 0 or isElementFrozen( source ) then cancelEvent() end end) Freeze with: setElementFrozen ( source, true ) Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
myonlake Posted April 24, 2014 Posted April 24, 2014 Try the following. If it does not work, then switch resourceRoot to root. addEventHandler( "onPlayerCommand", resourceRoot, function( cmd ) local playerAccount = getPlayerAccount( source ) local shouldCancel = ( playerAccount and not isGuestAccount( playerAccount ) and getAccountData( playerAccount, "jail-time" ) ) and tonumber( getAccountData( playerAccount, "jail-time" ) ) > 0 or isElementFrozen( source ) if ( shouldCancel ) then cancelEvent( ) end end ) If I helped you, please click the like button on the right Thanks!
nikitafloy Posted April 26, 2014 Author Posted April 26, 2014 Try the following. If it does not work, then switch resourceRoot to root. addEventHandler( "onPlayerCommand", resourceRoot, function( cmd ) local playerAccount = getPlayerAccount( source ) local shouldCancel = ( playerAccount and not isGuestAccount( playerAccount ) and getAccountData( playerAccount, "jail-time" ) ) and tonumber( getAccountData( playerAccount, "jail-time" ) ) > 0 or isElementFrozen( source ) if ( shouldCancel ) then cancelEvent( ) end end ) dont work Нужен скриптер?Benuff Server - Russian Site MTA:SA - Updating, Client, Game, Problem Solving, Help for Russian Players and etc.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now