-
Posts
164 -
Joined
-
Last visited
-
Days Won
1
kewizzle last won the day on July 25 2024
kewizzle had the most liked content!
About kewizzle
- Birthday 11/12/1996
Details
-
Gang
CumDrop
-
Location
Nebraska, USA
-
Occupation
Scripter
-
Interests
MTASA, Zombies, Scripting, Programming
Recent Profile Visitors
2,221 profile views
kewizzle's Achievements
Busta (15/54)
9
Reputation
-
-- Define window dimensions and background image path local windowWidth, windowHeight = 480, 320 local bgImagePath = "lgn_bg.png" -- Calculate window position to center it on the screen local screenWidth, screenHeight = guiGetScreenSize() local windowX, windowY = (screenWidth - windowWidth) / 2, (screenHeight - windowHeight) / 2 -- Create the window (invisible, we will draw the background image instead) local window = guiCreateWindow(windowX, windowY, windowWidth, windowHeight, "", false) guiSetAlpha(window, 0) -- Make the window fully transparent -- Create GUI elements local backgroundImage = guiCreateStaticImage(0, 0, windowWidth, windowHeight, bgImagePath, false, window) local usernameLabel = guiCreateLabel(50, 80, 100, 25, "Username:", false, window) local usernameField = guiCreateEdit(150, 80, 280, 25, "", false, window) local passwordLabel = guiCreateLabel(50, 120, 100, 25, "Password:", false, window) local passwordField = guiCreateEdit(150, 120, 280, 25, "", false, window) guiEditSetMasked(passwordField, true) local loginButton = guiCreateButton(50, 160, 100, 30, "Login", false, window) local registerButton = guiCreateButton(190, 160, 100, 30, "Register", false, window) local guestButton = guiCreateButton(330, 160, 100, 30, "Guest", false, window) -- Show the window with the background image guiSetVisible(window, true) -- Ensure that the window is destroyed when the resource stops addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), function() if (isElement(window)) then destroyElement(window) end end) -- Add event handlers for buttons (implement your login logic here) addEventHandler("onClientGUIClick", loginButton, function() local username = guiGetText(usernameField) local password = guiGetText(passwordField) outputChatBox("Login clicked. Username: " .. username .. " Password: " .. password) -- Implement login logic here end, false) addEventHandler("onClientGUIClick", registerButton, function() local username = guiGetText(usernameField) local password = guiGetText(passwordField) outputChatBox("Register clicked. Username: " .. username .. " Password: " .. password) -- Implement registration logic here end, false) addEventHandler("onClientGUIClick", guestButton, function() outputChatBox("Guest clicked.") -- Implement guest login logic here end, false) Try this
-
I was just making a zone editor for zombie servers for like safe zones and possibly adding other kinds of zones such as other tier zombies. Was wondering if anyone would use this. the wireframing you see is colshapes with the radar area.
-
perfect
-
Hi i want to make it so you have multiple radar areas and they all spawn together and they all are their own instance so when you enter any of them the script will do the same thing in each one around the map heres a sample WarehouseCol1 = createColRectangle( 2535, 2796, 80, 60 ) and createColRectangle( 1287, 1227, 80, 60 ) WarehouseArea1 = createRadarArea( 2535, 2796, 80, 60, 0, 0, 255, 90, root ) and createRadarArea( 1287, 1227, 80, 60, 0, 0, 255, 90, root )
-
actually cancel this lol i found my old script i dont have to rewrite completely now HAHA
-
so i should removeEventHandler each time Edit actually i can probably just call that outside
-
This script is nearly complete works great but there are some bugs, just wanna see if anyone can point out why it spawns multiple elements each time i complete the warehouse, ill complete it once it spawns 1 truck then the second time it spawns 2 trucks. Also any improvement ideas would be nice. Client: warehouseR = createRadarArea ( 2535, 2795, 80, 50, 255, 0, 0, 75) warehouseCol = createColRectangle ( 2535, 2795, 80, 50 ) createBlip ( 2577, 2820, 11, 22 ) gpt = getElementData(localPlayer, "timer") local screenW, screenH = guiGetScreenSize() timerT = guiCreateLabel((screenW - 600) / 2, (screenH - 52) / 2, 600, 52, "Defend Warehouse: 300", false) guiSetFont(timerT, "sa-gothic") guiLabelSetColor(timerT, 48, 218, 36) guiSetVisible(timerT, false) addEventHandler("onClientColShapeHit", warehouseCol, function(theElement) if isElementWithinColShape ( localPlayer, warehouseCol ) then setElementData(localPlayer, "timer", 300) guiSetVisible(timerT, true) theTimer = setTimer ( function ( ) gpt = getElementData(localPlayer, "timer") setElementData(localPlayer, "timer", gpt-1) guiSetText(timerT, "Defend Warehouse: "..gpt) end, 1000, 300 ) addEventHandler("onClientColShapeLeave", warehouseCol, function() killTimer(theTimer) setElementData(localPlayer, "timer", 300) guiSetText(timerT, "Defend Warehouse: "..gpt) guiSetVisible(timerT, false) end) addEventHandler("onClientElementDataChange", localPlayer, function() if getElementData(localPlayer, "timer") == -2 then outputChatBox ( "Deliver The Supply Truck!", 0, 255, 0 ) triggerServerEvent ( "spawnSupplies", localPlayer, "spawnSupplies" ) end end) end end) Server: function supplySpawn () supplytruck = createVehicle ( 498, 2525, 2810, 11.2, 0, 0, 180 ) warpPedIntoVehicle ( source, supplytruck) stb = createBlipAttachedTo ( supplytruck, 51, 2, 255, 0, 0, 255, 0, 65535 ) dropoff = createMarker(285.5, 2498.8000488281, 16.5, "cylinder", 10, 255, 0, 255, 255, source) dob = createBlipAttachedTo ( dropoff, 35, 2, 255, 0, 0, 255, 0, 65535, source ) addEventHandler("onMarkerHit", dropoff, function() if isElementWithinMarker ( supplytruck, dropoff ) then destroyElement(dropoff) destroyElement(supplytruck) destroyElement(stb) destroyElement(dob) outputChatBox ( "Supply Truck Delivered Successfully! Rewards Recieved!", thePlayer, 0, 255, 0 ) givePlayerMoney(root, math.random(1000,5000)) giveWeapon(root, math.random(1, 46), math.random(0,100)) giveWeapon(root, math.random(1, 46), math.random(0,100)) giveWeapon(root, math.random(1, 46), math.random(0,100)) end end) addEventHandler("onVehicleExplode", supplytruck, function() outputChatBox ( "Supply Truck Destroyed! MISSION FAILED!", thePlayer, 255, 0, 0 ) destroyElement(supplytruck) destroyElement(dropoff) destroyElement(stb) destroyElement(dob) end) end addEvent( "spawnSupplies", true ) addEventHandler( "spawnSupplies", root, supplySpawn )
-
I figured out a way to make it work without vmware and virtual box
-
yes but i need 2 clients
-
i was trying to use vmware to solo test some scripts with 2 players and it says banned by mta reason 4e security whatever vm type something so wondering whats the best way to test my scripts solo?
-
i redid it works well i just used my display and text item ima post a video lmk what you think bro
-
yknow what buddy ima remake this buut completely server side
-
heres a video
-
guess what buddy i was able to use the old script and i fixed it completely. using what you taught me. i found this little piece of code useful (shape == warehouse_col) and my finished script here. function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,...) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getCameraMatrix() local distance = distance or 20 local height = height or 1 if (isLineOfSightClear(x, y, z+2, x2, y2, z2, ...)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") end end end end --Warehouse Zones createBlip(2577, 2822, 11, 22) WarehouseCol1 = createColRectangle( 2535, 2796, 80, 50 ) WarehouseArea1 = createRadarArea( 2535, 2796, 80, 50, 0, 0, 255, 90, root ) setElementData(WarehouseCol1, "warehoue", true) setElementData(WarehouseArea1, "warehoue", true) --Leaving the warehouse function warehouseLeave() if (getElementType(source) == "ped") or (getElementType(source) == "marker") then return end --thought maybe this would work if isElementWithinColShape(localPlayer, WarehouseCol1) == true then timertxt = getElementData(localPlayer, "timer") Wtimer = dxDrawTextOnElement(localPlayer, "Defend Warehouse: "..timertxt, 1, 20, 255, 0, 255, 255, 5, "arial") elseif Wtimer == nil then return else destroyElement(Wtimer) end end addEventHandler("onClientRender", getRootElement(), warehouseLeave) addEventHandler("onClientElementColShapeLeave", localPlayer, warehouseLeave) --warehouse timer function warehoueTimer() if (getElementType(localPlayer) == "ped") or (getElementType(localPlayer) == "marker") then return end --thought maybe this would work timerW = getElementData(localPlayer, "timer") if isElementWithinColShape(localPlayer, WarehouseCol1) == true and getElementData(localPlayer, "timer") >= 1 then setElementData(localPlayer, "timer", timerW-1) elseif isElementWithinColShape(localPlayer, WarehouseCol1) == true and getElementData(localPlayer, "timer") == 0 then triggerServerEvent("doSupplyTruck", localPlayer) end end --Entering warehouse function warehoueEnter(shape) if (getElementType(source) == "ped") or (getElementType(source) == "marker") or (shape ~= WarehouseCol1) then return end --thought maybe this would work if isElementWithinColShape(localPlayer, WarehouseCol1) == true and (shape == WarehouseCol1) then setElementData(localPlayer, "timer", 60) :O = setTimer(warehoueTimer, 1000, 61) else killTimer(:O) end end addEventHandler("onClientElementColShapeLeave", localPlayer, warehoueEnter) addEventHandler("onClientElementColShapeHit", localPlayer, warehoueEnter) --switch from destroyed element source to player source function switchh() triggerServerEvent("switch2", localPlayer) end addEventHandler( "switch", localPlayer, switchh ) addEvent( "switch", true ) this is my largest script ive ever written other than guis i think i did pretty good it works flawless.