-
Posts
132 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Trust aka Tiffergan
-
Hello i want to do script that when player aim, you will see player nick and distance between you and player that you aiming at ( sorry for english ) i did something like this if playerTarget then local x,y,z = getElementPosition(playerTarget) local x,y,distance = getScreenFromWorldPosition (x,y,z+0.5) distance = 30 if getElementData(playerTarget,"bandit") then text = string.gsub(getPlayerName(playerTarget), '#%x%x%x%x%x%x', '' ) else text = string.gsub(getPlayerName(playerTarget), '#%x%x%x%x%x%x', '' ) end local w = dxGetTextWidth(text,distance*0.033,"default-bold") if w and x and y and text and distance then dxDrawText ( text.."("..(getDistanceBetweenPoints3D( x,y,z, getElementPosition ( localPlayer )))..")",x-(w/5),y,x-(w/5),y,tocolor(100, 255, 100, 200),distance*0.033,"bankgothic") end end end); that line is the showing name and distance dxDrawText text.."("..(getDistanceBetweenPoints3D( x,y,z, getElementPosition ( localPlayer )))..")",x-(w/5),y,x-(w/5),y,tocolor(100, 255, 100, 200),distance*0.033,"bankgothic") but i dont know why i have so damn large output
-
I have a question, how can I make a script in which I create a vehicle for a command, and if someone takes it from me, then I type this command and he returns to my cords x / y / z, I hope you understand, I just have one vehicle someone will take it from me then I will enter the command and the vehicle is taken from them and he comes back to me i hope you understand sorry for bad english
-
I not sure why i need getPedOccupiedVehicle look on video repairing car look like that : and i want just to have oportunity to stop it ( SORRY FOR ENGLISH :V ) and the thing i want to do is when i have this animation i want to have text on chat to stop repair press K and when im pressing K my ped is stoping repairing. https://streamable.com/a4eosn
-
addEventHandler("repairVehicle", root, function(veh) if repairTimer[veh] then triggerClientEvent(source, "displayClientInfo", source, getVehicleName(veh).." is already in repair!", 255, 22, 0) return; end repairTimer[veh] = setTimer(fixDayZVehicle, (1000-(math.floor(getElementHealth(veh))))*120, 1, veh, source); setElementFrozen(veh, true); setElementFrozen(source, true); setPedWeaponSlot(source, 0); setElementData(veh, "repairer", source); setElementData(source, "repairingvehicle", veh); setElementData(source, "repairvehicle", true); setPedAnimation(source, "SCRATCHING", "sclng_r", nil, true, false); triggerClientEvent(source, "displayClientInfo", source, "Started to repair "..getVehicleName(veh), 22, 255, 0); end); This is a code that repairs your vehicle, works well, but I want to add something that I have the option of pressing a button, e.g. "k", and stop repairing the vehicle, but I don't know how I can do it: V
-
XD Dandi co biznesmen
-
[HELP] Unlimited oxygen DAYZ
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
o i got it thanks for help man if soemone wanna now how this is it : function stopDrown () skin = getPedSkin(localPlayer) if skin == 200 then cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDrown ) -
[HELP] Unlimited oxygen DAYZ
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
No there is no erros as i said that script is working on freeroam/play but on dayz isn't when i was searching getPedOxygenLevel there is 0 hits but when i was searching isElementInWater was 1 hit with that addEventHandler("onPlayerRefillWaterBottle", root, function(itemName) if isElementInWater(source) then if getElementData(source,itemName)<=0 then return end setElementData(source, "Water Bottle", getElementData(source, "Water Bottle") + 1); setElementData(source, itemName, getElementData(source, itemName) - 1); triggerClientEvent(source, "displayClientInfo", source, "You filled 1 x "..itemName, 22, 255, 0); triggerClientEvent(source, "refreshInventoryManual", source); else triggerClientEvent(source, "displayClientInfo", source, "You must be in water!", 255, 22, 0); end end); -
I want to do something that if we have a skin id == 200, we can swim as much as we want, and I did something that works for freeroam, but I do DayZ server and on DayZ server i get damage function stopDrown ( attacker, damage_type) if ( getElementType(source) == "player" ) then skin = getPedSkin(localPlayer) if skin == 200 and damage_type == 53 then cancelEvent() end end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDrown )
-
Witajcie. W imieniu zespołu World-DayZ chciałbym Was serdecznie zaprosić na nasz serwer. Brak doświadczenia w charakterze administratorów serwera MTA nadrabiamy doświadczeniami zdobytymi z perspektywy wieloletnich graczy trybu DayZ. Myślą przewodnią naszego serwera jest stwierdzenie: ,,Od graczy dla graczy". Serwer jest tworzony z myślą o funkcjonowaniu przez długi okres i został opłacony na jeden rok, także angażując się w grę na naszym serwerze możecie być pewni, że Wasze osiągnięcia nie pójdą na marne. Wszystkie zrzuty ekranu znajdziecie poniżej. NOWOŚCI - System, który rozwiązuje problem campienia pojazdów w bazach przez nieaktywne grupy, dzięki teleportowaniu nieużywanych przez dłuższy okres pojazdów poza obręb bazy jego właścicieli, z dodatkiem licznika informującego o 48 godzinnym odliczaniu i pozostałym czasie, - System poziomów zintegrowany z systemem nagród za osiągnięcie kolejnych progów poziomów, - System armorów, mający za zadanie między innymi uczynienie pojedynków car versus car ciekawszymi, dzięki wydłużeniu ich czasu trwania, - Występujący w trzydziestominutowych interwałach zrzut cennego zaopatrzenia, - Ranking graczy, - Szybki wybór broni, - Oraz wiele, wiele innych. CZEGO MOŻECIE SPODZIEWAĆ SIĘ PO NASZYM SERWERZE - Czynnego udziału administracji w życiu serwera, - Różnorodnych, ciekawie prowadzonych eventów, - Sympatycznej atmosfery, - Możliwości wyrażania swojej opinii odnośnie serwera, która nie zostanie zignorowana, - Możliwości brania udziału w rozwijaniu się nowej społeczności w świecie MTA DayZ, - Aktywnego Discorda i Teamspeaka, na których zawsze możecie zasięgnąć porady, poprosić o pomoc, czy też po prostu sobie po towarzysku pogadać Rzeczy do kupna Jak każdy wie, bazy stanowią nierozłączny element systemem trybu DayZ, toteż nie może go zabraknąć i na naszym serwerze. Będą się na nim znajdować 3 rodzaje baz z podziałem na rozmiar, czyli baza mała, baza średnia i baza duża. Ceny nie są wygórowane, także wydaje nam się, że każdy gracz będzie w stanie pozwolić sobie na jedną z nich, jeśli jednak masz swoją własną ekipę, która liczy minimum 5 osób i każdy z jej członków będzie miał przegrane 20 godzin na serwerze, to mamy dla Was dobrą wiadomość - będziecie mogli zgłosić się po darmową bazę! Wystarczy tylko, że napiszecie podanie na Discordzie o darmową, małą bazę na okres jednego miesiąca. Będzie także możliwość zakupu skina grupowego, przypisanego do Waszej ekipy. Na chwilę obecną nie planujemy dodawać boxów z amunicją ani spawnów pojazdów, gdyż naszym zdaniem nie tak powinno wyglądać DayZ. Nie chodzi nam o wyzysk, a o to, żebyście się dobrze na naszym serwerze bawili i chcieli w niego zaangażować. Baza mała Baza średnia Baza duża Porównanie baz System "Anty Kampienia Pojazdów" Poziomy Nazwa Serwera: World-DayZ IP Serwera: mtasa://54.38.202.159:20152 TeamSpeak:lol.mtasa.eu Discord: https://discord.gg/7wqeW72 Sloty: 40 | Gamemode: DayZ Przewidywalna data startu serwera 16.05.2020 godzina 16:00 - Czekamy na Was.
-
o thanks it works, i was trying using OnPlayerSpawn and that was not working
-
So i have this code, and this code work great, but when i will die and i will respawn i have still animations even if my ID skin is not 78 or 76 so what i need add there that will set my player animation on 0 when im respawning? function informPlayerOnModelChange(oldModel, newModel) if ( getElementType(source) == "player" ) then skin = getPedSkin(localPlayer) if skin == 78 or skin == 76 then setPedWalkingStyle(localPlayer,59) else setPedWalkingStyle(localPlayer,0) end end return end addEventHandler("onClientElementModelChange", root, informPlayerOnModelChange)
-
[HELP] Trying to do bullet proof skin
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
yes client side but maybe i did something wrong look all c-side function informPlayerOnModelChange(oldModel, newModel) if ( getElementType(source) == "player" ) then skin = getPedSkin(localPlayer) if skin == 285 setPedWalkingStyle(localPlayer,59) else setPedWalkingStyle(localPlayer,0) end end end addEventHandler("onClientElementModelChange", root, informPlayerOnModelChange) addEventHandler("onClientPlayerDamagr",root,function() if ( getElementModel ( source ) == 285 ) then cancelEvent() end end ); -
[HELP] Trying to do bullet proof skin
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
Not working and there is no erros in DB video if you not belive https://streamable.com/7uiygz -
Hello so as you can see in topic, I trying to do bullet proof skin and i was trying something like this but it not working function dmg ( attacker ) skin = getPedSkin(localPlayer) if skin == 285 cancelEvent() end addEventHandler ( "onClientDamage", getRootElement(), dmg )
-
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
This first way is easier, I added to accounts.Lua and everything is working, thanks -
not sure what you want but maybe this ?
-
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
my bad there is an error in line 8 on that setElementData https://prnt.sc/scajbc sorry for spamming i cant edit my post -
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
and i now trying do this like that table = {"Milk","MP5A5","M4A1-S","AK-47","Soda Bottle","Pizza","AS50","Tent","Medium Tent","ACR","AR-15","M107","Pasta Can","Beans Can","Golf Club"} addEventHandler("onPlayerSpawn", root, function(lvl) local player = source if not lvl then lvl = getElementData(player, "lvl") or 0; end if lvl >= 1 then for i = 1, lvl do setElementData(player, "lvl", table[i], (getElementData(player,"lvl", table[i]) or 0) + 1); end end end); they're no errors, but still i dont have weapon and anyting ... -
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
even i was trying like this addEventHandler("onPlayerLogin", getRootElement(), function() local level = getAccountData(getPlayerAccount(source), "lvl") or 0 if not level then return outputChatBox(" wrong lvl", source) end if level >= 1 then setElementData(source, "MP5A5", 1) elseif level >= 2 then setElementData(source, "Tent", 1) elseif level >= 3 then setElementData(source, "Milk", 1) elseif level >= 4 then setElementData(source, "Medic Kit", 1) elseif level >= 5 then setElementData(source, "Shovel", 1) end end); and function to test ElementData function test(plr) local data = getElementData(plr, "Tent") or 0 outputChatBox (data, plr) end addCommandHandler("spr", test) and when i will use SPR i will have 0 on chat, soi dont know what im doing wrong with that -
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
so i was trying like this but none of this was working in accounts.Lua i was trying this option ( not everything at once ) addEventHandler("onPlayerDayZLogin", root, function() local lvl = getElementData(source, "lvl") or 0; if lvl then if lvl >= 1 then setElementData(player, "MP5A5", 1) elseif lvl >= 2 then setElementData(player, "Tent", 1) elseif lvl >= 3 then setElementData(player, "Milk", 1) elseif lvl >= 4 then setElementData(player, "Medic Kit", 1) elseif lvl >= 5 then setElementData(player, "Shovel", 1) end end end); table = {"Milk","MP5A5","M4A1-S","AK-47","Soda Bottle","Pizza","AS50","Tent","Medium Tent","ACR","AR-15","M107","Pasta Can","Beans Can","Golf Club"} addEventHandler("onPlayerDayZLogin", root, function(lvl) if not lvl then lvl = getElementData(source, "lvl") or 0; end if lvl >= 1 then for i = 1, lvl do setElementData(source, table[i], getElementData(source, table[i]) + 1); end end end); addEventHandler("onPlayerDayZLogin", root, function() local lvl = getElementData(source, "lvl") or 0; if lvl then if lvl >= 1 then setElementData("M4A1-S", 1) end end end); addEventHandler("onPlayerSpawn", root, function() local lvl = getElementData(source, "lvl") or 0; if lvl then if lvl > 1 then setElementData(source, "M4A1-S", 1) end end end); AND ON SERVER.Lua IN SCRIPT LEVEL I WAS TRYING THIS addEventHandler("onPlayerLevelUp", root, function(newlvl) if newlvl then if lvl >= 1 then setElementData(player, "MP5A5", 1) elseif lvl >= 2 then setElementData(player, "Tent", 1) elseif lvl >= 3 then setElementData(player, "Milk", 1) elseif lvl >= 4 then setElementData(player, "Medic Kit", 1) elseif lvl >= 5 then setElementData(player, "Shovel", 1) end end end); and none of this work, im just stupid i think... EDIT : i had no erros in DB -
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
wow, lots of information, I will try to comprehend something and create something when I wake up, all night I tried to do it and now I go to sleep, If i will have problems i will write here , thanks again, I should get up around 6, cheers. -
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
So, I was able to block the experience when you reach level 15, but I have a really big problem creating a function that will give you an item to start if you have enough level i was trying like that ( dont laught i know its bad ) if getElementData(player,'lvl') >= 9 then itemName == ("Milk", 1) addEventHandler ("onPlayerSpawn", getRootElement(), function() if getElementData(player,'lvl') > 9 then setElementData("Milk",1 ) help -
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
Great, i will try to do this, cheers. -
[HELP] need help with exp when i kill player
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Scripting
thanks i appreciate your help and last question, what function or event i need to use to do like max 30levels and award for hitting level, like if you hit level 5 you will get knife on respawn