Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. done function onEnter(vehicle) if isPedInVehicle(source) and vehicle == van then outputChatBox("Take the van to the desired location to become a criminal! (Blip)", source, 255, 0, 0) local blip = createBlip(1997.4537353516, -1829.6383056641, 13.546875, 0) setElementVisibleTo(blip, source, true) DestinationMarker = createMarker(1997.4537353516, -1829.6383056641, 13.546875,"cylinder", 1, 255, 0, 0, 255) setElementVisibleTo(DestinationMarker, source, true) else return false end end addEventHandler("onPlayerVehicleEnter", root, onEnter) local DestinationMarker it's a local variable so you must remove 'local' or add the event "onMarkerHit" iside onEnter function. Note : many things wrong in your code.
  2. Walid

    Debug Problem

    I think you must read the code again and again because as i can see he is trying to get the player name (line9 ; line10) more than that he is trying to check the player state "getElementData(driver,"state") " so he need to use : Driver = getVehicleOccupant ( source ) or Driver = getVehicleController ( source )
  3. Leacked resource stop posting things like that.
  4. Walid

    Debug Problem

    Simply because you are trying to check loss model ??? loss: A float representing the amount of health the vehicle lost. so what 3B00DG4MER said is wrong try this function cheetah() for i ,v in ipairs (getElementsByType("player")) do local veh = getPedOccupiedVehicle(v) if veh then if veh == source then local id = getElementModel ( source ) if tonumber(id) == 415 then if getElementData(v,"state") == "alive" then local handling = getVehicleHandling(source) if handling["mass"] ~= 1200 or handling["turnMass"] ~= 3000 then outputChatBox(getPlayerName(v).."#FA6400's mass: #FFBF961200 #FA6400/ #780000"..handling["mass"], root, 255,100,0,true) outputChatBox(getPlayerName(v).."#FA6400's turn mass: #FFBF963000 #FA6400/ #780000"..handling["turnMass"], root, 255,100,0,true) end end end end end end end addEventHandler("onVehicleDamage", getRootElement(), cheetah) Note: instead of using getPedOccupiedVehicle() use getVehicleOccupant (). Example: function cheetah() local driver = getVehicleOccupant ( source ) if driver then local id = getElementModel ( source ) if tonumber(id) == 415 then if getElementData(driver,"state") == "alive" then local handling = getVehicleHandling(source) if handling["mass"] ~= 1200 or handling["turnMass"] ~= 3000 then outputChatBox(getPlayerName(driver).."#FA6400's mass: #FFBF961200 #FA6400/ #780000"..handling["mass"], root, 255,100,0,true) outputChatBox(getPlayerName(driver).."#FA6400's turn mass: #FFBF963000 #FA6400/ #780000"..handling["turnMass"], root, 255,100,0,true) end end end end end addEventHandler("onVehicleDamage", getRootElement(), cheetah)
  5. use /debugscript 3
  6. give me the server ip
  7. try to use setPedLookAt() or setCameraMatrix() -- this it can help you really i don't undrestand your problem.
  8. Yes you can. engineRemoveShaderFromWorldTexture () Your code addEventHandler("onClientRender", root, function() local zone = getZoneName (getElementPosition(getLocalPlayer())) if zone == "Santa Maria Beach" then dxSetShaderValue(textBeachsandShad,"gTexture",beachSand) engineApplyShaderToWorldTexture(textBeachsandShad,"grass_128hv") else engineRemoveShaderFromWorldTexture(textBeachsandShad,"grass_128hv") end end)
  9. Replacig M4 and AK47 with other models (dff files) -- TXD engineLoadTXD() engineImportTXD() -- DFF engineLoadDFF() engineReplaceModel()
  10. Simply with models it can be like this: local notAllowedVehicle = {[416] = true} -- Ambulance local markers = {} function attchMarkerToAllVehicle () for i, vehicle in pairs(getElementsByType("vehicle")) do local model = getElementModel(vehicle) if notAllowedVehicle[model] then return end if not markers[vehicle] then local marker = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( marker, vehicle, 0, 0, 0 ) markers[vehicle] = marker end end end setTimer(attchMarkerToAllVehicle,1000,0)
  11. You must add setElementData when you kill a zombie example: * Code function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie Kills") or 0 setAccountData(account,"Zombie Kills",tonumber(zombieKills)+1) setElementData(killer, "Zombie Kills", tonumber(zombieKills)+1) end * Scoreboard scoreboardAddColumn("Zombie Kills", root, 55, "Kills")
  12. Try this : local markers = {} function attchMarkerToAllVehicle () for i, vehicle in pairs(getElementsByType("vehicle")) do if not markers[vehicle] then local marker = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( marker, vehicle, 0, 0, 0 ) markers[vehicle] = marker end end end setTimer(attchMarkerToAllVehicle,1000,0) function destroyMarker() if getElementType(source) == "vehicle" then if markers[source] then destroyElement (markers[source]) end end end addEventHandler("onElementDestroy", getRootElement(),destroyMarker)
  13. it's markers = {} not marker = {} you are welcome
  14. try this local markers = {} local marker = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) function attchMarkerToAllVehicle () for i, vehicle in pairs(getElementsByType("vehicle")) do if not markers[vehicle] then attachElements ( marker, vehicle, 0, 0, 0 ) markers[vehicle] = true end end end setTimer(attchMarkerToAllVehicle,1000,0)
  15. just change getElemetModel to getElementModel() 'n' missing
  16. You code is wrong try this notAllowedVehicle = { [416] = true -- Ambulance } function attachMarker(player) if not isElement(player) then return end local theVehicle = getPedOccupiedVehicle ( player ) if theVehicle then local model = getElemetModel(theVehicle) if (notAllowedVehicle[model]) then outputChatBox("you can't attach a marker to this type of vehicles",player,255,0,0) return end markers = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( markers, theVehicle, 0, 0, 5 ) end end addCommandHandler("attach",attachMarker) Type /attach in chatbox then press enter.
  17. Example notAllowedVehicle = { [416] = true -- Ambulance } -- you must check the car model local model = getElemetModel(theVehicle) if (not allowedPlanes[model]) then -- Your code end
  18. your code is wrong many things are missing can you explane to us what are you trying to do.
  19. Walid

    Help

    I already gave you the resource link .
  20. Walid

    Help

    Check this one here
  21. what do you mean by player source , can you explane to us what you want exactly.
  22. I was a bit angry because i have some problems, but you didn't want to understand. Bro how we suppose to know what is creating problem, you need to show us your full code because it's the only one solution.
  23. it's very easy but i don't know why you still asking for help as i told in the last code you prevent players in Alpha Team from entering this vehicle , so to change it you must change your code like this : == : Equal ~= : Different function cars () c1 = createVehicle ( 520, 227.69921875, 1882.142578125, 17.640625, 0, 0, 90 ) addEventHandler("onVehicleStartEnter", root, onEnter) end addEventHandler ( "onResourceStart", resourceRoot, cars ) function onEnter(thePlayer) if ( getElementData(thePlayer, "gang") ~= "Alpha Team" ) then outputChatBox("Sorry you can't enter this vehicle", thePlayer, 0, 255, 0) cancelEvent() end end Now Only Players in Alpha Team group can enter the c1 vehicle.
×
×
  • Create New...