WASSIm. Posted May 14, 2013 Share Posted May 14, 2013 hi guys i want if of 20 to 7 hour create object and if not. create marker if (h > 7) and (h < 20) then local marker = createObject(3877,tonumber(getElementData(groundweapon, "posX")), tonumber(getElementData(groundweapon, "posY")), tonumber(getElementData(groundweapon, "posZ"))-1) setElementCollisionsEnabled(marker,false) setElementAlpha(marker,0) setElementInterior(marker, tonumber(getElementData(groundweapon, "interior"))) setElementDimension(marker, tonumber(getElementData(groundweapon, "dimension"))) setElementData(temp, "colshape.marker", marker) else local marker = createMarker(tonumber(getElementData(groundweapon, "posX")), tonumber(getElementData(groundweapon, "posY")), tonumber(getElementData(groundweapon, "posZ"))+0.05, "corona", 0.5, weaponmarkercolors[slot][1],weaponmarkercolors[slot][2], weaponmarkercolors[slot][3], 80) setElementInterior(marker, tonumber(getElementData(groundweapon, "interior"))) setElementDimension(marker, tonumber(getElementData(groundweapon, "dimension"))) setElementData(temp, "colshape.marker", marker) end Link to comment
PaiN^ Posted May 14, 2013 Share Posted May 14, 2013 if isElement then destroyElement end Link to comment
WASSIm. Posted May 14, 2013 Author Share Posted May 14, 2013 if isElement then destroyElement end NO. i want if hour of 20 to 7 createobject and if hour of 7 to 20 createmarker Link to comment
WASSIm. Posted May 14, 2013 Author Share Posted May 14, 2013 getTime is already local h, m = getTime() Link to comment
Castillo Posted May 15, 2013 Share Posted May 15, 2013 And why it doesn't work? have you got any errors on debug? Link to comment
WASSIm. Posted May 15, 2013 Author Share Posted May 15, 2013 no but is just create marker EVERYTIME i think problem to < > Link to comment
iPrestege Posted May 15, 2013 Share Posted May 15, 2013 You mean the problem is the marker creating more than one? Link to comment
Castillo Posted May 15, 2013 Share Posted May 15, 2013 if (h > 7) and (h < 20) then That'll only create the object if the hour is higher than 7, maybe you wanted to create the object if hour is equal or higher than 7? Link to comment
Castillo Posted May 15, 2013 Share Posted May 15, 2013 Try debugging it, see what "h" returns. 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