BolonZX Posted January 25, 2014 Posted January 25, 2014 Well I'm trying to make a car panel for my server I already created the server and client scripts but whenerver I click on the button nothing happens I did debugscript 3 and it shows no errors here is the code: server function nissann ( thePlayer ) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..account, aclGetGroup ( "TougeRushers" ) ) then local xp,yp,zp = getElementPosition ( thePlayer ) createVehicle ( 426, x, y, z + 10 ) outputChatBox ( "Aqui esta su vehiculo BolonZX", thePlayer ) else blowVehicle () outputChatBox ( "Este Vehiculo pertenece a BolonZX", thePlayer ) end end addEvent( "OnNissanEnter", true ) addEventHandler( "OnNissanEnter", getRootElement(), nissann ) client function touge() PanelTouge = guiCreateWindow ( 341, 204, 292, 495, "TougeRushers Carros", false ) guiSetProperty(PanelTouge, "CaptionColour", "FFD90000") guiWindowSetSizable(PanelTouge, false) showCursor (true) nissanr32 = guiCreateButton(24, 41, 63, 46, "Nissan Skyline GTR R32", false, PanelTouge) brz = guiCreateButton(24, 101, 63, 46, "Subaru BRZ", false, PanelTouge) nissanr35 = guiCreateButton(24, 161, 63, 46, "Nissan Skyline GTR R35", false, PanelTouge) memotext = guiCreateMemo(39, 432, 203, 53, "Estos son los carros oficiales del\nequipo |TougeRushers|", false, PanelTouge) guiMemoSetReadOnly(memotext, true) showCursor (true) addEventHandler ( "OnClientGUIClick", nissanr32, nissann, false ) end addCommandHandler ("tougecars", touge) function nissann () showCursor (true) triggerServerEvent ( "OnNissanEnter", getLocalPlayer() ) end In-game name: |-FMJ-|
xXMADEXx Posted January 25, 2014 Posted January 25, 2014 There may be more errors, but the only one I found was you needed another "getLocalPlayer ( )" function touge() PanelTouge = guiCreateWindow ( 341, 204, 292, 495, "TougeRushers Carros", false ) guiSetProperty(PanelTouge, "CaptionColour", "FFD90000") guiWindowSetSizable(PanelTouge, false) showCursor (true) nissanr32 = guiCreateButton(24, 41, 63, 46, "Nissan Skyline GTR R32", false, PanelTouge) brz = guiCreateButton(24, 101, 63, 46, "Subaru BRZ", false, PanelTouge) nissanr35 = guiCreateButton(24, 161, 63, 46, "Nissan Skyline GTR R35", false, PanelTouge) memotext = guiCreateMemo(39, 432, 203, 53, "Estos son los carros oficiales del\nequipo |TougeRushers|", false, PanelTouge) guiMemoSetReadOnly(memotext, true) showCursor (true) addEventHandler ( "OnClientGUIClick", nissanr32, nissann, false ) end addCommandHandler ("tougecars", touge) function nissann () showCursor (true) triggerServerEvent ( "OnNissanEnter", getLocalPlayer ( ), getLocalPlayer ( ) ) end The Ultimate Lua Tutorial! | MTA PHP SDK
BolonZX Posted January 25, 2014 Author Posted January 25, 2014 no still nothing In-game name: |-FMJ-|
DNL291 Posted January 25, 2014 Posted January 25, 2014 Client function touge() PanelTouge = guiCreateWindow ( 341, 204, 292, 495, "TougeRushers Carros", false ) guiSetProperty(PanelTouge, "CaptionColour", "FFD90000") guiWindowSetSizable(PanelTouge, false) guiSetVisible(PanelTouge, false) nissanr32 = guiCreateButton(24, 41, 63, 46, "Nissan Skyline GTR R32", false, PanelTouge) brz = guiCreateButton(24, 101, 63, 46, "Subaru BRZ", false, PanelTouge) nissanr35 = guiCreateButton(24, 161, 63, 46, "Nissan Skyline GTR R35", false, PanelTouge) memotext = guiCreateMemo(39, 432, 203, 53, "Estos son los carros oficiales del\nequipo |TougeRushers|", false, PanelTouge) guiMemoSetReadOnly(memotext, true) addEventHandler ( "onClientGUIClick", nissanr32, nissann, false ) addCommandHandler("tougecars", toggleWindow) end addEventHandler("onClientResourceStart", resourceRoot, touge) function toggleWindow() guiSetVisible(PanelTouge, not guiGetVisible(PanelTouge)) showCursor(guiGetVisible(PanelTouge)) end function nissann() triggerServerEvent ( "OnNissanEnter", getLocalPlayer() ) toggleWindow() end Server function nissann () local account = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..account, aclGetGroup ( "TougeRushers" ) ) then local xp,yp,zp = getElementPosition ( source ) createVehicle ( 426, xp, yp, zp + 10 ) outputChatBox ( "Aqui esta su vehiculo BolonZX", source ) else outputChatBox ( "Este Vehiculo pertenece a BolonZX", source ) end end addEvent( "OnNissanEnter", true ) addEventHandler( "OnNissanEnter", getRootElement(), nissann ) Please do not PM me with scripting related question nor support, use the forums instead.
BolonZX Posted January 25, 2014 Author Posted January 25, 2014 nop nothing at all In-game name: |-FMJ-|
BolonZX Posted January 25, 2014 Author Posted January 25, 2014 But thanks for the help guys In-game name: |-FMJ-|
DNL291 Posted January 25, 2014 Posted January 25, 2014 I've tested and it worked for me. Try copying my code again. Please do not PM me with scripting related question nor support, use the forums instead.
BolonZX Posted January 25, 2014 Author Posted January 25, 2014 Okay I will mate In-game name: |-FMJ-|
BolonZX Posted January 25, 2014 Author Posted January 25, 2014 It works Thank you very much!!! In-game name: |-FMJ-|
DNL291 Posted January 25, 2014 Posted January 25, 2014 You're welcome. Please do not PM me with scripting related question nor support, use the forums instead.
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