Clydian Posted August 1, 2016 Share Posted August 1, 2016 local L0_0 L0_0 = createPed L0_0 = L0_0(280, 1560.900390625, -1680.2060546875, 64.498291015625) setPedRotation(L0_0, 0) setElementFrozen(L0_0, true) setElementDimension(L0_0, 3) setElementInterior(L0_0, 22) setElementData(L0_0, "talk", 1, false) setElementData(L0_0, "name", "SGT J. McDonald", false) function popuppdPedMenu() local L0_1, L1_2, L2_3, L3_4, L4_5, L5_6 L0_1 = getElementData L1_2 = getLocalPlayer L1_2 = L1_2() L2_3 = "exclusiveGUI" L0_1 = L0_1(L1_2, L2_3) if L0_1 then return end L0_1 = _UPVALUE0_ if not L0_1 then L0_1 = 200 L1_2 = 150 L2_3 = guiGetScreenSize L3_4 = L2_3() L4_5 = L2_3 / 2 L5_6 = L0_1 / 2 L4_5 = L4_5 - L5_6 L5_6 = L3_4 / 2 L5_6 = L5_6 - L1_2 / 2 _UPVALUE0_ = guiCreateWindow(L4_5, L5_6, L0_1, L1_2, "How can we help you?", false) bPhotos = guiCreateButton(0.05, 0.2, 0.87, 0.2, "I want to report a crime.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bPhotos, helpButtonFunction, false) bAdvert = guiCreateButton(0.05, 0.5, 0.87, 0.2, "I want to speak to an Officer.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bAdvert, appointmentButtonFunction, false) bSomethingElse = guiCreateButton(0.05, 0.8, 0.87, 0.2, "I'm fine, thanks.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bSomethingElse, otherButtonFunction, false) triggerServerEvent("pd:ped:start", getLocalPlayer(), getElementData(_UPVALUE1_, "name")) showCursor(true) end end addEvent("pd:popupPedMenu", true) addEventHandler("pd:popupPedMenu", getRootElement(), popuppdPedMenu) function closepdPedMenu() destroyElement(_UPVALUE0_) _UPVALUE0_ = nil showCursor(false) end function helpButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:help", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function appointmentButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:appointment", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function otherButtonFunction() closepdPedMenu() end Link to comment
Captain Cody Posted August 1, 2016 Share Posted August 1, 2016 So many issues I see here, I'm not even sure where to start. Link to comment
Clydian Posted August 1, 2016 Author Share Posted August 1, 2016 So many issues I see here, I'm not even sure where to start. Whats wrong? Link to comment
Captain Cody Posted August 1, 2016 Share Posted August 1, 2016 Well I fixed as many as I could find, and cleaned it up lot. L0_0 = createPed(280, 1560.900390625, -1680.2060546875, 64.498291015625) setPedRotation(L0_0, 0) setElementFrozen(L0_0, true) setElementDimension(L0_0, 3) setElementInterior(L0_0, 22) setElementData(L0_0, "talk", 1, false) setElementData(L0_0, "name", "SGT J. McDonald", false) function popuppdPedMenu() L0_1 = getElementData(localPlayer, "exclusiveGUI") if L0_1 then return end if not _UPVALUE0_ then L0_1 = 200 L1_2 = 150 x,y = guiGetScreenSize() _UPVALUE0_ = guiCreateWindow((x/2)-(L0_1/20),(y/2)-(L1_2/2), L0_1, L1_2, "How can we help you?", false) bPhotos = guiCreateButton(0.05, 0.2, 0.87, 0.2, "I want to report a crime.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bPhotos, helpButtonFunction, false) bAdvert = guiCreateButton(0.05, 0.5, 0.87, 0.2, "I want to speak to an Officer.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bAdvert, appointmentButtonFunction, false) bSomethingElse = guiCreateButton(0.05, 0.8, 0.87, 0.2, "I'm fine, thanks.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bSomethingElse, otherButtonFunction, false) triggerServerEvent("pd:ped:start", getLocalPlayer(), getElementData(_UPVALUE1_, "name")) showCursor(true) end end addEvent("pd:popupPedMenu", true) addEventHandler("pd:popupPedMenu", getRootElement(), popuppdPedMenu) function closepdPedMenu() destroyElement(_UPVALUE0_) _UPVALUE0_ = nil showCursor(false) end function helpButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:help", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function appointmentButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:appointment", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function otherButtonFunction() closepdPedMenu() end Link to comment
Clydian Posted August 1, 2016 Author Share Posted August 1, 2016 Well I fixed as many as I could find, and cleaned it up lot. L0_0 = createPed(280, 1560.900390625, -1680.2060546875, 64.498291015625) setPedRotation(L0_0, 0) setElementFrozen(L0_0, true) setElementDimension(L0_0, 3) setElementInterior(L0_0, 22) setElementData(L0_0, "talk", 1, false) setElementData(L0_0, "name", "SGT J. McDonald", false) function popuppdPedMenu() L0_1 = getElementData(localPlayer, "exclusiveGUI") if L0_1 then return end if not _UPVALUE0_ then L0_1 = 200 L1_2 = 150 x,y = guiGetScreenSize() _UPVALUE0_ = guiCreateWindow((x/2)-(L0_1/20),(y/2)-(L1_2/2), L0_1, L1_2, "How can we help you?", false) bPhotos = guiCreateButton(0.05, 0.2, 0.87, 0.2, "I want to report a crime.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bPhotos, helpButtonFunction, false) bAdvert = guiCreateButton(0.05, 0.5, 0.87, 0.2, "I want to speak to an Officer.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bAdvert, appointmentButtonFunction, false) bSomethingElse = guiCreateButton(0.05, 0.8, 0.87, 0.2, "I'm fine, thanks.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bSomethingElse, otherButtonFunction, false) triggerServerEvent("pd:ped:start", getLocalPlayer(), getElementData(_UPVALUE1_, "name")) showCursor(true) end end addEvent("pd:popupPedMenu", true) addEventHandler("pd:popupPedMenu", getRootElement(), popuppdPedMenu) function closepdPedMenu() destroyElement(_UPVALUE0_) _UPVALUE0_ = nil showCursor(false) end function helpButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:help", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function appointmentButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:appointment", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function otherButtonFunction() closepdPedMenu() end The basic thing still wont work. The ped is not showing Link to comment
Captain Cody Posted August 1, 2016 Share Posted August 1, 2016 Ok few things, -- First, any thing in debugscript? (Type /debugscript 3) -- Second, can I see the whole code, so I can see if there's anything wrong earlier in the code? -- Third, make sure the cords for where you want the ped are correct. Link to comment
Clydian Posted August 1, 2016 Author Share Posted August 1, 2016 Ok few things,-- First, any thing in debugscript? (Type /debugscript 3) -- Second, can I see the whole code, so I can see if there's anything wrong earlier in the code? -- Third, make sure the cords for where you want the ped are correct. Nothing in debugscript Thats the full code Cords are correct Link to comment
Captain Cody Posted August 1, 2016 Share Posted August 1, 2016 ok try this Ped = createPed(280, 1560.900390625, -1680.2060546875, 64.498291015625,0,false) setElementFrozen(Ped, true) setElementDimension(Ped, 3) setElementInterior(Ped, 22) setElementData(Ped, "talk", 1, false) setElementData(Ped, "name", "SGT J. McDonald", false) function popuppdPedMenu() L0_1 = getElementData(localPlayer, "exclusiveGUI") if L0_1 then return end if not _UPVALUE0_ then L0_1 = 200 L1_2 = 150 x,y = guiGetScreenSize() _UPVALUE0_ = guiCreateWindow((x/2)-(L0_1/20),(y/2)-(L1_2/2), L0_1, L1_2, "How can we help you?", false) bPhotos = guiCreateButton(0.05, 0.2, 0.87, 0.2, "I want to report a crime.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bPhotos, helpButtonFunction, false) bAdvert = guiCreateButton(0.05, 0.5, 0.87, 0.2, "I want to speak to an Officer.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bAdvert, appointmentButtonFunction, false) bSomethingElse = guiCreateButton(0.05, 0.8, 0.87, 0.2, "I'm fine, thanks.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bSomethingElse, otherButtonFunction, false) triggerServerEvent("pd:ped:start", getLocalPlayer(), getElementData(_UPVALUE1_, "name")) showCursor(true) end end addEvent("pd:popupPedMenu", true) addEventHandler("pd:popupPedMenu", getRootElement(), popuppdPedMenu) function closepdPedMenu() destroyElement(_UPVALUE0_) _UPVALUE0_ = nil showCursor(false) end function helpButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:help", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function appointmentButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:appointment", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function otherButtonFunction() closepdPedMenu() end Also few things I noticed -- --- UPVALUE0 element data "name" is undefined --- UPVALUE1 Is undefined in general Link to comment
Clydian Posted August 1, 2016 Author Share Posted August 1, 2016 ok try this Ped = createPed(280, 1560.900390625, -1680.2060546875, 64.498291015625,0,false) setElementFrozen(Ped, true) setElementDimension(Ped, 3) setElementInterior(Ped, 22) setElementData(Ped, "talk", 1, false) setElementData(Ped, "name", "SGT J. McDonald", false) function popuppdPedMenu() L0_1 = getElementData(localPlayer, "exclusiveGUI") if L0_1 then return end if not _UPVALUE0_ then L0_1 = 200 L1_2 = 150 x,y = guiGetScreenSize() _UPVALUE0_ = guiCreateWindow((x/2)-(L0_1/20),(y/2)-(L1_2/2), L0_1, L1_2, "How can we help you?", false) bPhotos = guiCreateButton(0.05, 0.2, 0.87, 0.2, "I want to report a crime.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bPhotos, helpButtonFunction, false) bAdvert = guiCreateButton(0.05, 0.5, 0.87, 0.2, "I want to speak to an Officer.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bAdvert, appointmentButtonFunction, false) bSomethingElse = guiCreateButton(0.05, 0.8, 0.87, 0.2, "I'm fine, thanks.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bSomethingElse, otherButtonFunction, false) triggerServerEvent("pd:ped:start", getLocalPlayer(), getElementData(_UPVALUE1_, "name")) showCursor(true) end end addEvent("pd:popupPedMenu", true) addEventHandler("pd:popupPedMenu", getRootElement(), popuppdPedMenu) function closepdPedMenu() destroyElement(_UPVALUE0_) _UPVALUE0_ = nil showCursor(false) end function helpButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:help", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function appointmentButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:appointment", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function otherButtonFunction() closepdPedMenu() end Also few things I noticed -- --- UPVALUE0 element data "name" is undefined --- UPVALUE1 Is undefined in general Still the same.. Like. i dont een know Link to comment
Captain Cody Posted August 1, 2016 Share Posted August 1, 2016 Double check it's dimension, interior, make 100% sure there's nothing in debug. Etc 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