-
Posts
22 -
Joined
-
Last visited
Everything posted by THASMOG
-
Hi, how to check if player is connected to servre before performing some function. PLayers use lagg switch in my server. Is there any way to send check from client side to server and see if he is actually connected. If no then function returns. I hope u understand.
-
Can i buy u a beer ? It won't work but u helped me to learn something. I try to fix something now myself EDIT: IT WORKS !! I WANNA BUY U TWO BEERS !
-
Still nothing, I tryed to remove if weapon and weapon stuff still wont work.
-
Won't work..
-
Thanks very much, i test it. I didn't know that there is difference with getLocalPlayer or getLocalPlayer()
-
Miss post...
-
If i try to edit it i brake it more.
-
Thanks it works kinda. But it's not perfect. Now both players get text."Your car received damage! Do not log out in 10 seconds or you will die!" I'd like to only have ped in car. EDIT: Actually it's better that way. I just changed text to "You are in combat! Don't log out or you will die! if i change player's damage from source to local player does it work same way then ?. Sorry i can't test right now only 2 plaeyers in my server.
-
WORKS !!
-
Maybe DayZ plugin stops it to work ? But still nothing.
-
Added into server side script. Still wont work. No errors either. i try to debug
-
How i can remove all player weapons if they join ? addEventHandler("onClientResourceStart", getRootElement(), function() takeAllWeapons(player) setTimer( takeAllWeapons, 1000, 1, player) end) addEventHandler ( "onPlayerJoin", getRootElement(), relvadnahhuj ) function relvadnahhuj ( ) takeAllWeapons(getRootElement() ) end these wont work.
-
Sure thanks. I ask from them.
-
function weaponSwitch (weapon) if source == getLocalPlayer() then local ammoName,_ = getWeaponAmmoType2 (weapon) if getElementData(getLocalPlayer(),ammoName) > 0 then setElementData(getLocalPlayer(),ammoName,getElementData(getLocalPlayer(),ammoName)-1) end end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), weaponSwitch ) Simply i need to make a script that checks player ammo before fireing. Maybe onClientPlayerWeaponSwitch Why? Becose DayZ has a bug. When u drop mag and reconnect. Then you picup your dropped mag u have almost unlimited ammo (10000+).
-
So this script wont work. function weaponSwitch (weapon) if source == getLocalPlayer() then local ammoName,_ = getWeaponAmmoType2 (weapon) if getElementData(getLocalPlayer(),ammoName) > 0 then setElementData(getLocalPlayer(),ammoName,getElementData(getLocalPlayer(),ammoName)-1) end end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), weaponSwitch ) I try to fix bug in MTA DayZ. If player tops a mag from weapon and reconnects. Picks it up he has over 10000 ammo. So i need to build check that checks ammo before shooting ? Maybe "onClientWeaponSwitch"
-
Thanks very mutch. Like i see there is timer and damage think now i must make player kill if he disconnects before timer and GUI. I try tomorrow now i go to sleep
-
I readed a bit lua. Maybe the first script is too complicated for me So i start like that: function battlelogger ( attacker, weapon, bodypart, loss ) if ( bodypart==9) or (bodypart==8) or (bodypart==7) or (bodypart==6) or (bodypart==5) or (bodypart==4) or (bodypart==3) then Now i need to add some timer.
-
That tutorial looks nice yeah i'm reading more just hoped u guys can help me more Help: Do it for myself
-
No this is my first try. I started learning yesterday.
-
Hello, i am very new at mta scripting. And wanted to ask how to make scripts that autokills battleloggers. I try to explain. There is two players: Player 1 and Player 2. If Player 1 shots Player 2. Player 2 gets timer at bottom of his/her screen that countdowns 60 to 0. If he logouts before 0 he dies. So that means he cant run away from kill. But if Player 1 kills Player 2 before 0 the countdown just dissapears. And if Player 2 shots Player 1 back, they both would have timer. Maybe it's possible to make it only from other player dmg. Like if Player 1 jumps off cliff and getgs damage he wont get timer. I tryed to find it from online and tryed to make something myself. This is what i made from tutorials. function battlelogger ( attacker, weapon, bodypart, loss ) if ( bodypart == 9,8,7,6,5,4,3) then countdown = time outputChatBox(time) setTimer(reduceCountdown, 1000, countdown) end addEventHandler ( "onPlayerDamage", getRootElement (), battlelogger ) addCommandHandler("starttimer", startTimer) function reduceCountdown() countdown = countdown - 1 outputChatBox(countdown) if (countdown == 0) then outputChatBox("Start") end end function createBattleTimer() local sWidth, sHeight = guiGetScreenSize() local Width,Height = 800,45 local X = (sWidth/2) - (Width/2) local Y = sHeight - (Height/2) battleGridlist = guiCreateGridList(X,Y,Width,Height,false) battleLabel = guiCreateLabel(X,Y,Width,Height/2,"Test text",false,battleGridlist) loadBattleTimer() updateBattleItem(1) currentItem = 1 end addEventHandler("onClientResourceStart",resourceRoot,createBattleTimer) Thanks !