Jump to content

gui problem + one other :/


K4stic

Recommended Posts

Posted

1. The problem is then an VIP type the command it show the gui to all :/

--Client side

function bind_key() 
 guiSetVisible(window, true) 
 showCursor(true) 
end 
addEvent( "GUIsee", true ) 
addEventHandler ( "GUIsee", getRootElement(), bind_key ) 

--Server side

function gui(player) 
    if vipGUI and exports.SCGvip:isPlayerVIP(player) then 
    triggerClientEvent ( "GUIsee", getRootElement()) 
  end 
end 
addCommandHandler ( "viphats", gui) 

2. This then player type command and is VIP ot give him Jetpack but if player type again is not removed :/

--Server side

function giveVIPJetpack( thePlayer, commandName ) 
  if giveVIPJetpack and exports.SCGvip:isPlayerVIP( thePlayer ) then 
    if ( not doesPedHaveJetPack( thePlayer ) ) then 
      givePedJetPack ( thePlayer ) 
      outputChatBox("VIP: Jetpack enabled", thePlayer, 0, 250, 0) 
    end 
  else 
  if doesPedHaveJetPack( thePlayer ) then 
    removePedJetPack ( thePlayer ) 
    outputChatBox( "VIP: Jetpack removed", thePlayer, 250, 0, 0 ) 
    end 
  end 
end 
addCommandHandler( "vipjetpack", giveVIPJetpack ) 

Posted
function gui(player) 
    if vipGUI and exports.SCGvip:isPlayerVIP(player) then 
        triggerClientEvent(player, "GUIsee", player) 
    end 
end 
addCommandHandler("viphats", gui) 

function giveVIPJetpack(thePlayer) 
    if giveVIPJetpack and exports.SCGvip:isPlayerVIP(thePlayer) then 
        if not doesPedHaveJetPack(thePlayer) then 
            givePedJetPack(thePlayer) 
            outputChatBox("VIP: Jetpack enabled", thePlayer, 0, 250, 0) 
        else 
            removePedJetPack(thePlayer) 
            outputChatBox("VIP: Jetpack removed", thePlayer, 250, 0, 0) 
        end 
    end 
end 
addCommandHandler("vipjetpack", giveVIPJetpack) 

Posted

thx will try now :)

can you help me and with this? :)

function vipKnockedOff ( player, command ) 
if exports.SCGvip:isPlayerVIP(player) then 
    if canPedBeKnockedOffBike ( getLocalPlayer() ) then 
        setPlayerCanBeKnockedOffBike ( getLocalPlayer(), false ) 
        outputChatBox ( "Now you can't be knocked off your bike." ) 
    else 
        setPlayerCanBeKnockedOffBike ( getLocalPlayer(), true ) 
        outputChatBox ( "Now you can be knocked off your bike." ) 
    end 
  end 
end 
addCommandHandler ( "vipknock", vipKnockedOff ) 

Posted
thx will try now :)

can you help me and with this? :)

function vipKnockedOff ( player, command ) 
if exports.SCGvip:isPlayerVIP(player) then 
    if canPedBeKnockedOffBike ( getLocalPlayer() ) then 
        setPlayerCanBeKnockedOffBike ( getLocalPlayer(), false ) 
        outputChatBox ( "Now you can't be knocked off your bike." ) 
    else 
        setPlayerCanBeKnockedOffBike ( getLocalPlayer(), true ) 
        outputChatBox ( "Now you can be knocked off your bike." ) 
    end 
  end 
end 
addCommandHandler ( "vipknock", vipKnockedOff ) 

'

SetPedCanBeKnockedOffBike

Posted
thx will try now

can you help me and with this?

function vipKnockedOff ( player, command ) 
if exports.SCGvip:isPlayerVIP(player) then 
    if canPedBeKnockedOffBike ( getLocalPlayer() ) then 
        setPlayerCanBeKnockedOffBike ( getLocalPlayer(), false ) 
        outputChatBox ( "Now you can't be knocked off your bike." ) 
    else 
        setPlayerCanBeKnockedOffBike ( getLocalPlayer(), true ) 
        outputChatBox ( "Now you can be knocked off your bike." ) 
    end 
  end 
end 
addCommandHandler ( "vipknock", vipKnockedOff ) 

Do you know that addCommandHandler client side does not have player parameter?

Does your function isPlayerVIP available client side?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...