Jump to content

Reinhard

Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by Reinhard

  1. just remove <anim name =" animation" /> line. if u want to remove a certain animation.
  2. function weapondamage() setWeaponProperty("minigun", "pro", "damage", 2) end try this... it's not a hard thing to do. anyways this topic should be moved to: https://forum.multitheftauto.com/forum/71-scripting/ please post at that link ^ next time, not here.
  3. if you're talking about a ped's animation. setPedAnimation ( theElement, false )
  4. function command() for i,v in ipairs(getElementsByType("ped")) do setPedAnimation( v, "", "") end end addCommandHandler("action", command) if u want all peds to do an anim u could do smth like this. *this is just an example*
  5. i tried some ways but failed. how to restrict this event handler to a certain team i don't want anyone who can use it so i guess that the "root" is causing it. i tried to change it but failed, and tried to use return end but failed. any help? i want only "Civillian" team can trigger this event. addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 6 then setElementHealth(source, getElementHealth(source) - 50 ) end end)
  6. it'll only trigger when player spawns.
  7. you need an event to trigger that function. EX: when player spawns it will check if player is in team Militar function tag(thePlayer) local team = getPlayerTeam( thePlayer ) conta = getAccountName(getPlayerAccount(source)) if ( getTeamName( team ) == "**Militar**" ) then aclGroupAddObject (aclGetGroup("Militar"), "user."..conta) end end addEventHandler("onPlayerSpawn", getRootElement(), tag)
  8. Reinhard

    why

    why am i getting destroyElement expected element at argument 1 warning???? it's pretty annoying. when i spawn as different teams over and over again... function scheck() if source and getElementType ( source ) == 'player' then local team = getPlayerTeam(source) local teamname = getTeamFromName("Survivors") if getTeamName(team) == "Survivors" then setTimer(function() blips[vehicles] = createBlipAttachedTo(vehicle, 51, nil,nil,nil,nil,nil,nil,nil,nil) end , 1000, 1) end if not blips[vehicles] then return end destroyElement(blips[vehicles]) end end addEventHandler("onPlayerSpawn", getRootElement(), scheck)
  9. Reinhard

    why

    found solution on this one.
  10. Reinhard

    why

    it works at the first time but the second time it doesnt... expected element at argument 10: got table, at line 3 e.e createBlipAttachedTo the problem is in the getPlayersInTeam it's arg 10. i tried this and it doesn't give the error anymore and it works.. but when there are many players in the server will it still work?? if getTeamName(team) == "Survivors" then blips[vehicles] = createBlipAttachedTo(vehicle, 51, nil,nil,nil,nil,nil,nil,nil,getPlayersInTeam("Survivors")) return end when i keep respawning over and over again with different teams it still shows the blip....
  11. Reinhard

    why

    When im alone in the server it works. but when there are many players it doesn't why does it still show the blip to the people not in the "Survivors" team? help please! function scheck() local team = getPlayerTeam(source) if getTeamName(team) == "Survivors" then blips[vehicles] = createBlipAttachedTo(vehicle, 51) return end destroyElement(blips[vehicles]) end addEventHandler("onPlayerSpawn", getRootElement(), scheck) function createVehicles ( ) loc = math.random ( #vehicles ) vehicle = createVehicle ( 609, vehicles[loc][1], vehicles[loc][2], vehicles[loc][3], 0, 0, 0) addEventHandler ( "onVehicleEnter", vehicle, start ) addEventHandler ( "onVehicleExit", vehicle, removedata2 ) addEventHandler ( "onVehicleExplode", vehicle, fail ) local theTeam = getTeamFromName("Survivors") if not theTeam then return end for k,v in ipairs(getPlayersInTeam(theTeam)) do blips[vehicles] = createBlipAttachedTo(vehicle, 51) outputChatBox("[Weapon Delivery] Weapon delivery truck available!", v, 100, 0, 0, true) end end
  12. Works now! thanks for the help y'all!
  13. no more debug errors but still doesn't work wtf? but the onVehicleExit and onVehicleEnter works.... function createVehicles ( ) loc = math.random ( #vehicles ) vehicle = createVehicle ( 429, vehicles[loc][1], vehicles[loc][2], vehicles[loc][3], 0, 0, 0) outputChatBox("test", root, 100, 0, 0, true) blips[vehicles] = createBlipAttachedTo(vehicle, 41) setBlipVisibleDistance(blips[vehicles], 150) addEventHandler ( "onVehicleEnter", vehicle, start ) addEventHandler ( "onVehicleExit", vehicle, removedata2 ) addEventHandler ( "onVehicleExplode", vehicle, fail ) end function fail (player) if player and getElementType ( player ) == 'player' then setElementData(player, "mission", false) setTimer(setVehicleLocked, 350, 1, vehicle, false) outputChatBox("test") end end
  14. here's the part of my code, for some reason, it says element at argument 2 got nil at the addEventHandler("onVehicleExplode", vehicle, fail)? why? function createVehicles ( ) loc = math.random ( #vehicles ) vehicle = createVehicle ( 429, vehicles[loc][1], vehicles[loc][2], vehicles[loc][3], 0, 0, 0) outputChatBox("test", root, 100, 0, 0, true) blips[vehicles] = createBlipAttachedTo(vehicle, 41) setBlipVisibleDistance(blips[vehicles], 150) addEventHandler ( "onVehicleEnter", vehicle, start ) addEventHandler ( "onVehicleExit", vehicle, removedata2 ) end function fail (player) if player and getElementType ( player ) == 'player' then setElementData(player, "mission", false) setTimer(setVehicleLocked, 350, 1, vehicle, false) outputChatBox("test") end end addEventHandler ( "onVehicleExplode", vehicle, fail )
  15. any help? or atleast trigger the function fail if vehicle has 1 or 0 health?
  16. but my script works with onVehicleEnter and onVehicleExit, it just doesn't work with onVehicleExplode...
  17. doesn't work and anyway.. i want it to work at that "vehicle" not all the vehicles in san andreas.... anyways i saw this ex in wiki. not all addEventHandlers are roots... function onThisResourceStart () -- Create the vagos vehicle. A van. vagosVehicle = createVehicle ( 522, 0, 0, 5 ) -- Add its explode handler. When this car explodes, onVagosVehicleExplode is called addEventHandler ( "onVehicleExplode", vagosVehicle, onVagosVehicleExplode ) end my script works with... onVehicleEnter and onVehicleExit but idk why it doesnt work with onVehicleExplode!
  18. i tried to use onVehicleExplode to check if vehicle is dead.. but it still doesn't trigger the function fail, how ??? vehicle = createVehicle ( 429, 1, 2, 3, 0, 0, 0) function fail (player) if player and getElementType ( player ) == 'player' then setElementData(player, "mission", false) setTimer(setVehicleLocked, 350, 1, vehicle, false) outputChatBox("test") addEventHandler ( "onVehicleExplode", vehicle, fail ) end end
×
×
  • Create New...