Jump to content

Editing bombshopadv


deathrat

Recommended Posts

Posted

Is there a way to edit the Bombshopadv script, to make it so when an admin types in a command, it will pop up the GUI so that they can buy a bomb no matter where they are?

Posted (edited)

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
Posted

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.

Posted

Gah, I've tried everything I can think of to try and get this to work, but when I type in the command, it doesn't do anything, doesn't even give any errors in the server console. :?

Posted
Maybe you should first post your code and then we can tell you what you have done wrong.

Well, I tried multiple things, and after none of them worked, I deleted it and kinda just gave up, but I guess I could try to redo it...

Posted

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.

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