Jump to content

New in script Please Help me :(


E-mail

Recommended Posts

Hi iam making a New anti!-Fist Form My Server :D

Please Fix it :D

outputChatBox("No-TbGes|x[Dev-PoinT]x",255,255,0) 
function stopMinigunDamage ( attacker, weapon, bodypart ) 
    if ( weapon == 0 ) then 
              outputChatBox("Dontkill with Fist!!",0,255,) 
        cancelEvent() 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage) 

:cry:

Link to comment
outputChatBox("No-TbGes|x[Dev-PoinT]x",255,255,0) 
function stopMinigunDamage( attacker, weapon, bodypart ) 
    if ( weapon == 0 ) then 
              outputChatBox("Dontkill with Fist!!",0,255,0) 
              cancelEvent() 
    end 
end 
addEventHandler ( "onClientPlayerDamage", root, stopMinigunDamage) 

Edited by Guest
Link to comment
code

That was useless, lol.

What doesn't work? Do /debugscript 3 and tell us your errors. Help us to help you!

meta.xml

  
<meta> 
     <script src="c.lua" type="client/> 
</meta> 
  

c.lua

outputChatBox("No-TbGes|x[Dev-PoinT]x",255,255,0) 
function stopMinigunDamage( attacker, weapon, bodypart ) 
   if source === getLocalPlayer() then return end 
    if ( weapon == 0 ) then 
              outputChatBox("Dontkill with Fist!!",0,255,0) 
              cancelEvent() 
    end 
end 
addEventHandler ( "onClientPlayerDamage", root, stopMinigunDamage) 

Link to comment

Try:

Server side:

addEvent("sendMsgToAttacker", true) 
addEventHandler("sendMsgToAttacker", root, 
function() 
 outputChatBox("Dontkill with Fist!!",source,0,255,0) 
end) 

Client side:

outputChatBox("No-TbGes|x[Dev-PoinT]x",255,255,0) 
function stopMinigunDamage( attacker, weapon, bodypart ) 
    if ( weapon == 0 ) then 
              outputChatBox("Dontkill with Fist!!",0,255,0) 
              cancelEvent() 
              triggerServerEvent("sendMsgToAttacker", attacker) 
    end 
end 
addEventHandler ( "onClientPlayerDamage", root, stopMinigunDamage) 

Both players will see the message.

You can remove outputChatBox in the client side, so only the attacker see the message.

Link to comment

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...