-
Posts
1,090 -
Joined
-
Last visited
Everything posted by Xwad
-
its working but there are sopme bugs. I changed the 51 id to 30 (ak47) and shooted the id 165 skin player with the gun. It was working but if i shoted the legs or the head then the player was healed not demaged pls help:/ Maybe need i define bodyparts? its only damaging on the torso.
-
hi i have a script that makes possible when i shoot with a gun then the players will see my blip on the map but its not working:/ function applyBlips() for k, player in pairs( getElementsByType( "player" ) ) do local r, g, b = getPlayerNametagColor( player ) if isPedDead( player ) then return end if not blip[player] then blip[player] = createBlipAttachedTo( player, 0, 2, r, g, b, 255, 0, blipViewDistance ) else setBlipColor( blip[player], r, g, b, 255 ) end end end addEventHandler( "onWeaponFire", resourceRoot, applyBlips ) setTimer( applyBlips, 500, 0 ) -- This is to account for name tag colour changes, especially in RPG servers. function createBlips() if ( source ) then player = source end local r, g, b = getPlayerNametagColor( player ) if not blip[player] then blip[player] = createBlipAttachedTo( player, 0, 2, r, g, b, 255, 0, blipViewDistance ) else setBlipColor( blip[player], r, g, b, 255 ) end end addEventHandler( "onWeaponFire", root, createBlips )
-
is it now good? local newHealth = getElementHealth(source) + loss - 5 function setHP(attacker, weapon, loss) if getElementType(attacker) == "player" if (weapon == 51 and getElementModel(source) == 165) then if newHealth > 0 then setElementHealth(source,newHealth ) else setElementHealth(source,0) end end end addEventHandler("onClientPlayerDamage", localPlayer, setHP )
-
KariiiM i testet it but it still not works. IIYAMA you mean add to that script? addEventHandler("onClientPlayerDamage", root, function (attacker, weapon, loss) if ( isElement ( attacker ) and weapon and attacker== localPlayer and getElementModel(source) == 165) then if (weapon == 51 and getElementModel(source) == 165) then cancelEvent() setElementHealth(source,getElementHealth(source) - 5) end end end)
-
its not working:/ But i dont want to cancel the event i just want to set that the explosion will make 5 hp demage on skin id 165
-
Hi i hahave made a script that changes the explosion demage on the skin 165 but its not working:/ pls help. function noob(attacker, weapon, loss, x, y, z, tyre) if (weapon == 51 and getElementModel(source) == 165) then setElementHealth(source,getElementHealth(source) - 5) cancelEvent() end end addEventHandler("onClientPlayerDamage", root, noob)
-
i made it but its not working.. I want to mute the tank shooting sound and add a new shooting sound --tank shooting sounds local sound function shootingSound() if (getElementModel(source) == 601) then setWorldSoundEnabled ( 5, true ) sound = playSound("sounds/sound3.mp3") setSoundVolume(sound, 1) else cancelEvent() end end function bindTheKeys () bindKey ( "mouse1", "down", shootingSound ) end
-
yeah its working with the example but for hand weapons and i want to mute the rhinos shooting sound.. I thing the number 5 is for the hand weapons. Is there a list for that numbers?
-
To disable the original tank shooting sounds need i use SetWorldSoundEnabled function? Thanks.
-
? Sorry i dont understand you.. I only uderstand your last setence. I cant use monstertruck for tank becaouse its ni a towered vehicle
-
Hi. Is it possible to add new vehicles (not replace) to mta with this or any other way? http://gtasa.gamebanana.com/tuts/11199 Just becaouse im making a world of tank server and i need more rhino tanks to add more skins..
-
For setting the planes speed need i use setAircragtMaxVelocity?
-
ohh ok thanks.And one more question. How can i make that if i shoot with the rhino something (fir example an object) then the bullet will not blow? (i want to disable the rhinos bullet explosion if its hit something)
-
Hi i want to make a script that makes possible that the vehicle will only blow if it has 0 % hp. Becaouse the vehicles blows if the hp is under 250%. What functions need i use for that?
-
MY god i made the same script but when i made it then i didnt work now it works thanks!!
-
The problem is now that the script gives me the 513 vehicle immediately:/ I want to set the timer to the creatvehicle too not only for the destroyelemnt:/
-
i fixed the Destroyelemnt problem but now i have anbother problem.. After the vehicle is destroyed it must create and warp me i a vehicle but its not working:/ function vehicleExplode () if (getElementModel(source) == 476) then setTimer( destroyElement, 4000, 1, source) local x,y,z = getElementPosition(source) local vehicle = createVehicle(513,-2117.46, -2340.69, 100 + 3) warpPedIntoVehicle(source,vehicle) end end addEventHandler ( "onVehicleEnter", getRootElement(), vehicleExplode )
-
sry i dont understand that. What do you mean with create it by yourself? Maybe need i use destroyElement?
-
Hi i made a script but its not working:/ The script is that if i enter the rustler(476) then the script will destroy the element(the rustler) in 5 sec and create a vehicle and warp me in that vehicle. debugscript: ERROR: shop/server.lua:54: attempt to call global 'destroyVehiclesOfModel' (a nil value) server.lua function timerKill (modelID) local USAteam = getTeamFromName("USA") if(getPlayerTeam ( localPlayer ) == USAteam) then local vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do if (getElementModel(v) == modelID) then destroyElement(v) local x,y,z = getElementPosition(source) local vehicle = createVehicle(601,-2117.46, -2340.69, 100 + 3) warpPedIntoVehicle(source,vehicle) end end end end destroyVehiclesOfModel(476) setTimer ( timerKill, 5000, 1 )
