Jump to content

Snoozy

Members
  • Posts

    79
  • Joined

  • Last visited

Everything posted by Snoozy

  1. I'm wondering if I have a serverside table called for example Info[number] And I transfered it with getElementData and setElementData over to clientside and changed some of the info inside the table would it then only change on the clientside table or would it be changed also on the serverside table?
  2. Yea it can be used both serverside and clientside
  3. Use: setElementData(thePlayer,"Money",value) - for example getElementData(thePlayer,"Money")
  4. Certainly seems so cause it worked once I placed all of it serverside
  5. @Solidsnake14: The creation of the marker and blip is serverside so that wouldn't work. @Callum: They are both in the same resource just that creation is serverside
  6. So for some reason destroyElement() wont destroy the thing I asks it to. function MarkerHit ( hitPlayer, matchingDimension ) if source == getElementData(hitPlayer,"Marker") then outputChatBox("Hit the marker",hitPlayer) local Marker = getElementData(getLocalPlayer(),"Marker") destroyElement(Marker) local Blip = getElementData(getLocalPlayer(),"Blip") destroyElement (Blip) end end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) Not either the Marker or the Blip gets destroyed. The data is set here: local Blip = createBlip(X,Y,Z,31,0, 0, 0, 255,source) local Marker = createMarker(X,Y,Z,"checkpoint",1.0,0,255,0,170,source) setElementData(source,"Marker",Marker) setElementData(source,"Blip",Blip) They do appear ingame the created marker and blip
  7. Oh well I just found the problem when I was trying to explain when it happen Looking at the code I was about to put into this post I noticed the problem, it was that I created the infoRoot element twice, and it was after the MaxBusiness was defined so it got erased again lol
  8. Where? Just tried 2 different places but it didn't work?
  9. Hey I've come across a problem with 'for' limit must be a number and have been unable to find a fix, anyhow heres the code and so on where it comes from infoRoot = getElementByID("infoRoot") maxbi = getElementData(infoRoot,"MaxBusiness") for idx=1,maxbi do -- 'for' limit must be a number appears here triggerServerEvent ( "GetBizName", getLocalPlayer(),idx) end It have worked before which is why it just seems strange local infoRoot = createElement("infoRoot", "infoRoot") setElementData(infoRoot, "MaxBusiness",maxbi) This is where the data is set
  10. Yea okay that works tho it seems that it also blocks the setRadioChannel which is needed to be used at start to set their channel to 0 else it will be 1
  11. Is it possible to make players unable to change to any radio channel in their vehicles?
  12. Well I've been trying but it doesn't seem to work the way I've been doing, the way I do is When a player joins it does: vehicle=getElementsByType("vehicle") for k1,v in ipairs(vehicle) do local Name = getElementData(source,"CharacterName") setElementData(v,tostring(Name),0) end Got no problems here at all, used tostring to make sure that it turns out to be a string. Then in another lua file I do following, this is where the problem appears vehicle=getElementsByType("vehicle") players=getElementsByType("player") for k,v in ipairs(players) do for k1,v1 in ipairs(vehicle) do local Name = getElementData(v,"CharacterName") if getElementData(v1,tostring(Name)) == 0 then outputChatBox("Test3",v) setElementData(v1,tostring(Name),1) end end end But here it says that theres a bad argument at the getElementData, which I don't get since it works with the variable at start but in the getElement I get a error/warning
  13. Is it possible to setElementData(vehicle,A variable,0) ? And then to get it again later. getElementData(vehicle, A variable)? What I'm trying to do is to set a variable for vehicle with a player name as the 2nd argument and therefore I need to use variables?
  14. Well is there a way to maybe set it so the screen for the player starts going from side to side?
  15. I'm wondering what would be the best way to make like a "blurry drunk-a-like effect"?
  16. Is there a way to set like a timer clientside and then in the function that the timer directs to make it loop through all players?
  17. Well I'm not really the one doing that then, cause as told it's stuff gotten from mysql that outputs strings even tho in mysql they are integers so yea idk
  18. getElementData(getLocalPlayer(),"CharacterCigarette") Elements like that is currently when I try and use them with a if statement acting as a string even when the loading is clearly integers. I'm setting their values with values from mysql and the mysql columns is integers but when I'm ingame I get errors where it states that they are all of them strings? So I have to set tonumber() on like every single one.
  19. Yea I know that but that wasn't the problem.
  20. Yea okay I figured it out now thanks for the help bro.
  21. Okay now after some testing again and changing I came to a new error which is: [2011-05-27 10:45:58] WARNING: boulevard\business\server.lua:72: Bad argument @ 'getDistanceBetweenPoints3D' [2011-05-27 10:45:58] ERROR: boulevard\business\server.lua:72: attempt to compare boolean with number local b = tonumber(getElementData(source,"BizEntered")) local int = tonumber(BizInfo[b].Interior) local x,y,z = getElementPosition(source) local pX = getElementData(IntInfo[int].Pickup,"PosX") local pY = getElementData(IntInfo[int].Pickup,"PosY") local pZ = getElementData(IntInfo[int].Pickup,"PosZ") if getDistanceBetweenPoints3D(x,y,z,pX,pY,pZ) <= 3 then That is the code used for line 72 which is the last shown the getDistanceBetween
  22. Yea I realized that it was tonumber that was required tho now I've come across a similar problem on like a few lines later. The whole thing I'm currently having trouble with in case you don't know yet is a enter and exit system, the enter system works now and you can enter. However now theres a problem in exiting. local int = BizInfo[getElementData(source,"BizEntered")].interior if getDistanceBetweenPoints3D(x,y,z,IntInfo[int].X,IntInfo[int].Y,IntInfo[int].Z) <= 3 then I've tried there with tonumber, tostring and toboolean but it wont work I just always get the: [2011-05-27 08:53:29] ERROR: boulevard\business\server.lua:67: attempt to index field '?' (a nil value)
×
×
  • Create New...