Jump to content

DjSt3rios

Members
  • Posts

    113
  • Joined

  • Last visited

Everything posted by DjSt3rios

  1. Here are the functions which i copied from racevoting_server.lua: function findMap( query ) local maps = findMaps( query ) -- Make status string local status = "Found " .. #maps .. " match" .. ( #maps==1 and "" or "es" ) for i=1,math.min(5,#maps) do status = status .. ( i==1 and ": " or ", " ) .. "'" .. getMapName( maps[i] ) .. "'" end if #maps > 5 then status = status .. " (" .. #maps - 5 .. " more)" end if #maps == 0 then return nil, status .. " for '" .. query .. "'" end if #maps == 1 then return maps[1], status end if #maps > 1 then return nil, status end end -- Find all maps which match the query string function findMaps( query ) local results = {} -- Loop through and find matching maps for i,resource in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource())) do local resName = getResourceName( resource ) local infoName = getMapName( resource ) -- Look for exact match first if query == resName or query == infoName then return {resource} end -- Find match for query within infoName if string.find( infoName:lower(), query:lower() ) then table.insert( results, resource ) end end return results end function getMapName( map ) return getResourceInfo( map, "name" ) or getResourceName( map ) or "unknown" end
  2. Hello, I Was on vacation so i decided to make something for IRC, !nextmap command which will set next map... i have this code: addIRCCommandHandler("!nextmap", function (server,channel,user,command,...) local query = #{...}>0 and table.concat({...},' ') or nil if not query then ircNotice(user, "Wrong Usage. Correct Usage: !nextmap ") return end local map = findMap( query ) if not map then ircNotice(user, "No map found.") return end outputChatBox('Next map set to ' .. getMapName( map ) .. ' by IRC Administrator ' .. user, getRootElement(), 0, 240, 0) executeCommandHandler("nextmap", user, map) outputIRC("Next map set to " .. getMapName(map) .. " by " .. user) end) So, The problem actually is that its not in Race resource, its in different.. so my error is this: ERROR: mapmanager/mapmanager_exports.lua:158: getMapsCompatibleWithGamemode: Invalid gamemode resource. Well, The map is fine, because we have played this map more than 400 times in my server.. and i also tried a lot of maps. Any help would be appriciated! Thanks!
  3. I got skype: Skype: djst3rios Well, With acceleration also can work out, but i think your idea is much better, because as car is reaching top speed the its not accelerating that fast, so it will not work properly, and you need more calculations etc. But the problem is that I suck at maths, but if you could help me it would be really useful. Thanks for the idea also.
  4. Hmmm I got some problems... well, I made a debug system, it shows a message every time the acceleration changes. But here is the problem, the car when its close to top speed, the acceleration goes to minus, so, as i tested now with a speedometer, changed to rpm meter, it shows the rpm increases, and while im full accelerating, suddenly it shows that the car goes slower... so probably I need to do it somehow else, i just need some ideas...
  5. Hmm, It seems that the timer has problem... Edit: I found the problem, getSpeed wasnt working properly, so i did it like new vehic = getPedOccupiedVehicle(getLocalPlayer()) and then getSpeed(vehic) and works now.. also i made it like math.floor(axeleration) so now its not as float, althought i dont know if its better like that... anyway, i will work soon on it, and i will give you results.. if anyone has any idea about it, i would like to hear it!
  6. hmm, i used this: outputChatBox("Acceleration: " .. axeleration) with a command.. but acceleration is always 0... it doesnt change....
  7. Alright thanks, I will give it a try!
  8. Hello, I was thinking of making a tachometer which would show RPM of the car.. probably with slider.. but im not pretty sure how I could make it. I wanted to ask if I could make a code to read when the car is accelerating, or decelerating, or make it read the gears and the speed... maybe you could give me ideas/help me with it? thanks
  9. hmm ok well it worked.. one other animation(not walking) works fine... so walking has problem probably.. maybe any other idea?
  10. I noticed that rotation is not working.. maybe bugged function?
  11. its looping already... This is my code: npc = createPed(211, 235.90469360352, -3672.8076171875, 159.97123718262, 180) setPedAnimation( npc, "ped", "swat_run",1500, true, true)
  12. I tried it, but no luck.. actually the npc is kinda moving, but it looks like its not doing the animation... it kinda begins, then it stops etc, but npc is moving a bit, but very slowly.. anyway i will try again
  13. Hello guys, i have a problem.. i created an NPC(Client side), and i made it move with animations, but its not working properly, it looks like the npc is "lagging" and i cant make it work as i want.. is there any way i could fix this? or record the npc? (on foot) Thanks!
  14. Hello, i was wondering if i could create a pickup with scripting.. i want make a Vehicle Change Pickup scripting. And Why i want it like that is because i want the player to make a top time... if i just give him hunter, he will not make a top time(my serveris DD/DM). Maybe i could this some how? As teleports are bugged for me Thanks
  15. Probably its a bug, i dont have any other explanation.. the weird thing is that i have a server, and a guy gave me a map, and he had a teleport script, and i checked it, and it was working fine, and it was the same with mine.. (well just some like different names etc.).. i just dont get it.
  16. Yes i noticed, I fixed that, but still i have no luck.. still cars remains there. ( I did it with triggerServerEvent )
  17. Sounds good idea. Well its client side so no errors. Although i tried to make an event handler in Server Side, but it was the same without errors/warnings. I will post again when i try to warp the player again in the car..
  18. Hello guys, i have a problem, which i really can't understand. I made a map, and i added a drift meter, so i want when you reach 20000 points or something like that, teleport you to a position.(with your car of course as its race gamemode). so i have this: if(total >= 1) then local vehicle=getPlayerOccupiedVehicle(player) setVehicleFrozen(vehicle,true) setElementPosition (vehicle, -441.2646484375, -2218.306640625, 84.912033081055) setTimer(setVehicleFrozen,50,1,vehicle,false) end i just put 1 for now to test, well, it teleports my car there, but my car stays there on the air, it does not fall down... i can accelerate, and wheels are moving, but the car stays there on the air, like there is no gravity. Also i noticed if i make something like: setElementVelocity(vehicle, 0, 0, -1) i hear a weird sound from the engine, and some blur, and the minimap is beging smaller, so its like the car is falling down, but i see my car stopped.. weird thing, maybe anyone has any idea?
  19. Hello Guys, I was wondering if someone could help me, as i suck at maths I want to make a drift meter for my map, but i am really bad in maths, so i need some help with getting the direction... Im not pretty sure how to make it, I thought of getting the rotation, and if the rotation suddenly changes it, then find the difference, or something like that.. As i know there is no function to get the vehicle direction, thats why it makes it harder. If someone could help me I would appriciate it. Thank you
  20. Well with this it increases the height of the bullet EDIT: I did some modifications and works, thanks anyway
  21. It works, Thank you! Edit: I got a small problem if you can help with, I want to create the bullet in front of the car and go straight. I made something, but if i turn like 90 degrees it is not working properly. I made it like this: createProjectile(getLocalPlayer(), 19, x, y-2.3, z+0.5, 5000, nil, 0, 0, 360 - rotz, vx, vy, vz) But sometimes x might need to be changed. Maybe i can fix it somehow?
×
×
  • Create New...