Jump to content

par4doxon

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by par4doxon

  1. The server writes out this, when somebody joins the server: [22:10:05] DIAGNOSTIC: player #1000 Invalid file (mods) copcarla.dff Why does the console show this? Or I can ignore this?
  2. I want to close / open a door object with interpolateBetween. Here is the code: local adminGateArea51Right = createObject(2929,215.89999389648,1875.4000244141,13.89999961853, 0, 0, 0) function closeGates() startTime = getTickCount() endTime = startTime + 2000 closeGatesInter() end function closeGatesInter() local now = getTickCount() local elapsedTime = now - startTime local duration = endTime - startTime local progress = elapsedTime / duration while progress <= 1 do now = getTickCount() elapsedTime = now - startTime duration = endTime - startTime progress = elapsedTime / duration local x, y, z = interpolateBetween(208.5, 1875.4000244141, 13.89999961853, 211.89999389648, 1875.4000244141, 13.89999961853, progress, "OutBounce") setElementPosition(adminGateArea51Left, x, y, z) end end addCommandHandler("close", closeGates) This code should close the left door, but the only think it does, is making heavy lags, and the door is lagging as well, prolly because of the while loop. I admit, using a while loop isnt the best idea, but I didnt have better idea. Can somebody help me correct this? Because I know, in client-side I can use onClientRender, but I dont know what to use in server-side, for this problem. Thanks in advance.
  3. I made it. The problem was the 4th arg. So the working code is: setElementData(localPlayer, "job.lastMarker", nil, true) setElementData(localPlayer, "job.thMarker", nil, true)
  4. Hey guys, my problem is, that I want to remove an element data in client side, and I don't know how to do that. I know, that removeElementData is a server-side function, but I need an alternate option in client-side. I tried this, but it didn't work: setElementData(localPlayer, "job.lastMarker", nil) setElementData(localPlayer, "job.thMarker", nil) Any ideas to do this without calling the server?
  5. 1st of all, everything is in the server side. I have a problem with my addEventHandler in my function: vehicle = {} function createVeh(modelName, x, y, z) player = getPlayerName(source) vehicle[player] = createVehicle(modelName, x, y, z) addEventHandler("onVehicleEnter", vehicle[player], function() triggerClientEvent(source, "enterVehicle", source) end) end Some reasons this doesn't work. The triggerClientEvent works, if I put it in alone, without the addEventHandler. I think that the addEventHandler doesn't like my vehicle variable as element, and the element is getting created by the createVehicle properly, so I don't have any idea what is the problem here. Or if my solution of this problem is stupid, can you tell me a better solution? The problem I want to solve is, when the player hits the specified marker, the server creates a vehicle for him, and stores the element in the vehicle[player] (where player variable is the name of the player, because the source is a changing thing, if you relog), and after that I want to use the vehicle[player] (contains a vehicle element) to create / delete addEventHandlers, like in my code. Thanks in advance!
  6. Yes, I'm using that module. First line: local mysql = exports.mysql I changed back to this: local lastLogin = tostring(mysql:result(lastLoginData, 1, 1)) And this doesn't give me error. And now it's working! This was the problem: if (lastLogin == mysql:null()) then And I changed to this: (from your code) if (lastLogin == tostring(mysql_null())) then Thanks!
  7. It says: [2013-07-06 20:42:56] ERROR: accounts\s_characters.lua:98: attempt to index global 'lastLoginData' (a number value) The 98th line is: local lastLogin = lastLoginData:result(1, 1)
  8. I want to get that the query's result in the lastlogin is NULL or not. Here is the code: -- Query lastLoginData = mysql:query("SELECT `lastlogin` FROM `accounts` WHERE `id`='" .. tostring(accountID) .. "'") -- gets the lastlogin value (its [i]NULL[/i] in the table, and the type is [i]datetime[/i]) local lastLogin = tostring(mysql:result(lastLoginData, 1, 1)) -- writes out the lastLogin, but.. weird result: [2013-07-06 15:44:45] [Output] : userdata: 0086707C outputChatBox(lastLogin, getRootElement(), 255, 0, 0) -- after this, I want to compare this lastlogin with something, to get that this is [i]NULL[/i] or not. -- like this: if (lastLogin == mysql:null()) then -- but this isnt working -- todo end Thanks in advance!
×
×
  • Create New...