-
Posts
164 -
Joined
-
Last visited
-
Days Won
1
Everything posted by kewizzle
-
expected element at argument 2 for addEventHandler onPedWasted
-
each time the spawnSurvivor function is called by setTimer it spawns a new survivorPed with a random location in the table and a random skin. Basically onPedWasted it destroys the ped, blimp and marker and then 15 seconds later respawns somewhere else, kinda like breifcase.
-
still not working as it should, both scripts however did a random spawn and skin on each resource restart tho.
-
local spawns = { { -786, 893, 13, 90.0 }, { -767, 882, 13, 120.6928 } } local livingPeds = { { 0 }, { 104 } }
-
so I am trying to create a random survivor script and when the first survivor dies survivorPed it also destroys elements survivorMarker, survivorBlip and survivorPed. But when the next survivor spawns it does not do that and it does not spawn a survivor after 15 seconds. addEventHandler("onResourceStart", root, function() function spawnSurvivor() survivorPed = createPed(livingPeds[rnd2][1], spawns[rnd][1], spawns[rnd][2], spawns[rnd][3], spawns[rnd][4]) survivorMarker = createMarkerAttachedTo ( survivorPed, "cylinder", 4.0, 0, 0, 255, 255 ) survivorBlip = createBlipAttachedTo( survivorPed, 47 ) outputChatBox("The Survivor Was Saved! New one spawning soon.") end spawnSurvivor() addEventHandler("onPedWasted", survivorPed, function() outputChatBox("The Survivor Was Saved! New one spawning soon.") destroyElement(survivorMarker) destroyElement(survivorBlip) destroyElement(survivorPed) setTimer(spawnSurvivor, 15000, 1) end) end) this works but now the location isnt random function spawnSurvivor() survivorPed = createPed(livingPeds[rnd2][1], spawns[rnd][1], spawns[rnd][2], spawns[rnd][3], spawns[rnd][4]) survivorMarker = createMarkerAttachedTo ( survivorPed, "cylinder", 4.0, 0, 0, 255, 255 ) survivorBlip = createBlipAttachedTo( survivorPed, 47 ) outputChatBox("The Survivor Was Saved! New one spawning soon.") addEventHandler("onPedWasted", survivorPed, function() outputChatBox("The Survivor Was Saved! New one spawning soon.") destroyElement(survivorMarker) destroyElement(survivorBlip) destroyElement(survivorPed) setTimer(spawnSurvivor, 15000, 1) end) end addEventHandler("onResourceStart", root, function() spawnSurvivor() end)
-
i sent you the wrong code i meant this function OpenWindow(thePlayer) local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if thePlayer == getLocalPlayer() and (getElementData(localPlayer,"Level")) <= 59 and pZ <= mZ + 3 then outputChatBox("You must be atleast Level 60 to access the Special Weapon Shop!", 255, 0, 0) else if ( guiGetVisible ( specialWshop ) == false ) and thePlayer == getLocalPlayer() then guiSetVisible ( specialWshop, true ) showCursor ( true ) end end end end addEventHandler("onClientMarkerHit", special, OpenWindow) addEventHandler("onClientMarkerHit", specialSC, OpenWindow) yours works tho
-
doesnt open at all now function OpenWindow(thePlayer) local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if thePlayer == getLocalPlayer() and (getElementData(localPlayer,"Level")) <= 59 then outputChatBox("You must be atleast Level 60 to access the Special Weapon Shop!", 255, 0, 0) else if ( guiGetVisible ( specialWshop ) == false ) and thePlayer == getLocalPlayer() then guiSetVisible ( specialWshop, true ) showCursor ( true ) end end end addEventHandler("onClientMarkerHit", special, OpenWindow) addEventHandler("onClientMarkerHit", specialSC, OpenWindow)
-
ill try this out in a little bit.
-
not even in the marker just above it and the GUI opens.
-
each can have 2 cars
-
client for _, veh in ipairs ( ownedCars ) do row = guiGridListAddRow ( ownedVehicles ) guiGridListSetItemText ( ownedVehicles, row, column, tostring(veh), false, false ) end server ownedCars = {executeSQLQuery("SELECT Model FROM carslot1 WHERE PlayerName=?",playerName)} im not to sure if this is how you do it on the server side. Probably not since i never worked with sql and im just now learning.. but i dont know how i would go about getting the server side table in my client side function either.
-
i opened registry.db and found this how would i get the model id column and insert it into a gridlist ? I tried a few things but all failed. heres the server side createsql function executeSQLQuery("CREATE TABLE IF NOT EXISTS carslot1 (PlayerName TEXT, Model NUMERIC, Cost NUMERIC, Paintjob NUMERIC, Color TEXT, Upgrade0 NUMERIC, Upgrade1 NUMERIC, Upgrade2 NUMERIC, Upgrade3 NUMERIC, Upgrade4 NUMERIC, Upgrade5 NUMERIC, Upgrade6 NUMERIC, Upgrade7 NUMERIC, Upgrade8 NUMERIC, Upgrade9 NUMERIC, Upgrade10 NUMERIC, Upgrade11 NUMERIC, Upgrade12 NUMERIC, Upgrade13 NUMERIC, Upgrade14 NUMERIC, Upgrade15 NUMERIC, Upgrade16 NUMERIC)") here is my gridlist in client ownedVehicles = guiCreateGridList(633, 257, 333, 254, false)
-
i just learned this
-
works now. local tag = dxCreateTexture("redDot.png") addEvent("onClientPreRender", true) addEventHandler("onClientPreRender", root, function() for k,v in ipairs(getElementsByType("ped")) do if getElementHealth(v) >= 50 then dxDrawImageOnElement(v,tag) end end end)
-
I did this, but i dont know how to make it for only peds with health >= 50 local tag = dxCreateTexture("redDot.png") addEventHandler("onClientPreRender", root, function() for k,v in ipairs(getElementsByType("ped")) do dxDrawImageOnElement(v,tag) end end)
-
I tried this but it doesnt work. client.lua addEvent("Zomb_STFU",true) addEventHandler("Zomb_STFU",root, function ( zomb ) triggerServerEvent ( "onZombieSpawned", zomb ) end) addEvent("drawLevelSt", true) addEventHandler("drawLevelSt", root, function() local x, y = getElementPosition(source) function renderDisplay ( ) local seconds = getTickCount() / 1000 local angle = math.sin(seconds) * 80 dxDrawImage ( x, y, 100, 240, 'arrow.png', angle, 0, -120 ) end function HandleTheRendering ( ) addEventHandler("onClientRender", root, renderDisplay) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) end) server.lua addEvent("onZombieSpawned",true) addEventHandler("onZombieSpawned",root, function ( ) setElementHealth ( source, math.random(25, 100 ) ) if getElementHealth(source) >= 50 then triggerClientEvent ( "drawLevelSt", source, drawLevelStn, source ) end end) i found this dxDrawImageOnElement now to sure how it works ... just read it and i get errors.
-
how would i go about attaching an image above a zombies head to indicate the zombies health/strength addEvent("onZombieSpawned",true) addEventHandler("onZombieSpawned",root, function ( ) setElementHealth ( source, math.random(25, 100 ) ) if getElementHealth(source) >= 50 then end end)
-
Hello Everyone! Today I am going to bring to you guys a brand new zombie server. It was inspired by Buffalo over at Zombie Hell Party, matter of fact if it wasn't for him I wouldn't have went out of my way to learn Lua. His creations made me want to build my own! So here's a start I am posting about my server that is now in Beta mode. Before you join tho here's some tasty information about my server. Rules What are you expecting here? There is only one rule, no cheating. You may be as edgy as you want, I do not ban players over the words they say and use. You can cuss me out, the proud owner and I still wont ban you, but lets say you cuss me out and put on god mode and start flying around Los Santos.. You will be banned, not for the words you used but for the cheating tools you have implemented into my hard work. Account Saving There is a account system in which you cannot do anything without, If you do not register and login you cannot play. There is no guest option. The benefits of having account are substantial. Having account saves data like money earned, exp earned, levels acquired, weapons bought, skins bought, location, zombies killed and so on. Without this little feature the game would be less fun. Drop System There is a system in which when a zombie is killed it will drop a weapon with a small amount of ammo. It is your choice to either use the ammo or sell the ammo for a small profit. Each bullet is currently worth $1 in-game cash and for every bullet you sell you will receive $1. Exp System There is a exp system in which numbers are fabricated out of thin air and makes you much more wise. This is a modified version of Manawydan's exp system. I modified it so the exp resets on each level up and added some new sounds from the SEGA game Phantasy Star Universe. You unlock things on certain levels and when you unlock something new a message pops up telling you what you have unlocked. There are currently 100 levels. Shopping There are several shops at the spawn location and at the bases throughout San Andreas, these locations can be used to upgrade weapon stats, buy weapons, buy skins and even if your level is high enough buy special weapons using the cash earned from killing zombies. Relaxing In my server there are some interactive objects such as chairs, couches and radio. To use these things go to the starting base and inside the custom made building press "M" to make the mouse visible and click the chairs and couches to sit down and when you're bored of sitting simply right click to stand up and go kill some zombies you loser! You can turn the speaker on by clicking it as well! Gates Each base in my server contains a gate you can use to enter and exit each base. To open the gate you have to be a REAL player which means zombies cannot get in. If however they do they will be killed by the anti zombie area. Zombies killed by the anti zombie area as well as cars will not drop any weapons and will not reward any players with a cash prize. Spawning Each new player joins the game starting at the little cabin just outside Las Venturas near Tierra Rhobada. They will spawn with a colt 45 handgun with 15 ammo. Upon death if the player has less than 15 ammo they will respawn with 15 ammo again. If otherwise they won't gain any new ammo. You will respawn with all the weapons you had when you died and you will keep your money. When you logout your position will be saved and when you spawn back in you will be where you where when you logged out with all your stats, money and weapons. Custom Models I have made a few custom models especially for the server, along with some models from the community. The current server size is just under 100MB. If you don't wanna download 100MB then this isn't for you, but this is a lot less than a lot of servers. My server has a few custom player models and a few custom buildings and textures. The buildings and building textures were done by me and the player models were people from the community. I hope you guys enjoy them all. Future Updates I have plans to keep adding new things but a few things I have in mind are as follows: Tougher zombies, Bosses, Health Regain, New things to unlock, HD weapon models, more edited textures, vehicle ownership, fuel system, vehicles around the city, more bases, double exp and double cash coupons, inventory system, health items, food and much more! Video Coming Soon Here's Some Photos Server IP: mtasa://24.252.13.236:22003
-
if you are trying to get it to work you dont have to worry, the way i have it setup now works just fine. I removed the progress bars and just use button text to tell the player their current progress.
-
simplified it a little bit. addEventHandler("onClientGUIClick", ak47B, function() if source == ak47B then local stat8 = getPedStat (getLocalPlayer(),77) local SPr = guiProgressBarSetProgress local gST = guiSetText triggerServerEvent ("setAK471",getLocalPlayer(),setAK471) if stat8 == 0 then gST(ak47B, "$2500") elseif stat8 == 100 then gST(ak47B, "$2600") elseif stat8 == 200 then gST(ak47B, "$2700") elseif stat8 == 300 then gST(ak47B, "$2800") elseif stat8 == 400 then gST(ak47B, "$2900") elseif stat8 == 500 then gST(ak47B, "$3000") elseif stat8 == 600 then gST(ak47B, "$3100") elseif stat8 == 700 then gST(ak47B, "$3200") elseif stat8 == 800 then gST(ak47B, "$3300") elseif stat8 == 900 then gST(ak47B, "$3400") elseif stat8 == 1000 then gST(ak47B, "Max!") end if stat8 == 0 then SPr(ak47Pr, 0) elseif stat8 == 100 then SPr(ak47Pr, 10) elseif stat8 == 200 then SPr(ak47Pr, 20) elseif stat8 == 300 then SPr(ak47Pr, 30) elseif stat8 == 400 then SPr(ak47Pr, 40) elseif stat8 == 500 then SPr(ak47Pr, 50) elseif stat8 == 600 then SPr(ak47Pr, 60) elseif stat8 == 700 then SPr(ak47Pr, 70) elseif stat8 == 800 then SPr(ak47Pr, 80) elseif stat8 == 900 then SPr(ak47Pr, 90) elseif stat8 == 1000 then SPr(ak47Pr, 100) end end end) Here's my gui: GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() skillwindow = guiCreateWindow((screenW - 462) / 2, (screenH - 328) / 2, 462, 328, "Kewizzle's Skill Shop", false) guiWindowSetSizable(skillwindow, false) guiSetProperty(skillwindow, "CaptionColour", "FF0EECCA") guiSetVisible( skillwindow, not guiGetVisible( skillwindow ) ) ak47L = guiCreateLabel(10, 24, 74, 15, "AK-47 Skill:", false, skillwindow) guiSetFont(ak47L, "clear-normal") guiLabelSetColor(ak47L, 254, 0, 0) ak47Pr = guiCreateProgressBar(104, 24, 234, 15, false, skillwindow) tech9L = guiCreateLabel(10, 49, 74, 15, "Tech-9 Skill:", false, skillwindow) guiLabelSetColor(tech9L, 246, 80, 7) tech9Pr = guiCreateProgressBar(104, 48, 234, 16, false, skillwindow) pistolL = guiCreateLabel(10, 74, 74, 15, "Shotgun Skill:", false, skillwindow) guiLabelSetColor(pistolL, 246, 153, 6) ShotgPr = guiCreateProgressBar(104, 74, 234, 15, false, skillwindow) GUIEditor.label[1] = guiCreateLabel(10, 99, 74, 15, "Pistol Skill:", false, skillwindow) guiLabelSetColor(GUIEditor.label[1], 246, 203, 5) pistolPr = guiCreateProgressBar(104, 99, 234, 15, false, skillwindow) silenceL = guiCreateLabel(10, 124, 74, 15, "Silenced Skill:", false, skillwindow) guiLabelSetColor(silenceL, 181, 236, 13) silencedPr = guiCreateProgressBar(104, 124, 234, 15, false, skillwindow) sniperL = guiCreateLabel(10, 149, 74, 15, "Sniper Skill:", false, skillwindow) guiLabelSetColor(sniperL, 13, 235, 28) sniperPr = guiCreateProgressBar(104, 149, 234, 15, false, skillwindow) mp5L = guiCreateLabel(10, 174, 74, 15, "MP5 Skill:", false, skillwindow) guiLabelSetColor(mp5L, 15, 232, 168) mp5Pr = guiCreateProgressBar(104, 173, 234, 16, false, skillwindow) m4L = guiCreateLabel(10, 199, 74, 15, "M4 Skill:", false, skillwindow) guiLabelSetColor(m4L, 17, 202, 229) m4Pr = guiCreateProgressBar(104, 199, 234, 15, false, skillwindow) spazPr = guiCreateProgressBar(104, 224, 234, 15, false, skillwindow) spazL = guiCreateLabel(10, 226, 74, 13, "Spaz12 Skill:", false, skillwindow) guiLabelSetColor(spazL, 38, 18, 227) deagleL = guiCreateLabel(10, 249, 74, 15, "Deagle Skill:", false, skillwindow) guiLabelSetColor(deagleL, 165, 18, 226) deaglePr = guiCreateProgressBar(104, 249, 234, 15, false, skillwindow) ak47B = guiCreateButton(353, 24, 83, 15, "select", false, skillwindow) guiSetProperty(ak47B, "NormalTextColour", "FF05EE2B") tech9B = guiCreateButton(353, 48, 83, 16, "select", false, skillwindow) guiSetProperty(tech9B, "NormalTextColour", "FF05EE2B") shotgunB = guiCreateButton(354, 74, 82, 15, "select", false, skillwindow) guiSetProperty(shotgunB, "NormalTextColour", "FF05EE2B") pistolB = guiCreateButton(354, 99, 82, 15, "select", false, skillwindow) guiSetProperty(pistolB, "NormalTextColour", "FF05EE2B") silenceB = guiCreateButton(354, 123, 82, 16, "select", false, skillwindow) guiSetProperty(silenceB, "NormalTextColour", "FF05EE2B") sniperB = guiCreateButton(354, 147, 82, 16, "select", false, skillwindow) guiSetProperty(sniperB, "NormalTextColour", "FF05EE2B") mp5B = guiCreateButton(353, 173, 83, 16, "select", false, skillwindow) guiSetProperty(mp5B, "NormalTextColour", "FF05EE2B") m4B = guiCreateButton(353, 197, 83, 17, "select", false, skillwindow) guiSetProperty(m4B, "NormalTextColour", "FF05EE2B") spazB = guiCreateButton(354, 223, 82, 16, "select", false, skillwindow) guiSetProperty(spazB, "NormalTextColour", "FF05EE2B") deagleB = guiCreateButton(354, 249, 82, 15, "select", false, skillwindow) guiSetProperty(deagleB, "NormalTextColour", "FF05EE2B") exitShop = guiCreateButton(180, 281, 102, 37, "Exit", false, skillwindow) guiSetProperty(exitShop, "NormalTextColour", "FFFE0005")
-
i can but one second im adding an exit button atm. before i do that i just tested this guys code that posted before you it works, but i need to fix it to on button click as well if i cant get that to work ill be back. okay it works on marker hit but when i press the button the progressbar goes back down for some reason and stays there. addEventHandler("onClientGUIClick", ak47B, function() if source == ak47B then triggerServerEvent ("setAK471",getLocalPlayer(),setAK471) if getPlayerStat(getLocalPlayer(),77) == 0 then guiSetText(ak47B, "$2500") end if getPlayerStat(getLocalPlayer(),77) == 100 then guiSetText(ak47B, "$2600") end if getPlayerStat(getLocalPlayer(),77) == 200 then guiSetText(ak47B, "$2700") end if getPlayerStat(getLocalPlayer(),77) == 300 then guiSetText(ak47B, "$2800") end if getPlayerStat(getLocalPlayer(),77) == 400 then guiSetText(ak47B, "$2900") end if getPlayerStat(getLocalPlayer(),77) == 500 then guiSetText(ak47B, "$3000") end if getPlayerStat(getLocalPlayer(),77) == 600 then guiSetText(ak47B, "$3100") end if getPlayerStat(getLocalPlayer(),77) == 700 then guiSetText(ak47B, "$3200") end if getPlayerStat(getLocalPlayer(),77) == 800 then guiSetText(ak47B, "$3300") end if getPlayerStat(getLocalPlayer(),77) == 900 then guiSetText(ak47B, "$3400") end if getPlayerStat(getLocalPlayer(),77) == 1000 then guiSetText(ak47B, "Max!") end local stat8 = getPedStat (getLocalPlayer(),77) if stat8 == 0 then guiProgressBarSetProgress(ak47Pr, 0) elseif stat8 == 100 then guiProgressBarSetProgress(ak47Pr, 10) elseif stat8 == 200 then guiProgressBarSetProgress(ak47Pr, 20) elseif stat8 == 300 then guiProgressBarSetProgress(ak47Pr, 30) elseif stat8 == 400 then guiProgressBarSetProgress(ak47Pr, 40) elseif stat8 == 500 then guiProgressBarSetProgress(ak47Pr, 50) elseif stat8 == 600 then guiProgressBarSetProgress(ak47Pr, 60) elseif stat8 == 700 then guiProgressBarSetProgress(ak47Pr, 70) elseif stat8 == 800 then guiProgressBarSetProgress(ak47Pr, 80) elseif stat8 == 900 then guiProgressBarSetProgress(ak47Pr, 90) elseif stat8 == 1000 then guiProgressBarSetProgress(ak47Pr, 100) end end end)
-
tested this: local stat8 = getPlayerStat (getLocalPlayer(),77) addEventHandler("onClientGUIClick", resourceRoot, function() if source == ak47B then triggerServerEvent ("setAK471",getLocalPlayer(),setAK471) guiProgressBarSetProgress(ak47Pr,tonumber(stat8/10)) end end) end) And This: local stat8 = getPlayerStat (getLocalPlayer(),77) addEventHandler("onClientGUIClick", root, function() if source == ak47B then triggerServerEvent ("setAK471",getLocalPlayer(),setAK471) guiProgressBarSetProgress(ak47Pr,tonumber(stat8/10)) end end) end)
-
unfortunately that didnt work, i didnt think it would. but just tested.
-
i had it like this with all the stats, was testing it while using the button and everytime i clicked the button it wouldnt change. local stat8 = getPlayerStat (getLocalPlayer(),77) addEventHandler("onClientGUIClick", ak47B, function() if source == ak47B then triggerServerEvent ("setAK471",getLocalPlayer(),setAK471) guiProgressBarSetProgress(ak47Pr,tonumber(stat8/10)) end end) end)
-
unfortunately i removed the progress bars because they wouldnt update everytime i hit the marker. If you knew a solution id add this back.