Jump to content

I need help whit my tazer!


kevenvz

Recommended Posts

Posted

Hello, I am new in scripting and here it is.

I don't know how to script a tazer.

I want a tazer that if your team is 'Cops' and when you shoot whit a deser eagle that it won't hurt the guy and that it will set the player animation in FALL_front. (Search in wiki by animation list)

Please can you make this for me?

Posted

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Thanks for the wiki pages. I hope I can make it!

EDIT: That team is too hard I think so I did this:

  
function cancelPedDamage ( attacker, weapon ) 
    if (attacker) and (weapon == 24) then 
setPedAnimation( source, "ped", "FALL_front") 
    cancelEvent() -- cancel any damage done to peds 
end 
end 
addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) 
  

I don't know or this will work. But I will try it. And if it don't work then please can you make it or 50P?

Posted

post your current script, read about debugging on wiki https://wiki.multitheftauto.com/wiki/Debugging

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Oh guys, In think I got it I got my script server side and that event is client side maybe onPlayerDamage will wokr ;)

EDIT: It works! But I wanted that it won't damage people. How do I code that ;)

Posted

cancelEvent()

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

I did this. Realy wired here is my code:

  
-- server sided 
function cancelPedDamage ( attacker, weapon ) 
    if (attacker) and (weapon == 24) then 
    setPedAnimation( source, "ped", "FALL_front") 
    cancelEvent() -- cancel any damage done to peds 
    end 
end 
addEventHandler ( "onPlayerDamage", getRootElement(), cancelPedDamage ) 
  

Posted

looks fine, now add team checking (use functions i gave you)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

i was wondering why i told him to use client side event when there is onPlayerDamage.. i forgot it, but still had it on my mind i think ;p

thanks BinSlayer1

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

I think it's best to use two scripts, one client-side for canceling damage and another server-side for animation.

-

Posted

this is what i suggested in my 1st post ;)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...