E-mail Posted August 7, 2011 Posted August 7, 2011 Hi iam making a New anti!-Fist Form My Server Please Fix it 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)
JR10 Posted August 7, 2011 Posted August 7, 2011 (edited) 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 August 8, 2011 by Guest Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
MTA Team qaisjp Posted August 8, 2011 MTA Team Posted August 8, 2011 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)
JR10 Posted August 8, 2011 Posted August 8, 2011 Useless?? I bet the problem was that he didn't see the message. And that: if source === getLocalPlayer() then return end I never used it, and my client events still worked. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
E-mail Posted August 8, 2011 Author Posted August 8, 2011 The Msg show to the Victem not example If i hit JR10 the msg go to JR10 not me i want it show to me:)
BinSlayer1 Posted August 8, 2011 Posted August 8, 2011 if source === getLocalPlayer() then return end does nobody notice there are 3 = ? lol you need to use 2 =
JR10 Posted August 8, 2011 Posted August 8, 2011 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. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
JR10 Posted August 8, 2011 Posted August 8, 2011 You welcome. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
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