PauloCascus Posted July 21, 2014 Share Posted July 21, 2014 I want to add get/setElementData to the code like There are bank robbery and i want to takes all players within colshape and set data "Robber" for gang mates of man who opened first door: Robber and Assistant for other addEvent...event of door opening addEventHandler.. door opening too function(Door) if Door=="Door1" then destroyElement....... moveObject....... createMarker...... for i,g in ipairs (getElementsWithinColShape(getElementColShape(colShape),"player")) do local sGang = getElementData(source,"gang", gangName) local pGang = getElementData(g,"gang", gangName ) if sGang == pGang then setElementData(g,"Robbery", robber ) elseif sGang ~= pGang then setElementData(g,"Robbery", assistant) end end //////// When i have starting script all is good But i have opeing door then debug string sending me this : warning : scriptfolder BadArgument @ setElementData [ Expected argument at argument 3, got none ] warning : scriptfolder BadArgument @ getElementsWithinColShape [ expected colshape at argument 1, got boolean ] error ; bad argument #1 in ipairs [ table expected got boolean ] I can send full script only for advenced people Link to comment
Castillo Posted July 21, 2014 Share Posted July 21, 2014 The problem with setElementData is that "robber" and "assistant" variables aren't defined, I think the problem is that you wanted to put a string, so it would be like this: setElementData ( g,"Robbery", "robber" ) And the problem with getElementsWithinColShape is that the colshape doesn't exist for what it seems. Link to comment
PauloCascus Posted July 21, 2014 Author Share Posted July 21, 2014 The problem with setElementData is that "robber" and "assistant" variables aren't defined, I think the problem is that you wanted to put a string, so it would be like this: setElementData ( g,"Robbery", "robber" ) And the problem with getElementsWithinColShape is that the colshape doesn't exist for what it seems. sorry but what you means ? I've got this method from HouseRob and it's works there Link to comment
Castillo Posted July 22, 2014 Share Posted July 22, 2014 getElementColShape(colShape) What is that for? Link to comment
PauloCascus Posted July 22, 2014 Author Share Posted July 22, 2014 getElementColShape(colShape) What is that for? detection of colshape i'm need just getElemenetsWithinColShape(ColShape,"player" ) yeah ? Link to comment
Castillo Posted July 22, 2014 Share Posted July 22, 2014 Try with that, it should work if "ColShape" is indeed a colshape. Link to comment
Saml1er Posted July 22, 2014 Share Posted July 22, 2014 Colshape is not defined. Can you show us that part where you defined it? Link to comment
PauloCascus Posted July 25, 2014 Author Share Posted July 25, 2014 Try with that, it should work if "ColShape" is indeed a colshape. Colshape is not defined. Can you show us that part where you defined it? then no problems, i have fixed it ty for something 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