Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. it seems the variable vehicle is not defined. How do you get this vehicle in the first place? (the vehicle that you want to change)
  2. URL isn't a sound element. I am not sure if streamed data contains that kind of information. But you can always try. table = getSoundMetaTags ( element sound ) local sound =playSound ("URL") local table = getSoundMetaTags (sound )
  3. local repairTime = (1000 - health)* 120 if repairTime >= 50 then -- timers can't start with time lower then 50 ms repairTimer[veh] = setTimer(fixVehicleDayZ, repairTime, 1, veh, source) setPedAnimation(source, "SCRATCHING", "sclng_r", repairTime, true, false)-- doing an animation for the required time else fixVehicleDayZ(veh, source) end addEvent("repairVehicle", true) addEventHandler("repairVehicle", getRootElement(), repairVehicle) function fixVehicleDayZ(veh, player) if isElement(veh) and isElement(player) then -- important to prevent errors. (players can leave during the game and vehicles can be destroyed during the game. Which will cause errors when you put delays(timers) between functions. removeElementData(veh,"repairer") -- better then set to nil removeElementData(player,"repairingvehicle") For the second part: The variables: siting and lying are globals which means that all players that execute this script are using them, which will cause problems since they share them. The function: function setVisibility() value = 0 end Has never been called and should not be there in the first place.
  4. Hmmmzzz. really hard question, I never tried to disable the chatbox. Can't you cancel the messages at the moment the input is disabled?
  5. and why not? Show your code.
  6. IIYAMA

    Countdown

    Wiki isn't always clear, (programmers language) Client = Your pc. ( client scripts will be send to your pc and your pc will execute them) Server = Will only be executed on the server(hoster) and won't be downloaded by: you, myonlake and me. And yes, follow the links of myonlake. If you don't understand it, you can always discus that here.
  7. setTimer( guiProgressBarSetProgress, 5000, 1,GUIEditor.progressbar,lol+10 ) setTimer( guiProgressBarSetProgress, 10000, 1,GUIEditor.progressbar,lol+20 ) setTimer( guiProgressBarSetProgress, 15000, 1,GUIEditor.progressbar,lol+30 ) setTimer( guiProgressBarSetProgress, 20000, 1,GUIEditor.progressbar,lol+40 ) setTimer( guiProgressBarSetProgress, 25000, 1,GUIEditor.progressbar,lol+50 ) setTimer( guiProgressBarSetProgress, 30000, 1,GUIEditor.progressbar,lol+60 ) setTimer( guiProgressBarSetProgress, 35000, 1,GUIEditor.progressbar,lol+70 ) setTimer( guiProgressBarSetProgress, 40000, 1,GUIEditor.progressbar,lol+80 ) setTimer( guiProgressBarSetProgress, 45000, 1,GUIEditor.progressbar,lol+90 ) setTimer( guiProgressBarSetProgress, 50000, 1,GUIEditor.progressbar,lol+100 ) How many timers are you going to set? Jesus! You have no idea how many lagg that will cause, when you write every script like that. Or do you ? setTimer(function() lol = lol+10 guiProgressBarSetProgress(GUIEditor.progressbar,lol) end,5000, 10)
  8. You can stop an animation with: setPedAnimation (source,false) But as far as I know, when you set another animation it will overwrite the other one. Is that what you mean? Because your question is very unclear, to everybody.
  9. local allowedDoors = {[0]=true,[1]=true,[2]=true,[3]=true,[4]=true,[5]=true} local openDoor = function (door, position) outputChatBox(tostring(door) .. " " .. tostring(position)) -- debugging........ door,position = tonumber(door), tonumber(position) if isElement(source) and door and position and allowedDoors[door] then if position>=0 and position<=100 then setVehicleDoorOpenRatio(source, door, position/100, 1000) end elseif isElement(client) then outputChatBox("something went wrong",client) end end addEvent("openDoorOrClose", true) addEventHandler("openDoorOrClose", root, openDoor) How did you call it? If this doesn't output anything, then you are calling it wrong, if it does then you know what you are doing wrong with delivering the data. It should look like this: triggerServerEvent ("openDoorOrClose",vehicle,door, position) Also see line 4, that is the best way how you can debug your script. Use the tostring() function to prevent errors during the debugging. Know what kind of data is flowing through your system with: type() function. variable = true outputChatBox(tostring(variable)) -- true outputChatBox(type(variable))-- boolean (true or false) and pls no sad looking smilies, you can't expect code starts working at ones.
  10. IIYAMA

    Moving Gate

    addCommandHandler("teleport", function (player) setElementPosition(player,0,0,10) end)
  11. IIYAMA

    Moving Gate

    Almost local gateMoveTable = { { ["element"] = createObject(986,586,-1906.0999755859,3,0,0,355.74279785156), ["open"] = {500,579.20001220703,-1905.5999755859,3}, ["close"] = {500,586,-1906.0999755859,3}--, last item doesn't need a , }, -- you are missing a , { ["element"] = createObject(985,593.90002441406,-1906.6999511719,3,0,0,355.74279785156), ["open"] = {500,600.59997558594,-1907.1999511719,3}, ["close"] = {500,593.90002441406,-1906.6999511719,3}--, last item doesn't need a , } }
  12. IIYAMA

    Moving Gate

    Why don't you give it a try, then I will say if it is correct or incorrect. (if I do it for you, you won't learn anything from it)
  13. You want to change everything to free when the price is bugged?
  14. IIYAMA

    Moving Gate

    local gateMoveTable = { { ["element"] = createObject(986,586,-1906.099609375,3,0,0,355.74279785156), ["open"] = {500,579.29998779297,-1905.5999755859,3}, ["close"] = {500,586,-1906.099609375,3} }--, --[[{ -- gate 2 ["element"] = createObject(), ["open"] = {}, ["close"] = {} },]] --[[{ -- gate 3 ["element"] = createObject(), ["open"] = {}, ["close"] = {} }]] } local manageGate = function (player,command) for i=1,#gateMoveTable do local gateTable = gateMoveTable[i] moveObject(gateTable["element"],unpack(gateTable[command])) end end addCommandHandler("open", manageGate) addCommandHandler("close", manageGate) and you can move much more gates at the same time with this. By simply using a loop through the tables.
  15. IIYAMA

    Dead Peds

    Just put them per vehicle in a table. --[[ vehicleTable = {[vehicle]= {ped1,ped2,ped3,ped4} ]] local vehicleTable = {} addEventHandler ( "onVehicleExplode",root, function () local vehicleData = vehicleTable[source] if vehicleData and #vehicleData > 0 then for i=1,#vehicleData do local ped = vehicleData[i] if isElement(ped) then destroyElement(ped) end end vehicleTable[source] = nil end end)
  16. well if it output always correct, then it should work. The most secure way would be: local cost= tonumber(cost) local money = getPlayerMoney (source) if cost and money then if money >= cost then outputDebugString("works") else outputDebugString("not enough money") end else outputDebugString("cost or money do not exist.") end
  17. Cost could be nil. or something that isn't a int or float.
  18. Cost is nil. getPlayerMoney can only return nil when the player isn't a player or he has already left the game. But that will give a second error/warning.
  19. try this: local allowedDoors = {[0]=true,[1]=true,[2]=true,[3]=true,[4]=true,[5]=true} local openDoor = function (door, position) door,position = tonumber(door), tonumber(position) if isElement(source) and door and position and allowedDoors[door] then if position>=0 and position<=100 then setVehicleDoorOpenRatio(source, door, position/100, 1000) end elseif isElement(client) then outputChatBox("something went wrong",client) end end addEvent("openDoorOrClose", true) addEventHandler("openDoorOrClose", root, openDoor)
  20. objects can be done with: https://wiki.multitheftauto.com/wiki/ProcessLineOfSight
  21. np.
  22. local positionsofthespawn={ [1]={x,y,z,["weapons"]={5,24,25,28,30,33,44}}, --Spawn o_O } First of all, tables are working with an index. Since you didn't save it's spawn location, you don't know what weapons he must use. I normally give the weapons when I spawn him, not sure if that is a bad habit, except personally I have never had any problems with that. so: local spawnTable = positionsofthespawn[math.random(#positionsofthespawn)] spawnPlayer(player,spawnTable[1],spawnTable[2],spawnTable[3]) local weaponTable = spawnTable["weapons"] -- {5,24,25,28,30,33,44} for i=1,#weaponTable do giveWeapon(player,weaponTable[i]) end That is how it works.
  23. IIYAMA

    Dead Peds

    did you tried to remove them first from the vehicle before deleting them?
  24. IIYAMA

    Need Scripter

    I would at least ask 20 euro an hour and that is without designing the layout. That would mean that I have to finish a full gamemode in 2 hours and 30 minutes. (I don't want you to change your mind, I am only saying) Sure make it. I didn't said I have time for it, nor that I am working as paid scripter. The reason I posted is because I see large projects for extreme low prices. @ KRZO +1000
  25. IIYAMA

    Need Scripter

    I would at least ask 20 euro an hour and that is without designing the layout. That would mean that I have to finish a full gamemode in 2 hours and 30 minutes. (I don't want you to change your mind, I am only saying)
×
×
  • Create New...