Jump to content

Editing bombshopadv


deathrat

Recommended Posts

Server:

- hasObjectPermissionTo

- triggerClientEvent

Client:

- Nothing for as far as I can see...

Make a new script, seeing from the code, it doesn't matter what resource it is in. Make a function with a command handler and check with hasObjectPermissionTo if it has permission to a certain action in your ACL.xml. For this, you can add these lines for instance...

"resource.bombshop.openGUIDirectly""false" <!-- To the class default -->
"resource.bombshop.openGUIDirectly""true" <!-- To the minimum class required to use the GUI -->

After that, if the player has proven himself rightful enough to use the command, use triggerClientEvent(playerHere,"gui_bombshopEnter",player,10000)

Edited by Guest
Link to comment

Look in the script for the function that starts the set of events. Then all you would have to do is add a command handler and make it call that function. You might have to toy around with it to get the variables to work with both onColShapeHit and addCommandHandler though. If you figure it out, make sure you add the bomb shop resource under your admin group in your ACL and protect the command.

Link to comment

Edit: I ended up getting it to work, thanks everyone.

function openGUIDirectly ( playerSource, res )
if ( hasObjectPermissionTo ( playerSource, "resource.bombshop.openGUIDirectly", true ) ) then
triggerClientEvent( playerSource, "gui_bombshopEnter", playerSource, 0)
else return end
end
 
addCommandHandler ( "bombshopgui", openGUIDirectly )

Although now I'm having a problem where after hit a bind for the command, either the window doesn't pop up unless you hit console or something that enables the cursor, or it pops up but the cursor is disabled.

Link to comment

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...