swedishboy
Members-
Posts
45 -
Joined
-
Last visited
Details
-
Gang
Elk
swedishboy's Achievements
Rat (9/54)
0
Reputation
-
Will try it later. Thanks
-
Hi, I will make a button that refresh a resource but i dont know what i exactly need to use to do it. The button is no problem for me to do, but to get the resource i want to refresh is the problem.
-
@mr.Loki Thanks alot!
-
I made this and it works but only on 1 marker not on all markers in the table.. local spots = { {2488.32886, -1670.63599, 12.33595}, {2490.92886, -1670.63599, 12.33595}, {2495.92886, -1670.63599, 12.33595} } for k,v in ipairs (spots) do marker1 = createMarker(v[1], v[2], v[3], "cylinder", 1.2, 22, 22, 22) end function getHp (player) local money = getPlayerMoney(player) local hpp = getElementHealth(player) if money >= 1000 and hpp < 100 then setElementHealth(player, 100) takePlayerMoney(player, 1000) elseif money >= 1000 and hpp >= 100 then outputChatBox("Your HP is already full", player, 222, 44, 22) elseif money < 1000 then outputChatBox("You don't have enough money", player, 222, 44, 22) end end addEventHandler("onMarkerHit", marker1, getHp)
-
Thanks but that wont work
-
Like this? local spots = { {2488.32886, -1670.63599, 12.33595}, {2490.92886, -1670.63599, 12.33595}, {2495.92886, -1670.63599, 12.33595} } function getHp (player) for k,v in ipairs (spots) do marker1 = createMarker(v[1],v[2],v[3], "cylinder", 1.2, 22, 22, 22) addEventHandler("onMarkerHit", marker1, getHp) end local money = getPlayerMoney(player) local hpp = getElementHealth(player) if money >= 1000 and hpp < 100 then setElementHealth(player, 100) takePlayerMoney(player, 1000) elseif money >= 1000 and hpp >= 100 then outputChatBox("Your HP is already full", player, 222, 44, 22) elseif money < 1000 then outputChatBox("You don't have enough money", player, 222, 44, 22) end end
-
I can see the markers with this code but still not working.. getting this warning Bad argument @ 'addEventHandler' [expected element at argument 3, got nil] local spots = { {2488.32886, -1670.63599, 12.33595}, {2490.92886, -1670.63599, 12.33595}, {2495.92886, -1670.63599, 12.33595} } for k,v in ipairs (spots) do marker1 = createMarker(v[1],v[2],v[3], "cylinder", 1.2, 22, 22, 22) addEventHandler("onMarkerHit", marker1, getHp) end function getHp (player) local money = getPlayerMoney(player) local hpp = getElementHealth(player) if money >= 1000 and hpp < 100 then setElementHealth(player, 100) takePlayerMoney(player, 1000) elseif money >= 1000 and hpp >= 100 then outputChatBox("Your HP is already full", player, 222, 44, 22) elseif money < 1000 then outputChatBox("You don't have enough money", player, 222, 44, 22) end end
-
Hello. I cant see the markers and im getting this warning in debugscript Bad argument @ 'addEventHandler' [expected element at argument 2, got nil] local spots = { {2488.32886, -1670.63599, 12.33595}, {2490.92886, -1670.63599, 12.33595}, {2495.92886, -1670.63599, 12.33595}, } function getHp (player) for k,v in ipairs (spots) do marker1 = createMarker(v[1],v[2],v[3], "cylinder", 1.2, 22, 22, 22) end local money = getPlayerMoney(player) local hpp = getElementHealth(player) if money >= 1000 and hpp < 100 then setElementHealth(player, 100) takePlayerMoney(player, 1000) elseif money >= 1000 and hpp >= 100 then outputChatBox("Your HP is already full", player, 222, 44, 22) elseif money < 1000 then outputChatBox("You don't have enough money", player, 222, 44, 22) end end addEventHandler("onMarkerHit", marker1, getHp)
-
help/dayz- attempt to index global "gameplayvariables"
swedishboy replied to bundiiE's topic in Scripting
value = gameplayVariables And the errors show ''gameplayvariables'' make sure it is ''gameplayVariables'' because the error got that means it doesn't exist -
Ye you can do it that way too, it's up to him waht he want to use. And btw @GrinningTrout change the outputChatBox ''thePlayer'' to ''source'' or the whole server will see the output
-
I don't know what you exactly want but i made this.. server-side: function getArmor () local armor = getPlayerArmor(source) local money = getPlayerMoney(source) if money >= 100 and armor < 100 then setPedArmor(source,armor+50) takePlayerMoney(source, 100) elseif money >= 100 and armor >= 100 then outputChatBox("Already full armor", source, 255, 0, 0) elseif money < 100 then outputChatBox("Not enough money", source, 255, 0, 0) end end addEvent("onarmorb", true) addEventHandler("onarmorb", root, getArmor) client-side: mywindow = guiCreateWindow(564, 440, 169, 111, "", false) guiWindowSetSizable(mywindow, false) armorB = guiCreateButton(19, 26, 130, 42, "Armor", false, mywindow) closeB = guiCreateButton(42, 74, 86, 27, "Close", false, mywindow) guiSetVisible(mywindow, false) addCommandHandler("y", function () if guiGetVisible(mywindow) == false then guiSetVisible(mywindow, true) showCursor(true) end end ) addEventHandler("onClientGUIClick", closeB, function() guiSetVisible(mywindow,false) showCursor(false) end,false) addEventHandler("onClientGUIClick", armorB, function() triggerServerEvent("onarmorb", getLocalPlayer()) end,false) Use command /y
-
hi. https://wiki.multitheftauto.com/wiki/Ev ... ce_Element about errors and warnings https://wiki.multitheftauto.com/wiki/Debugging
-
If i understood you right addCommandHandler ( Command, -- Adding The Command Handler function ( player, cmd ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("PMG")) then triggerClientEvent(player,"jailShow",player) else outputChatBox(" Access Denied ",player,255,0,0) end end )
-
Looking for this? https://wiki.multitheftauto.com/wiki/GuiCreateEdit