JeweL Posted July 25, 2020 Share Posted July 25, 2020 Can anyone help me too? The gamemode a5.5.6 DayZ MTA The animations get stuck when they give me a Medic Kit, food or water ... can someone help me please! Link to comment
Scripting Moderators ds1-e Posted July 25, 2020 Scripting Moderators Share Posted July 25, 2020 1 hour ago, JeweL said: Can anyone help me too? The gamemode a5.5.6 DayZ MTA The animations get stuck when they give me a Medic Kit, food or water ... can someone help me please! Set loop to false in setPedAnimation. Link to comment
JeweL Posted July 26, 2020 Author Share Posted July 26, 2020 9 hours ago, majqq said: Set loop to false in setPedAnimation. It's already "false". function onPlayerRequestChangingStats(itemName,itemInfo,data) if data == "food" then if itemName == "Burger" then blood = 300 elseif itemName == "Pizza" then blood = 300 elseif itemName == "Cooked Meat" then blood = 800 elseif itemName == "Beans Can" then blood = 200 elseif itemName == "Pasta Can" then blood = 200 end setPedAnimation (source,"FOOD","EAT_Burger",nil,false,false,nil,false) setElementData(source,itemName,getElementData(source,itemName)-1) addPlayerStats (source,"blood",blood) addPlayerStats (source,data,gameplayVariables["foodrestore"]) -- Restores a random amount between 40-100 (hunger) - default: 100 elseif data == "thirst" then setElementData(source,itemName,getElementData(source,itemName)-1) addPlayerStats (source,data,gameplayVariables["thirstrestore"]) -- Restores a random amount between 40-100 (thirst) default: 100 setPedAnimation (source,"VENDING","VEND_Drink2_P",nil,false,false,nil,false) if itemName == "Water Bottle" then setElementData(source,"Empty Water Bottle",(getElementData(source,"Empty Water Bottle") or 0)+1) end end triggerClientEvent (source, "displayClientInfo", source,"Food",shownInfos["youconsumed"].." "..itemName,22,255,0) triggerClientEvent(source,"refreshInventoryManual",source) end addEvent("onPlayerRequestChangingStats",true) addEventHandler("onPlayerRequestChangingStats",getRootElement(),onPlayerRequestChangingStats) Link to comment
Scripting Moderators ds1-e Posted July 26, 2020 Scripting Moderators Share Posted July 26, 2020 26 minutes ago, JeweL said: It's already "false". function onPlayerRequestChangingStats(itemName,itemInfo,data) if data == "food" then if itemName == "Burger" then blood = 300 elseif itemName == "Pizza" then blood = 300 elseif itemName == "Cooked Meat" then blood = 800 elseif itemName == "Beans Can" then blood = 200 elseif itemName == "Pasta Can" then blood = 200 end setPedAnimation (source,"FOOD","EAT_Burger",nil,false,false,nil,false) setElementData(source,itemName,getElementData(source,itemName)-1) addPlayerStats (source,"blood",blood) addPlayerStats (source,data,gameplayVariables["foodrestore"]) -- Restores a random amount between 40-100 (hunger) - default: 100 elseif data == "thirst" then setElementData(source,itemName,getElementData(source,itemName)-1) addPlayerStats (source,data,gameplayVariables["thirstrestore"]) -- Restores a random amount between 40-100 (thirst) default: 100 setPedAnimation (source,"VENDING","VEND_Drink2_P",nil,false,false,nil,false) if itemName == "Water Bottle" then setElementData(source,"Empty Water Bottle",(getElementData(source,"Empty Water Bottle") or 0)+1) end end triggerClientEvent (source, "displayClientInfo", source,"Food",shownInfos["youconsumed"].." "..itemName,22,255,0) triggerClientEvent(source,"refreshInventoryManual",source) end addEvent("onPlayerRequestChangingStats",true) addEventHandler("onPlayerRequestChangingStats",getRootElement(),onPlayerRequestChangingStats) Try changing: setPedAnimation (source,"FOOD","EAT_Burger",nil,false,false,nil,false) To: setPedAnimation(source, "FOOD","EAT_Burger", -1, false, false, false, false, -1, false) For future please use "Code", help yourself and others. If you want you can use newer version of DayZ mode because yours is very outdated. https://github.com/NullSystemWorks/mtadayz 1 Link to comment
JeweL Posted July 26, 2020 Author Share Posted July 26, 2020 21 minutes ago, majqq said: Try changing: setPedAnimation (source,"FOOD","EAT_Burger",nil,false,false,nil,false) To: setPedAnimation(source, "FOOD","EAT_Burger", -1, false, false, false, false, -1, false) For future please use "Code", help yourself and others. If you want you can use newer version of DayZ mode because yours is very outdated. https://github.com/NullSystemWorks/mtadayz thx for gamemode! Link to comment
JeweL Posted July 26, 2020 Author Share Posted July 26, 2020 function zombieSpawning() local x, y, z = getElementPosition(getLocalPlayer()) local material,hitX, hitY, hitZ = isObjectAroundPlayer2 ( getLocalPlayer(), 30, 3 ) if material == 0 and not isInBuilding(x,y,z) then triggerServerEvent("createZomieForPlayer",getLocalPlayer(),hitX, hitY, hitZ) end end setTimer(zombieSpawning,3000,0) Another one bug ... zombie didnt spawn.. 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