Fox261098 Posted June 29, 2016 Share Posted June 29, 2016 I made vip panel but when i type /vip nothing happens here is code : GUIEditor = {button = {},window = {},edit = {}} Show = {} addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(185, 5, 382, 600, "-x[ Vip Panel #By LuckyDude ]x-", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF19FBFF") GUIEditor.button[1] = guiCreateButton(17, 41, 165, 49, "Health +100", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFD0101") GUIEditor.button[2] = guiCreateButton(201, 41, 165, 49, "Armor +100", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF007577") GUIEditor.button[3] = guiCreateButton(18, 120, 348, 45, "Vip Car", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF16EE10") GUIEditor.button[4] = guiCreateButton(18, 175, 348, 45, "Fly With Car", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFDCE916") GUIEditor.button[5] = guiCreateButton(18, 230, 348, 45, "Drive On Water", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FF0F0AF4") GUIEditor.button[6] = guiCreateButton(18, 285, 348, 45, "Invisible Skin", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFC928DC") GUIEditor.button[7] = guiCreateButton(18, 340, 348, 45, "Invisible Car", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FF3493A4") GUIEditor.button[8] = guiCreateButton(18, 395, 348, 45, "Vip Weapon (Minigun)", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FF68785F") GUIEditor.button[9] = guiCreateButton(18, 450, 348, 45, "Vip Skin", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FF63B771") GUIEditor.button[10] = guiCreateButton(18, 505, 348, 45, "High Jump", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FF4D2454") GUIEditor.label[1] = guiCreateLabel(18, 565, 235, 30, "Vip Panel by: LuckyDude", false, GUIEditor.window[1]) addCommandHandler ("skinpanel",gui) guiSetVisible (GUIEditor.window[1], false) --- Events addEventHandler("onClientGUIClick", GUIEditor.button[1], setCrysis, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], regenArmor , false) addEventHandler("onClientGUIClick", GUIEditor.button[3], vipcar, false) addEventHandler("onClientGUIClick", GUIEditor.button[4], fly, false) addEventHandler("onClientGUIClick", GUIEditor.button[5], hover, false) addEventHandler("onClientGUIClick", GUIEditor.button[6], toggleInvis, false) addEventHandler("onClientGUIClick", GUIEditor.button[7], invisibility, false) addEventHandler("onClientGUIClick", GUIEditor.button[8], vipweap, false) addEventHandler("onClientGUIClick", GUIEditor.button[9], setvip, false) addEventHandler("onClientGUIClick", GUIEditor.button[10], highjump, false) end) --- function regenArmor() for _,player in ipairs(getElementsByType("player")) do local arm = getPedArmor(player); if arm < 100 then local nuarm = arm + 10; if nuarm > 100 then nuarm = 100; end setPedArmor(player,nuarm) end function fly() if not flyEnabled then setWorldSpecialPropertyEnabled ( "aircars", true ) flyEnabled = true else setWorldSpecialPropertyEnabled ( "aircars", false ) flyEnabled = false end function hover () if not isWorldSpecialPropertyEnabled( "hovercars" ) then outputChatBox("Water drive: on ", 255, 255, 0 ) else setWorldSpecialPropertyEnabled( "hovercars", false ) end function highjump () if not isWorldSpecialPropertyEnabled( "extrajump" ) then setWorldSpecialPropertyEnabled( "extrajump", true ) else setWorldSpecialPropertyEnabled( "extrajump", false ) end function invisibility () if(getElementAlpha(source) > 200) then setElementAlpha(getPedOccupiedVehicle(source), 0) else setElementAlpha(getPedOccupiedVehicle(source), 255) end function toggleInvis () if getElementAlpha( thePlayer ) == 0 then setElementAlpha ( thePlayer, 0 ) else setElementAlpha ( thePlayer, 255 end unction setvip () screamTXD = engineLoadTXD("vip.txd") engineImportTXD(vipTXD, 25 ) screamDFF = engineLoadDFF("vip.dff") engineReplaceModel(vipDFF, 25) setElementModel(localPlayer,25) end function vipcar () local luckyBugger = getLocalPlayer() local x, y, z = getElementPosition ( luckyBugger ) createVehicle ( 411, x, y, z + 10 ) end function vipweap () giveWeapon ( source, 38, 5000 ) end --- Show.dX_ = function() Show.dx = (not Show.dx) removeEventHandler("onClientRender",root, dx) if (Show.dx) then addEventHandler("onClientRender",root, dx) end end function gui( ) guiSetVisible (GUIEditor.window[1],not guiGetVisible (GUIEditor.window[1])) showCursor (guiGetVisible (GUIEditor.window[1])) Show.dX_() end Link to comment
Simple0x47 Posted June 29, 2016 Share Posted June 29, 2016 Yeah because the event is triggered when the Client starts the resource (when the resource is started in server or when the client enters into the server). You should remove the event and define a function with identifier. Link to comment
Bean666 Posted June 29, 2016 Share Posted June 29, 2016 function toggleInvis () if getElementAlpha( thePlayer ) == 0 then setElementAlpha ( thePlayer, 0 ) else setElementAlpha ( thePlayer, 255 end this won't work i think try replacing with this: i suggest using serverside for the invisiblity tho, but here's client side. function toggleInvis ( ) local n = ( getElementAlpha ( localPlayer ) > 0 ) and 0 or 255; setElementAlpha ( localPlayer, n ); end Link to comment
Captain Cody Posted June 29, 2016 Share Posted June 29, 2016 The invisibly thing was just fine other then the fact that it's a bit screwed up for the task he's working for. #1 This sets his invisibly to 0 if it's already 0. #2 It's client side, won't do any good for other players. #3 You're missing a few ends. Any ways as for the other parts of the code. You need to make the GUI a function instead of on a onClientResourceStart even handler. Link to comment
Fox261098 Posted June 29, 2016 Author Share Posted June 29, 2016 I was trying too much but didnt fix it Link to comment
Captain Cody Posted June 29, 2016 Share Posted June 29, 2016 I've found multiple mistakes you have made, working on fixing them now. Link to comment
Bean666 Posted June 29, 2016 Share Posted June 29, 2016 (edited) i suggest using triggerServerEvent for the invisibility, because localPlayer is only for the localPlayer so other players might won't see you as invisible. this is serverside: function toggleInvis ( player ) if getElementAlpha( player ) == 255 then setElementAlpha ( player, 0 ) else setElementAlpha ( player, 255 ) end addEvent("toggleInvis", true) addEventHandler("toggleInvis", getRootElement(), toggleInvis) ' this could work. or maybe this too(you could use elseif if you want but this method could work): function toggleInvis ( player ) local alpha = getElementAlpha(player) if alpha == 255 then setElementAlpha(player, 0) end if alpha == 0 then setElementAlpha(player, 255) end addEvent("toggleInvis", true) addEventHandler("toggleInvis", getRootElement(), toggleInvis) Client: function toggleInvis () triggerServerEvent("toggleInvis", getLocalPlayer(), toggleInvis) end Edited June 29, 2016 by Guest Link to comment
Captain Cody Posted June 29, 2016 Share Posted June 29, 2016 Client = Button = {} function openThePanel () if not MainWindow then showCursor(true) MainWindow = guiCreateWindow(185, 5, 382, 600, "-x[ Vip Panel #By LuckyDude ]x-", false) guiWindowSetSizable(MainWindow, false) guiSetProperty(MainWindow, "CaptionColour", "FF19FBFF") Button[1] = guiCreateButton(17, 41, 165, 49, "Health +100", false, MainWindow) guiSetProperty(Button[1], "NormalTextColour", "FFFD0101") Button[2] = guiCreateButton(201, 41, 165, 49, "Armor +100", false, MainWindow) guiSetProperty(Button[2], "NormalTextColour", "FF007577") Button[3] = guiCreateButton(18, 120, 348, 45, "Vip Car", false, MainWindow) guiSetProperty(Button[3], "NormalTextColour", "FF16EE10") Button[4] = guiCreateButton(18, 175, 348, 45, "Fly With Car", false, MainWindow) guiSetProperty(Button[4], "NormalTextColour", "FFDCE916") Button[5] = guiCreateButton(18, 230, 348, 45, "Drive On Water", false, MainWindow) guiSetProperty(Button[5], "NormalTextColour", "FF0F0AF4") Button[6] = guiCreateButton(18, 285, 348, 45, "Invisible Skin", false, MainWindow) guiSetProperty(Button[6], "NormalTextColour", "FFC928DC") Button[7] = guiCreateButton(18, 340, 348, 45, "Invisible Car", false, MainWindow) guiSetProperty(Button[7], "NormalTextColour", "FF3493A4") Button[8] = guiCreateButton(18, 395, 348, 45, "Vip Weapon (Minigun)", false, MainWindow) guiSetProperty(Button[8], "NormalTextColour", "FF68785F") Button[9] = guiCreateButton(18, 450, 348, 45, "Vip Skin", false, MainWindow) guiSetProperty(Button[9], "NormalTextColour", "FF63B771") Button[10] = guiCreateButton(18, 505, 348, 45, "High Jump", false, MainWindow) guiSetProperty(Button[10], "NormalTextColour", "FF4D2454") GUIEditor.label[1] = guiCreateLabel(18, 565, 235, 30, "Vip Panel by: LuckyDude", false, MainWindow) guiSetVisible (MainWindow, false) --- Events addEventHandler("onClientGUIClick", Button[1], setCrysis, false) addEventHandler("onClientGUIClick", Button[2], regenArmor , false) addEventHandler("onClientGUIClick", Button[3], vipcar, false) addEventHandler("onClientGUIClick", Button[4], fly, false) addEventHandler("onClientGUIClick", Button[5], hover, false) addEventHandler("onClientGUIClick", Button[6], toggleInvis, false) addEventHandler("onClientGUIClick", Button[7], invisibility, false) addEventHandler("onClientGUIClick", Button[8], vipweap, false) addEventHandler("onClientGUIClick", Button[9], setvip, false) addEventHandler("onClientGUIClick", Button[10], highjump, false) else destroyElement(MainWindow) MainWindow = nil showCursor(false) end end addCommandHandler ("skinpanel",openThePanel) ----------- NEEDS TO BE ADDED SERVER function regenArmor() triggerServerEvent ("setArmour", resourceRoot) end flyEnabled = false function fly() if not flyEnabled then setWorldSpecialPropertyEnabled ( "aircars", true ) flyEnabled = true else setWorldSpecialPropertyEnabled ( "aircars", false ) flyEnabled = false end end function hover () if not isWorldSpecialPropertyEnabled( "hovercars" ) then outputChatBox("Water drive: on ", 255, 255, 0 ) setWorldSpecialPropertyEnabled( "hovercars", true ) else outputChatBox("Water drive: off ", 255, 255, 0 ) setWorldSpecialPropertyEnabled( "hovercars", false ) end end function highjump () if not isWorldSpecialPropertyEnabled( "extrajump" ) then setWorldSpecialPropertyEnabled( "extrajump", true ) else setWorldSpecialPropertyEnabled( "extrajump", false ) end end function invisibility () triggerServerEvent ("setInvisiblity", resourceRoot) -- Same as below?? \/ end function toggleInvis () triggerServerEvent ("setInvisiblity", resourceRoot) -- Same as above?? /\ end screamTXD = engineLoadTXD("vip.txd") engineImportTXD(vipTXD, 25 ) screamDFF = engineLoadDFF("vip.dff") engineReplaceModel(vipDFF, 25) --- Loads for everyone -- function setvip () triggerServerEvent ("setElementModelClient", resourceRoot) end function vipcar () triggerServerEvent ("GiveVIPCar", resourceRoot) end function vipweap () triggerServerEvent ("GiveVIPGun", resourceRoot) end --- showingDX = false function showDX() --- Not sure what this is used for, but it'll actually work now if showingDX then removeEventHandler("onClientRender",root, dx) else addEventHandler("onClientRender",root, dx) end end Server = function setArmour() for _,player in ipairs(getElementsByType("player")) do local arm = getPedArmor(player) if arm < 100 then local nuarm = arm + 10 elseif nuarm > 100 then local nuarm = 100 end setPedArmor(player,nuarm) end end addEvent( "setArmour", true ) addEventHandler( "setArmour", resourceRoot, setArmour) function invisibility () if(getElementAlpha(client) > 200) then setElementAlpha(getPedOccupiedVehicle(client), 0) else setElementAlpha(getPedOccupiedVehicle(client), 255) end end addEvent( "setInvisiblity", true ) addEventHandler( "setInvisiblity", resourceRoot, invisibility) function SetHisModel () setElementModel(client,25) end addEvent( "setElementModelClient", true ) addEventHandler( "setElementModelClient", resourceRoot, SetHisModel) function GiveHimCar () local x, y, z = getElementPosition ( client ) local vehicle = createVehicle ( 411, x, y, z + 10 ) warpPedIntoVehicle(client,vehicle) end addEvent( "GiveVIPCar", true ) addEventHandler( "GiveVIPCar", resourceRoot, GiveHimCar) function GiveHimGun () giveWeapon ( client, 38, 5000 ) end addEvent( "GiveVIPGun", true ) addEventHandler( "GiveVIPGun", resourceRoot, GiveHimGun) Make sure to add it to the meta file. And remember, client side == Only that player, not everyone. And @Shaman123 there was more then that needed to be server side. Link to comment
Fox261098 Posted June 29, 2016 Author Share Posted June 29, 2016 Client = Button = {} function openThePanel () if not MainWindow then showCursor(true) MainWindow = guiCreateWindow(185, 5, 382, 600, "-x[ Vip Panel #By LuckyDude ]x-", false) guiWindowSetSizable(MainWindow, false) guiSetProperty(MainWindow, "CaptionColour", "FF19FBFF") Button[1] = guiCreateButton(17, 41, 165, 49, "Health +100", false, MainWindow) guiSetProperty(Button[1], "NormalTextColour", "FFFD0101") Button[2] = guiCreateButton(201, 41, 165, 49, "Armor +100", false, MainWindow) guiSetProperty(Button[2], "NormalTextColour", "FF007577") Button[3] = guiCreateButton(18, 120, 348, 45, "Vip Car", false, MainWindow) guiSetProperty(Button[3], "NormalTextColour", "FF16EE10") Button[4] = guiCreateButton(18, 175, 348, 45, "Fly With Car", false, MainWindow) guiSetProperty(Button[4], "NormalTextColour", "FFDCE916") Button[5] = guiCreateButton(18, 230, 348, 45, "Drive On Water", false, MainWindow) guiSetProperty(Button[5], "NormalTextColour", "FF0F0AF4") Button[6] = guiCreateButton(18, 285, 348, 45, "Invisible Skin", false, MainWindow) guiSetProperty(Button[6], "NormalTextColour", "FFC928DC") Button[7] = guiCreateButton(18, 340, 348, 45, "Invisible Car", false, MainWindow) guiSetProperty(Button[7], "NormalTextColour", "FF3493A4") Button[8] = guiCreateButton(18, 395, 348, 45, "Vip Weapon (Minigun)", false, MainWindow) guiSetProperty(Button[8], "NormalTextColour", "FF68785F") Button[9] = guiCreateButton(18, 450, 348, 45, "Vip Skin", false, MainWindow) guiSetProperty(Button[9], "NormalTextColour", "FF63B771") Button[10] = guiCreateButton(18, 505, 348, 45, "High Jump", false, MainWindow) guiSetProperty(Button[10], "NormalTextColour", "FF4D2454") GUIEditor.label[1] = guiCreateLabel(18, 565, 235, 30, "Vip Panel by: LuckyDude", false, MainWindow) guiSetVisible (MainWindow, false) --- Events addEventHandler("onClientGUIClick", Button[1], setCrysis, false) addEventHandler("onClientGUIClick", Button[2], regenArmor , false) addEventHandler("onClientGUIClick", Button[3], vipcar, false) addEventHandler("onClientGUIClick", Button[4], fly, false) addEventHandler("onClientGUIClick", Button[5], hover, false) addEventHandler("onClientGUIClick", Button[6], toggleInvis, false) addEventHandler("onClientGUIClick", Button[7], invisibility, false) addEventHandler("onClientGUIClick", Button[8], vipweap, false) addEventHandler("onClientGUIClick", Button[9], setvip, false) addEventHandler("onClientGUIClick", Button[10], highjump, false) else destroyElement(MainWindow) MainWindow = nil showCursor(false) end end addCommandHandler ("skinpanel",openThePanel) ----------- NEEDS TO BE ADDED SERVER function regenArmor() triggerServerEvent ("setArmour", resourceRoot) end flyEnabled = false function fly() if not flyEnabled then setWorldSpecialPropertyEnabled ( "aircars", true ) flyEnabled = true else setWorldSpecialPropertyEnabled ( "aircars", false ) flyEnabled = false end end function hover () if not isWorldSpecialPropertyEnabled( "hovercars" ) then outputChatBox("Water drive: on ", 255, 255, 0 ) setWorldSpecialPropertyEnabled( "hovercars", true ) else outputChatBox("Water drive: off ", 255, 255, 0 ) setWorldSpecialPropertyEnabled( "hovercars", false ) end end function highjump () if not isWorldSpecialPropertyEnabled( "extrajump" ) then setWorldSpecialPropertyEnabled( "extrajump", true ) else setWorldSpecialPropertyEnabled( "extrajump", false ) end end function invisibility () triggerServerEvent ("setInvisiblity", resourceRoot) -- Same as below?? \/ end function toggleInvis () triggerServerEvent ("setInvisiblity", resourceRoot) -- Same as above?? /\ end screamTXD = engineLoadTXD("vip.txd") engineImportTXD(vipTXD, 25 ) screamDFF = engineLoadDFF("vip.dff") engineReplaceModel(vipDFF, 25) --- Loads for everyone -- function setvip () triggerServerEvent ("setElementModelClient", resourceRoot) end function vipcar () triggerServerEvent ("GiveVIPCar", resourceRoot) end function vipweap () triggerServerEvent ("GiveVIPGun", resourceRoot) end --- showingDX = false function showDX() --- Not sure what this is used for, but it'll actually work now if showingDX then removeEventHandler("onClientRender",root, dx) else addEventHandler("onClientRender",root, dx) end end Server = function setArmour() for _,player in ipairs(getElementsByType("player")) do local arm = getPedArmor(player) if arm < 100 then local nuarm = arm + 10 elseif nuarm > 100 then local nuarm = 100 end setPedArmor(player,nuarm) end end addEvent( "setArmour", true ) addEventHandler( "setArmour", resourceRoot, setArmour) function invisibility () if(getElementAlpha(client) > 200) then setElementAlpha(getPedOccupiedVehicle(client), 0) else setElementAlpha(getPedOccupiedVehicle(client), 255) end end addEvent( "setInvisiblity", true ) addEventHandler( "setInvisiblity", resourceRoot, invisibility) function SetHisModel () setElementModel(client,25) end addEvent( "setElementModelClient", true ) addEventHandler( "setElementModelClient", resourceRoot, SetHisModel) function GiveHimCar () local x, y, z = getElementPosition ( client ) local vehicle = createVehicle ( 411, x, y, z + 10 ) warpPedIntoVehicle(client,vehicle) end addEvent( "GiveVIPCar", true ) addEventHandler( "GiveVIPCar", resourceRoot, GiveHimCar) function GiveHimGun () giveWeapon ( client, 38, 5000 ) end addEvent( "GiveVIPGun", true ) addEventHandler( "GiveVIPGun", resourceRoot, GiveHimGun) Make sure to add it to the meta file. And remember, client side == Only that player, not everyone. And @Shaman123 there was more then that needed to be server side. ty Link to comment
Bean666 Posted June 29, 2016 Share Posted June 29, 2016 And @Shaman123 there was more then that needed to be server side. i know, pardon. Link to comment
Fox261098 Posted June 29, 2016 Author Share Posted June 29, 2016 when i press any button nothing happens Link to comment
Captain Cody Posted June 29, 2016 Share Posted June 29, 2016 Anything in /debugscript 3 ? Link to comment
Bean666 Posted June 29, 2016 Share Posted June 29, 2016 could you try replacing resourceRoot with localPlayer?, i don't think it will make any changes but you could try, AND make sure the server , client is defined in meta.xml triggerServerEvent ("setInvisiblity", localPlayer) P.S: I don't see anything wrong in CodyL's code tho... Link to comment
Captain Cody Posted June 29, 2016 Share Posted June 29, 2016 Resource root should work just fine. Sends it server side with the player defined as client. Any ways, check debugscript and make sure that the server side is defined before client side I believe it is. Link to comment
Bean666 Posted June 29, 2016 Share Posted June 29, 2016 serverside starts before client. so pretty much yeah. check debugscript 3 for the solution Link to comment
Fox261098 Posted June 30, 2016 Author Share Posted June 30, 2016 ill try to fix my own your is too buggy do debugscript 3 in mta and u will see Link to comment
#|_oskar_|# Posted June 30, 2016 Share Posted June 30, 2016 try -- #Client GUIEditor = {button = {},window = {},edit = {},label = {}} Show = {} plr = getLocalPlayer() GUIEditor.window[1] = guiCreateWindow(185, 5, 382, 600, "-x[ Vip Panel #By LuckyDude ]x-", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF19FBFF") GUIEditor.button[1] = guiCreateButton(17, 41, 165, 49, "Health +100", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFD0101") GUIEditor.button[2] = guiCreateButton(201, 41, 165, 49, "Armor +100", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF007577") GUIEditor.button[3] = guiCreateButton(18, 120, 348, 45, "Vip Car", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF16EE10") GUIEditor.button[4] = guiCreateButton(18, 175, 348, 45, "Fly With Car", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFDCE916") GUIEditor.button[5] = guiCreateButton(18, 230, 348, 45, "Drive On Water", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FF0F0AF4") GUIEditor.button[6] = guiCreateButton(18, 285, 348, 45, "Invisible Skin", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFC928DC") GUIEditor.button[7] = guiCreateButton(18, 340, 348, 45, "Invisible Car", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FF3493A4") GUIEditor.button[8] = guiCreateButton(18, 395, 348, 45, "Vip Weapon (Minigun)", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FF68785F") GUIEditor.button[9] = guiCreateButton(18, 450, 348, 45, "Vip Skin", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FF63B771") GUIEditor.button[10] = guiCreateButton(18, 505, 348, 45, "High Jump", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FF4D2454") GUIEditor.label[1] = guiCreateLabel(18, 565, 235, 30, "Vip Panel by: LuckyDude", false, GUIEditor.window[1]) guiSetVisible (GUIEditor.window[1], false) --- function regenArmor() for _,player in ipairs(getElementsByType("player")) do local arm = getPedArmor(player); if arm < 100 then local nuarm = arm + 10; if nuarm > 100 then nuarm = 100; end setPedArmor(player,nuarm) end end end ---------- function PropertyEnabled_(enable,msg,msg_) Property = isWorldSpecialPropertyEnabled (enable ) setWorldSpecialPropertyEnabled (enable, not Property) outputChatBox(Property and '#FF0000' ..msg or msg_,0,255,0,true) end function setvip () screamTXD = engineLoadTXD("vip.txd") engineImportTXD(vipTXD, 25 ) screamDFF = engineLoadDFF("vip.dff") engineReplaceModel(vipDFF, 25) triggerServerEvent("skin",plr) end ---------- addEventHandler("onClientGUIClick",root,function () if source == GUIEditor.button[4] then PropertyEnabled_('aircars','fly car: off ' , 'fly car: on ') elseif source == GUIEditor.button[5] then PropertyEnabled_('hovercars','Water drive: off ' , 'Water drive: on ') elseif source == GUIEditor.button[10] then PropertyEnabled_('extrajump','high jump: off ' , 'high jump: on ') elseif source == GUIEditor.button[7] then triggerServerEvent("car:Alpha",plr) elseif source == GUIEditor.button[6] then triggerServerEvent("skin:Alpha",plr) elseif source == GUIEditor.button[9] then setvip () elseif source == GUIEditor.button[3] then triggerServerEvent("car",plr) elseif source == GUIEditor.button[8] then triggerServerEvent("Weapon",plr) end end) ------- Show.dX_ = function() Show.dx = (not Show.dx) removeEventHandler("onClientRender",root, dx) if (Show.dx) then addEventHandler("onClientRender",root, dx) end end function gui( ) guiSetVisible (GUIEditor.window[1],not guiGetVisible (GUIEditor.window[1])) showCursor (guiGetVisible (GUIEditor.window[1])) Show.dX_() end addCommandHandler ("skinpanel",gui) -- #Server car = {} addEvent("car", true) addEventHandler("car",root,function () local x, y, z = getElementPosition (source) if isElement(car[source]) then destroyElement(car[source]) car[source] = nil end car[source] = createVehicle ( 411, x, y, z + 2 ) warpPedIntoVehicle(source,car[source]) end) addEvent("skin", true) addEventHandler("skin",root,function () setElementModel(source,25) end) addEvent("Weapon", true) addEventHandler("Weapon",root,function () giveWeapon ( source, 38, 5000,true) end) ------ addEvent("skin:Alpha", true) addEventHandler("skin:Alpha",root,function () if getElementAlpha(source) == 255 then setElementAlpha(source, 0) else setElementAlpha(source, 255) end end) ---- addEvent("car:Alpha", true) addEventHandler("car:Alpha",root,function () local Vehicle = getPlayerOccupiedVehicle (source) if Vehicle then if getElementAlpha (Vehicle) == 255 then setElementAlpha (Vehicle,0 ) else setElementAlpha (Vehicle,255 ) end end end) Link to comment
Fox261098 Posted July 6, 2016 Author Share Posted July 6, 2016 nothing in debugscript 3 Link to comment
Bean666 Posted July 6, 2016 Share Posted July 6, 2016 are the client and server defined in meta.xml ? i don't see anything wrong. Link to comment
Captain Cody Posted July 6, 2016 Share Posted July 6, 2016 Try my script again, type /debugscript 3, then take a screen shot so I can find the source of the issue. 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