deathrat Posted August 24, 2009 Share Posted August 24, 2009 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? Link to comment
Dark Dragon Posted August 24, 2009 Share Posted August 24, 2009 yes, just search for the function which opens the gui, it should work when you call this function with a command handler and edit the parameter to fit the syntax Link to comment
Gamesnert Posted August 24, 2009 Share Posted August 24, 2009 (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 August 24, 2009 by Guest Link to comment
Vercetti1010 Posted August 24, 2009 Share Posted August 24, 2009 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
deathrat Posted August 24, 2009 Author Share Posted August 24, 2009 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. Link to comment
deathrat Posted August 26, 2009 Author Share Posted August 26, 2009 Would anyone mind posting the code, so I can see what I've been doing wrong, and what it's supposed to look like? Link to comment
iChris Posted August 26, 2009 Share Posted August 26, 2009 Maybe you should first post your code and then we can tell you what you have done wrong. Link to comment
deathrat Posted August 26, 2009 Author Share Posted August 26, 2009 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... Link to comment
iChris Posted August 26, 2009 Share Posted August 26, 2009 Would be better if you redo it, because then we can guide you in the right direction and you will learn from your mistakes. Link to comment
deathrat Posted August 26, 2009 Author Share Posted August 26, 2009 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
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