Jump to content

Mann56

Members
  • Posts

    306
  • Joined

  • Last visited

Everything posted by Mann56

  1. Oh , here's it local screenWidth, screenHeight = guiGetScreenSize() local newbieShow = false local newbieHead = "-" local newbieText = "-" local newbiePosition = 0 function setNewbieInfo(show, head, text, element) newbieShow = show newbieHead = head newbieText = text newbiePosition = element It's zero
  2. addEventHandler("onClientRender", getRootElement(), function() if newbieShow == false then return end local xp, yp, zp = getElementPosition(newbiePosition) local coords = {} coords = getScreenFromWorldPosition(xp, yp, zp) local length = dxGetTextWidth(newbieText, 1, "default-bold") dxDrawRectangle(coords[1] - length / 2 - screenWidth * 0.01, coords[2], screenWidth * 0.02 + length, screenHeight * 0.1, tocolor(33, 33, 33, 100)) dxDrawingColorText(newbieHead, coords[1] - length / 2 - screenWidth * 0.01, coords[2], coords[1] + length / 2 + screenWidth * 0.01, coords[2] + screenHeight * 0.03, tocolor(22, 255, 22, 120), 0.5, 1.1, "default-bold", "center", "center") dxDrawingColorText(newbieText, coords[1] - length / 2 - screenWidth * 0.01, coords[2] + screenHeight * 0.03, coords[1] + length / 2 + screenWidth * 0.01, coords[2] + screenHeight * 0.07, tocolor(255, 255, 255, 120), 0.5, 1, "default-bold", "center", "center") end )
  3. No improvement here's the debugscript
  4. Hey there! in the server whenever i eat or drink it sticks to the same animation and doesn't end it. Please help ! Debugscript says that a variable which is being used in arithmetic operation is a bool local x, y = getScreenFromWorldPosition(x, y, z) in: local x, y, z = getElementPosition(newbiePosition) local x, y = getScreenFromWorldPosition(x, y, z) local length = dxGetTextWidth(newbieText, 1, "default-bold") dxDrawRectangle(x - length / 2 - screenWidth * 0.01, y, screenWidth * 0.02 + length, screenHeight * 0.1, tocolor(33, 33, 33, 100)) dxDrawingColorText(newbieHead, x - length / 2 - screenWidth * 0.01, y, x + length / 2 + screenWidth * 0.01, y + screenHeight * 0.03, tocolor(22, 255, 22, 120), 0.5, 1.1, "default-bold", "center", "center") dxDrawingColorText(newbieText, x - length / 2 - screenWidth * 0.01, y + screenHeight * 0.03, x + length / 2 + screenWidth * 0.01, y + screenHeight * 0.07, tocolor(255, 255, 255, 120), 0.5, 1, "default-bold", "center", "center") end)
  5. Mann56

    [WIP]Pizza Job

    Thank you! You helped me much!
  6. Mann56

    [WIP]Pizza Job

    Thanks:D
  7. Mann56

    GUI's sticked

    Thanks
  8. Mann56

    GUI's sticked

    Thank you very much it's working. Can you tell me where was the error?
  9. Mann56

    GUI's sticked

    Nah no change
  10. Mann56

    GUI's sticked

    Hey guys, in my resource when i load it the gui's just come up empty and also when i click on spawn a vehicle then it says that event is triggered clientside but not added serverside Here's my code -> Server createTeam ("Pizza",255,255,0) --gui window 1 ------------------------------------------------------------------------------------------------------------- --client event 1 addEvent("acceptTheJob", true) function getTheSkin(thePlayer) end addEventHandler("acceptTheJob", root, function(var) if var == "Enter" then local team = getPlayerTeam(client) if team and getTeamName(team) == "Pizza" then outputChatBox("PIZZA JOB : You are already employed.", client, 255, 255, 0) else setPlayerTeam(client, getTeamFromName("Pizza")) outputChatBox("PIZZA JOB : You are now employed as a Pizzaboy!", client, 255, 255, 0) setElementModel(client,155) triggerClientEvent("onClientRender",playerSource) end elseif var == "Leave" then setPlayerTeam(client, nil) outputChatBox("PIZZA JOB : You left your job and are unemployed now!", client, 255, 255, 0) setElementModel(client,0) end end) --gui 2 (secondary gui) ----------------------- addEvent("getPizza",true) addEventHandler("getPizza",root, function() outputChatBox("PIZZA JOB : You took 1 Pizza",client,255,255,0) end ) addEvent("getPizza2",true) addEventHandler("getPizza2",root, function () outputChatBox("PIZZA JOB : You took 2 Pizza's",client,255,255,0) end) addEvent("getPizza3",true) addEventHandler("getPizza3",root, function() outputChatBox("PIZZA JOB : You took 3 Pizza's",client,255,255,0) end) addEvent("getPizza4",true) addEventHandler("getPizza4",root, function() outputChatBox("PIZZA JOB : You took 4 Pizza's",client,255,255,0) end) addEvent("getPizza5",true) addEventHandler("getPizza5",root, function() outputChatBox("PIZZA JOB : You took 5 Pizza's",client,255,255,0) end) addEvent("getPizza6",true) addEventHandler("getPizza6",root, function() outputChatBox("PIZZA JOB : You took 6 Pizza's",client,255,255,0) end) ------------------------------------------------------------------------------------------------------------------------------- addEvent("veh",true) addEventHandler("veh",root, function () local p = getLocalPlayer() local x,y,z = getElementPosition (p) vehicle = createVehicle (448 , x+5, y+5, z)) -- gate ------------------------------------------------------------------------------------------------------------------------ gate = createObject(985,-1698.5302734375, 1392.7216796875, 7.1786022186279, 0,0,130.67932128906 ) colRect = createColCircle(-1697.7197265625, 1391.74609375, 6) addEventHandler("onColShapeHit",colRect, function(thePlayer,matchingDimension) if getElementType(thePlayer) == "player" or getElementType(thePlayer) == "vehicle" then local d = getTeamName(getPlayerTeam(thePlayer)) if d == "Pizza" then movegate = moveObject(gate , 3000 ,-1704.947265625, 1398.6650390625, 7.1784038543701) end else outputChatBox("You are not a pizzaboy!",getRootElement(),255,255,0) end end ) addEventHandler("onColShapeLeave",colRect, function(thePlayer,matchingDimension) if getElementType(thePlayer) == "player" or getElementType(thePlayer) == "vehicle" then setGateBack = moveObject (gate , 3000,-1698.5302734375, 1392.7216796875, 7.1786022186279 ) end end) createObject(985,-1659.521484375, 1432.36328125, 7.1759605407715, 0,0,130.67932128906) -- pizzahelp addCommandHandler("pizzahelp", function() outputChatBox("Pizza : In the pizza you as a pizzaboy have to deliver pizzas to locations and you get money by delivering the package.") end) Client -- main GUI GUIEditor = { button = {}, window = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(308, 173, 399, 425, "Pizza ", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) --I setted as invisible GUIEditor.label[1] = guiCreateLabel(14, 31, 365, 63, " Well Stacked Pizza Co.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "sa-header") guiLabelSetColor(GUIEditor.label[1], 255, 255, 2) GUIEditor.label[2] = guiCreateLabel(44, 111, 320, 124, " Welcome to the Well Stacked Pizza Co.\n You can employ now as a pizzaboy!\n As a pizzaboy you have to deliver pizza's\n throughout the town.\n You will get money for that.\n\n For help type /pizzahelp", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "clear-normal") GUIEditor.button[1] = guiCreateButton(96, 247, 215, 42, "Accept ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "C8FFFF00") GUIEditor.button[2] = guiCreateButton(118, 307, 164, 36, "Leave ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "C8FD0802") GUIEditor.button[3] = guiCreateButton(122, 368, 150, 32, "Close", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.button[1] then closeWind() triggerServerEvent("acceptTheJob", localPlayer, "Enter") elseif source == GUIEditor.button[2] then closeWind() triggerServerEvent("acceptTheJob", localPlayer, "Leave") elseif source == GUIEditor.button[3] then closeWind() end end) function closeWind() guiSetVisible(GUIEditor.window[1], false) showCursor(false) end pizzaMarker = createMarker(-1721.0263671875, 1355.9541015625, 6.1805019378662, "cylinder", 1.25, 255, 255, 0, 180) addEventHandler("onClientMarkerHit", pizzaMarker, function(player) if player == localPlayer and not isPedInVehicle(player) then guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end) --second gui GUIEditor = { button = {}, window = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() win2 = guiCreateWindow(314, 135, 393, 492, "Pizza GUI", false) guiWindowSetSizable(win2, false) GUIEditor.label[1] = guiCreateLabel(26, 40, 332, 96, "How many Pizza's you\nwant to deliver?", false, win2) guiSetFont(GUIEditor.label[1], "sa-header") guiLabelSetColor(GUIEditor.label[1], 236, 151, 18) button1 = guiCreateButton(35, 143, 142, 57, "1", false, win2) guiSetFont(button1, "sa-header") guiSetProperty(button1, "NormalTextColour", "FFAAAAAA") button2 = guiCreateButton(35, 219, 142, 58, "3", false, win2) guiSetFont(button2, "sa-header") guiSetProperty(button2, "NormalTextColour", "FFAAAAAA") button3 = guiCreateButton(205, 217, 147, 60, "4", false, win2) guiSetFont(button3 , "sa-header") guiSetProperty(button3, "NormalTextColour", "FFAAAAAA") GUIEditor.button[4] = guiCreateButton(204, 145, 148, 56, "2", false, win2) guiSetFont(GUIEditor.button[4], "sa-header") guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA") GUIEditor.button[5] = guiCreateButton(37, 295, 140, 58, "5", false, win2) guiSetFont(GUIEditor.button[5], "sa-header") guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFAAAAAA") GUIEditor.button[6] = guiCreateButton(205, 294, 147, 59, "6", false, win2) guiSetFont(GUIEditor.button[6], "sa-header") guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFAAAAAA") GUIEditor.button[7] = guiCreateButton(42, 392, 300, 39, "Close", false, win2) guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFAAAAAA") guiSetVisible(win2,false) end ) pizzacount = 0 addEventHandler("onClientGUIClick",root, function () if source == button1 then if pizzacount < 6 then closeWindow() triggerServerEvent("getPizza" ,localPlayer,"1 Pizza") pizzacount = pizzacount+1 else outputChatBox("PIZZA JOB : Number of Pizza's exceed the limit!",255,255,0) end elseif source == GUIEditor.button[4] then if pizzacount < 6 then closeWindow() triggerServerEvent("getPizza2",localPlayer,"2 Pizza") pizzacount = pizzacount+2 else outputChatBox("PIZZA JOB : Number of Pizza's exceed the limit!",255,255,0) end elseif source == button2 then if pizzacount < 6 then closeWindow() triggerServerEvent("getPizza3",localPlayer,"3 Pizza") pizzacount = pizzacount+3 else outputChatBox("PIZZA JOB : Number of Pizza's exceed the limit!",255,255,0) end elseif source == button3 then if pizzacount < 6 then closeWindow() triggerServerEvent("getPizza4",localPlayer,"4 Pizza") pizzacount = pizzacount+4 else outputChatBox("PIZZA JOB : Number of Pizza's exceed the limit!",255,255,0) end elseif source == GUIEditor.button[5] then if pizzacount < 6 then closeWindow() triggerServerEvent("getPizza5",localPlayer,"5 Pizza") pizzacount = pizzacount+5 else outputChatBox("PIZZA JOB : Number of Pizza's exceed the limit!",255,255,0) end elseif source == GUIEditor.button[6] then if pizzacount < 6 then closeWindow() triggerServerEvent("getPizza6",localPlayer,"6 Pizza") pizzacount = pizzacount+6 else outputChatBox("PIZZA JOB : Number of Pizza's exceed the limit!",255,255,0) end elseif source == GUIEditor.button[7] then closeWindow() end end ) function closeWindow() guiSetVisible(win2,false) showCursor(false) end ----------- vehicle gui---------------------------------------------------------------------------------------------- GUIEditor = { button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() vehwin = guiCreateWindow(390, 196, 312, 261, "Vehicle Window", false) guiWindowSetSizable(vehwin, false) vehbut1 = guiCreateButton(28, 51, 251, 69, "Spawn Pizzaboy", false, vehwin) guiSetFont(vehbut1, "sa-header") guiSetProperty(vehbut1, "NormalTextColour", "FFFBFE00") vehbut2 = guiCreateButton(30, 162, 249, 66, "Close", false, vehwin) guiSetFont(vehbut2, "sa-header") guiSetProperty(vehbut2, "NormalTextColour", "FFAAAAAA") guiSetVisible(vehwin,false) end ) marker2 = createMarker(-1678.615234375, 1409.3828125, 6.1794281005859, "cylinder",1.25, 255, 255, 0, 180) addEventHandler("onClientMarkerHit", marker2, function(player) if player == localPlayer and not isPedInVehicle(player) then guiSetVisible(vehwin, true) showCursor(true) end end) function closeWine() guiSetVisible(vehwin,false) showCursor(false) end addEventHandler("onClientGUIClick",root, function () if source == vehbut1 then triggerServerEvent("veh",localPlayer) closeWine() elseif source == vehbut2 then closeWine() end end) --------------------------------------------------------------------------------------------------------- marker4 = createMarker(8184.484375, -1822.6887207031, 51.855865478516, "cylinder",1.25,255,255,0) addEventHandler("onClientMarkerHit", marker4, function(player) if player == localPlayer and not isPedInVehicle(player) then guiSetVisible(win2, true) showCursor(true) end end) -- ------------------------------------------------------------------------------------------------------------- marker3 = createMarker(-1685.2763671875, 1401.8896484375, 8.1815948486328, "arrow", 1.25,255,255,0 ) function teleportPlayer(source) setElementPosition(source,8185,-1814,53,true) end addEventHandler("onClientMarkerHit", marker3,teleportPlayer) --------------------------------------------------------------------------------------------------------------------- marker5 = createMarker(8186.6630859375, -1817.7219238281, 53.855865478516, "arrow",1.25,255,255,0) function teleportPlayer1(source) setElementPosition(source,-1687.0810546875, 1403.787109375, 7.1788845062256,true) end addEventHandler("onClientMarkerHit", marker5,teleportPlayer1) ----------------------------------------------------------------------------------------------------------------- pizzaguy = createPed(155, -1720.0400390625, 1356.6455078125, 7.1875, 121.70565795898) setElementFrozen(pizzaguy, true) addEventHandler("onClientPedDamage", pizzaguy, cancelEvent) pgboy = createPed(155, -1677.861328125, 1410.26953125, 7.1853160858154, 141.66812133789) setElementFrozen(pgboy, true) addEventHandler("onCLientPedDamage", pgboy, cancelEvent) createBlip(-1723.74, 1359.68, 6.18, 29, 2, 0, 0, 0, 255, 0, 200)
  11. Mann56

    [WIP]Pizza Job

    Thanks! Edit : Added a pizza factory base!!
  12. Provide what is mentioned in debugscript --> /debugscript 3
  13. Hey guys there! This will be my first resource! Job : You will have to go on around the city and deliver pizza's. Features : Attractive GUI's Use of DxText A factory like custom base for pizzaboy's (0%) Pizza peds Gate to stop others from entering the Pizza Property! Screens Thanks to: Tapl Mihayy Who am I Gallardo and many other guys (sorry i don't exactly remember all as i started the resource a month ago but stopped as i had exams on now i am continuing this project) This resource is under development and as this is my first one i might take time completing it. Thank You for reading, Mann
  14. Mann56

    A question

    Got it , Thanks for that
  15. Mann56

    A question

    Yes 5 script files for different jobs. I mean if i have 5 jobs like pizza,medic,police,mechanic,carjacker etc. and i want to make custom bases of all those jobs but i want pizza base to load when i load pizza job etc,medic base when medic loads. So how can i have 5 maps working together ?
  16. Mann56

    A question

    I want to add some custom mapped location in my server which is linked to a resource i.e. i map a pizza factory in the editor and attach the map with my resource, now my question is if i have 5 jobs then how will i load them?
  17. Mann56

    Dx Text

    Working Superb! Thanks bro!
  18. Mann56

    Dx Text

    Thanks i'll try it.
  19. Mann56

    Dx Text

    Thanks for the code but i want that when i take 2 more pizza's it automatically changes the number and can you tell me what is on client render and tonumber i saw onClientRender in wiki but didnt understand it.
  20. Mann56

    Dx Text

    Hey guys, i am making a pizza job resource and need some help. I want to make Dx Text at the bottom right corner of screen that i can make no doubt but there i want to set no of pizzas a player has. So how can i change the text according to no.of pizzas? I mean if aplayer has 3 pizzas and takes 2 more how can i change the text from 3 to 5?
  21. Thank you bro it works Silly me to use that function. I was breaking my head on it since two hours.
  22. haan gamenet roleplay ka member hoon
  23. Thank you for helping but now the gate doesnt open and there is nothing in debugscript 3
  24. Hey guys im making a pizza job but am stuck. I have made a gate and set such that when a player of team Pizza comes near it then only it opens but it does not claiming i am not in team pizza. Here's my code -> Server -- check employment status of a player addEvent("acceptTheJob", true) function getTheSkin(thePlayer) end addEventHandler("acceptTheJob", root, function(var) if var == "Enter" then local team = getPlayerTeam(client) if team and getTeamName(team) == "Pizza" then outputChatBox("PIZZA JOB : You are already employed.", client, 255, 255, 0) else setPlayerTeam(client, getTeamFromName("Pizza")) outputChatBox("PIZZA JOB : You are now employed as a Pizzaboy!", client, 255, 255, 0) setElementModel(client,155) end elseif var == "Leave" then setPlayerTeam(client, nil) outputChatBox("PIZZA JOB : You left your job and are unemployed now!", client, 255, 255, 0) setElementModel(client,0) end end) gate = createObject(985,-1698.5302734375, 1392.7216796875, 7.1786022186279, 0,0,130.67932128906 ) colRect = createColCircle(-1697.7197265625, 1391.74609375, 6) addEventHandler("onColShapeHit",colRect, function(thePlayer,matchingDimension) if getElementType(thePlayer) == "Player" or "Vehicle"then d = getPlayerTeam(thePlayer) if d == "Pizza" then movegate = moveObject(gate , 3000 ,-1704.947265625, 1398.6650390625, 7.1784038543701) end else outputChatBox("You are not a pizzaboy!",getRootElement(),255,255,0) end end ) addEventHandler("onColShapeLeave",colRect, function(thePlayer,matchingDimension) if getElementType(thePlayer) == "Player" or "Vehicle"then setGateBack = moveObject (gate , 3000,-1698.5302734375, 1392.7216796875, 7.1786022186279 ) end end) addCommandHandler("pizzahelp", function() outputChatBox("Pizza : In the pizza you as a pizzaboy have to deliver pizzas to locations and you get money by delivering the package.") end) Client GUIEditor = { button = {}, window = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(308, 173, 399, 425, "Pizza ", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) --I seted as invisible * GUIEditor.label[1] = guiCreateLabel(14, 31, 365, 63, " Well Stacked Pizza Co.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "sa-header") guiLabelSetColor(GUIEditor.label[1], 255, 255, 2) GUIEditor.label[2] = guiCreateLabel(44, 111, 320, 124, " Welcome to the Well Stacked Pizza Co.\n You can employ now as a pizzaboy!\n As a pizzaboy you have to deliver pizza's\n throughout the town.\n You will get money for that.\n\n For help type /pizzahelp", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "clear-normal") GUIEditor.button[1] = guiCreateButton(96, 247, 215, 42, "Accept ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "C8FFFF00") GUIEditor.button[2] = guiCreateButton(118, 307, 164, 36, "Leave ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "C8FD0802") GUIEditor.button[3] = guiCreateButton(122, 368, 150, 32, "Close", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") end ) pizzaguy = createPed(155, -1720.0400390625, 1356.6455078125, 7.1875, 121.70565795898) pizzaMarker = createMarker(-1721.0263671875, 1355.9541015625, 6.1805019378662, "cylinder", 1.25, 0, 255, 0, 180) createBlip(-1723.74, 1359.68, 6.18, 29, 2, 0, 0, 0, 255, 0, 200) setElementFrozen(pizzaguy, true) addEventHandler("onClientPedDamage", pizzaguy, cancelEvent) addEventHandler("onClientMarkerHit", pizzaMarker, function(player) if player == localPlayer and not isPedInVehicle(player) then guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.button[1] then closeWind() triggerServerEvent("acceptTheJob", localPlayer, "Enter") elseif source == GUIEditor.button[2] then closeWind() triggerServerEvent("acceptTheJob", localPlayer, "Leave") elseif source == GUIEditor.button[3] then closeWind() end end) function closeWind() guiSetVisible(GUIEditor.window[1], false) showCursor(false) end I would appreciate some help : D
  25. You can only design it using GUI Editor. To complete it you will have to script yourself .
×
×
  • Create New...