Jump to content

IIYAMA

Moderators
  • Posts

    6,063
  • Joined

  • Last visited

  • Days Won

    209

Everything posted by IIYAMA

  1. IIYAMA

    Moving Gate

    addCommandHandler("teleport", function (player) setElementPosition(player,0,0,10) end)
  2. 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 , } }
  3. 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)
  4. You want to change everything to free when the price is bugged?
  5. 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.
  6. 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)
  7. 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
  8. Cost could be nil. or something that isn't a int or float.
  9. 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.
  10. 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)
  11. objects can be done with: https://wiki.multitheftauto.com/wiki/ProcessLineOfSight
  12. 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.
  13. IIYAMA

    Dead Peds

    did you tried to remove them first from the vehicle before deleting them?
  14. 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
  15. 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)
  16. IIYAMA

    Dead Peds

    You sure all peds are serverside? As far I know they are all always destroy able. I have build something similar to slotboth and I never had any problems with it. How do you save those peds? Because holding the registration at moment of creation is the best way to destroy them all without any problems. Also getElementHealth returns better information if a ped is dead then isPedDead. (depends if you are freezing your peds or disable their col)
  17. First of all: you made a typo: "OnPlayerSpawn" . "onPlayerSpawn"
  18. IIYAMA

    Help fix bugs

    Try something like this. local aim = guiCreateStaticImage(0.311, 0.454, 0.349, 0.626, "aim.png", true) guiSetVisible(aim, false) local convertButtonState={["down"]=true,["up"]=false} bindKey ("aim_weapon","both", function(key,state) guiSetVisible( aim, convertButtonState[state] ) end)
  19. Simply because it uses more memory. The easy way isn't always the best way. Even so, his version can get bugged, while yours can't. So the best result will be: onVehicleEnter + render check if he is in the vehicle else remove the handler. A combination would be the best.
  20. oh wait. I also played in DDC under the nick Alex-Rider. (not any more)
  21. I saw your nick inside a stealth server. (probably GCC or gta.ru) Are you German?
  22. np. P.s: didn't we ever met in game? (I remember somebody with that nick)
  23. function kill(p) if p and isElement(p) and getElementType(p) == "player" then source = p end -- here was your bug. unbindKey(source, "enter", "down", "suicide") if isPedDead(source) == false then killPed(source) if getElementType(source) ~= "player" then destroyElement(source)-- you can't destroy players end end local vehicle = playerVehicle[source] if isElement(vehicle) then setTimer(destroyPlayerVehicle, 5000, 1, vehicle) end end addEventHandler("onPlayerQuit", root, kill) addCommandHandler("suicide", kill) addEvent("onRequestKillPlayer", true) addEventHandler("onRequestKillPlayer", root, kill) function destroyPlayerVehicle(vehicle) if isElement(vehicle) then destroyElement(vehicle) end end -- the big bad bug -- (BBB) --[[onPlayerQuit Serverside event This event is triggered when a player disconnects from the server. Parameters string quitType, string reason, element responsibleElement]] <<<<<<<<<<<<<<
×
×
  • Create New...