sel3a Posted October 25, 2014 Share Posted October 25, 2014 Hello Everyone, Well guys some of u knows me maybe, or idk anyway guys listen, can u please tell me how to put a god mod for a ped, i mean if i create a ped, people will kill him, but i don't want that! Can u please tell me how to do it ? I don't need that cancelevent() thing, i need a full function please or just some details, anyway i hope that u guys will help me, i really need it ,i was searching for more than 2 days but i didn't find it, Thanks everyone, have a good day. Link to comment
John Smith Posted October 25, 2014 Share Posted October 25, 2014 Oheres an example ped1 = createPed(190,0,0,2) addEventHandler("onClientPedDamage",root,function() if source == ped1 then cancelEvent() end end) I wrote this from my phone Link to comment
sel3a Posted October 25, 2014 Author Share Posted October 25, 2014 Thanks mate i really appreciate that it's working good but if there is a way that you can help me with to should i repeat the same things every time or i can make it easier the one that i am using it now is this--- sourcePlayer = createPed(171,2171.8740234375,1620.5299072266,999.97967529297) setElementInterior(sourcePlayer, 1) setElementDimension(sourcePlayer, 0) Whore = createPed(40,2172.2761230469,1624.2602539063,999.97326660156) setElementInterior(Whore, 1) setElementDimension(Whore, 0) sport = createPed(59,2171.7377929688,1618.6732177734,999.9765625) setElementInterior(sport, 1) setElementDimension(sport, 0) pool = createPed(120,2172.2861328125,1616.7800292969,999.9765625) setElementInterior(pool, 1) setElementDimension(pool, 0) GetOut = createPed(57,2143.2219238281,1611.6741943359,1006.1796875) setElementInterior(pool, 1) setElementDimension(GetOut, 0) hi = createPickup(2176.8752441406, 1619.5518798828, 1001.98132324219,3,1318) setElementInterior(GetOut, 1) setElementDimension(hi, 0) setPedAnimation (sourcePlayer,"ped","DUCK_cower",0,true,false,true,true) setPedAnimation (Whore,"ped","DUCK_cower",0,true,false,true,true) setPedAnimation (sport,"ped","DUCK_cower",0,true,false,true,true) setPedAnimation (pool,"ped","DUCK_cower",0,true,false,true,true) setPedAnimation (GetOut,"ped","phone_talk",0,true,false,true,true) addEventHandler("onClientPedDamage",root,function() if source == GetOut then cancelEvent() end end) addEventHandler("onClientPedDamage",root,function() if source == pool then cancelEvent() end end) addEventHandler("onClientPedDamage",root,function() if source == sport then cancelEvent() end end) addEventHandler("onClientPedDamage",root,function() if source == Whore then cancelEvent() end end) addEventHandler("onClientPedDamage",root,function() if source == sourcePlayer then cancelEvent() end end) how can i make it easier i mean i just have to change the place of the ped no need all of this spam pool = createPed(120,2172.2861328125,1616.7800292969,999.9765625) setElementInterior(pool, 1) setElementDimension(pool, 0) sport = createPed(59,2171.7377929688,1618.6732177734,999.9765625) setElementInterior(sport, 1) setElementDimension(sport, 0) setPedAnimation (pool,"ped","DUCK_cower",0,true,false,true,true) setPedAnimation (sport,"ped","DUCK_cower",0,true,false,true,true) addEventHandler("onClientPedDamage",root,function() if source == GetOut then cancelEvent() end end) i mean i have to change something in that --if source == GetOut then-- and it will work for the 2 peds i realy don't know how to explain it but i hope that you got it. Thanks Link to comment
rtx Posted October 25, 2014 Share Posted October 25, 2014 You could do this: -- create a table peds = { ped1 = createPed.., ped2 = createPed.. } -- set their animations here or in the loop below if they're to be set the same animation -- .. function handlePedDamage () cancelEvent () end for k, v in pairs ( peds ) do setElementInterior ( v, .. ) setElementDimension ( v, .. ) addEventHandler ( "onClientPedDamage", v, handlePedDamage, false ) end Link to comment
sel3a Posted October 25, 2014 Author Share Posted October 25, 2014 Thank you so much . Link to comment
Walid Posted October 25, 2014 Share Posted October 25, 2014 Try to use Table like this : Ped = { {X = 2171.8740234375, Y= 1620.5299072266,Z= 999.97967529297, SkinID = 171, Interior = 2 , Dimension = 5}, {X = 2172.2761230469,Y= 1624.2602539063,Z= 999.97326660156,SkinID = 40,Interior = 1, Dimension = 5}, {X = 2171.7377929688,Y= 1618.6732177734,Z= 999.9765625,SkinID = 59,Interior = 10, Dimension = 5}, {X = 2172.2861328125,Y= 1616.7800292969,Z= 999.9765625,SkinID = 120 ,Interior = 15 , Dimension = 5}, } for a,b in pairs(Ped) do local Ped = createPed(b["skinID"], tostring(b["X"]), tostring(b["Y"]), tostring(b["Z"])) etc ...... Link to comment
abu5lf Posted October 25, 2014 Share Posted October 25, 2014 for _, v in ipairs( getElementsByType("ped", resourceRoot ) )do addEventHandler("onClientPedDamage", v, cancelEvent ) end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now