Jump to content

IIYAMA

Moderators
  • Posts

    6,089
  • Joined

  • Last visited

  • Days Won

    216

Everything posted by IIYAMA

  1. Ligt er maar net aan of je webserver goed werkt. Ja.
  2. Serverside: Events: "onPlayerWasted" Functions: getElementPosition getElementRotation createPed killPed and maybe for removing the peds after a while: setTimer getTickCount() destroyElement
  3. if (getGuestAccount [source,playerAccount,"player.guest",playerSerial] ) then Makes no sense. I have no idea what you are trying to accomplish.
  4. A table. local buttonDataTable = {} function showMissionWindow(who, value1, value2) --window showing and other :~ here gui["przyjmijMisje"] = guiCreateButton(10, 205, 111, 23, "Take mission", false, gui["glowne"]) addEventHandler( "onClientGUIClick", gui["przyjmijMisje"], supkaFunkcja) buttonDataTable[ gui["przyjmijMisje"] ]= {value1, value2} -- store end function supkaFunkcja(button, state, absoluteX, absoluteY) local buttonData = buttonDataTable[source] -- request if buttonData then -- check outputChatBox(tostring(buttonData[1]) .. " " .. tostring(buttonData[2])) -- showing value1 and value2 var from showMissionWindow end end
  5. Exactly, >> only that resource can edit it <<, but that isn't admin isn't it? Only the script it self can edit the setting. By using: https://wiki.multitheftauto.com/wiki/Set
  6. IIYAMA

    SOLVED

    What I am trying to show you, is how you can communicate with the server. Isn't that what you want? Knowing if a player is muted or unmuted so you can show the right button? What I have written is designed to request information(muted/unmuted) from the server and send it back to the client who asked for it. Also I added a function which can mute/unmute a player when you press one of those buttons. But what triggers the function: unmute_players ? You don't check if that player does exist that has been given by getPlayerFromName, which will give some warnings. Also source can be a button = onClientGUIClick or a player = triggering, it will not work you have to put some functions in between making sure all data is correct. Also clientside only elements can't switch from side. This code is more complicated then the lines you already have written yet. You can better know then thinking you know, test your variables is a good start. I hope my information can help you further.
  7. Well this is what you need: To get the size of the object: https://wiki.multitheftauto.com/wiki/Ge ... oundingBox To check where the ground is: https://wiki.multitheftauto.com/wiki/ProcessLineOfSight And of course you need a lot of matrix or trigonometric functions, which I unfortunately do not know to much of.
  8. IIYAMA

    SOLVED

    This is how it can be done. You have to merge it with your button script and set up your buttons. Good luck. server addEvent("check_player_mute", true) addEventHandler("check_player_mute", root, function (playerName) if isElement(source) then local targetPlayer = getPlayerFromName ( playerName ) if targetPlayer then triggerClientEvent(source,"playerMuteStatus",targetPlayer, isPlayerMuted (targetPlayer),playerName) end end end) addEvent("mutePlayer",true) addEventHandler("mutePlayer",root, function(status) if isElement(source) and isElement(client) then setPlayerMuted (source,status) outputChatBox("You have been muted by IIYAMA....",source,255,0,0) end end) client addCommandHandler("checkmute", function(CMD,name) triggerServerEvent("check_player_mute",localPlayer,name) end) addEvent("playerMuteStatus",true) addEventHandler("playerMuteStatus",root, function (muteStatus,targetName) local targetPlayer = source if isElement(targetPlayer) then outputChatBox("You are trying to mute/unmute this person: " .. targetName) end end) --[[ do your button stuff... triggerServerEvent("mutePlayer",targetPlayer,not muteStatus) ]]
  9. you merge the code inside the resource of the models?
  10. addEventHandler("onClientRender",root, function () end) Put only the dynamic code inside.
  11. IIYAMA

    Question Bool

    no, loadstring can still return a nil variable. but: "or false" will change a nil to a false/boolean. boolean = nil or false outputChatBox(type(boolean)) function toboolean(bool) if (bool) then return loadstring("return " ..bool)() or false end return false end
  12. IIYAMA

    Question Bool

    you can do this: local boolean = boolean == "true" and true or false Or you can make it a boolean(as you actually wanted to do it): local boolean = loadstring("return " .. boolean)() But I prefer the first one, since it is faster with the same/better result. It is better to get a boolean back then a nil, what ever happens in version 1 always returns a boolean.
  13. @arezu ]] function test () end [/code] --[[ [code=lua]
  14. clientside addEventHandler ( "onClientPlayerDamage",localPlayer, function ( attacker, weapon, bodypart) if weapon == 23 then cancelEvent() end end)
  15. I hope they will ban his account/accounts, I hate crooks. Just report his post, will be enough when more people do that.
  16. Easing functions like "Linear" and "OutElastic" do only affect the speed of moving. When you choose Linear, it will move with the same speed. When you choose InQuad, it will move fast in the beginning and slow down at the end. When you choose OutQuad, it will move slow in the beginning and speed up later.
  17. limping from stealth? It is in noisebar.lua Remove:(circa at line 180 t/m 193) if isPedInVehicle (getLocalPlayer ()) then return else islimping = getElementData ( getLocalPlayer (), "legdamage" ) if islimping == 1 then local makeplayerlimp = setTimer ( limpeffectparttwo , 200, 1, source, key, state ) if lookingthroughcamera ~= 1 then toggleControl ("right", false ) toggleControl ("left", false ) toggleControl ("forwards", false ) toggleControl ("backwards", false ) end end end
  18. IIYAMA

    help xml

    You can use sha256, but you only can use it if you are going to compare passwords: local myPassword = sha256 ("myPassword") -- save this. if myPassword == sha256 (.....) then Else you have to create your own password decoder. local myConvertTable = {["A"]="C",["Y"]="*",["4"]=")" ... etc, local myPassword= "WTF!" myPassword = string.upper(myPassword) myPassword = string.reverse(myPassword) local stringLen= string.len (myPassword)--4 local newString = "" for i=1,stringLen do local character = string.sub(myPassword, i,i) newString .. (myConvertTable[character] or character) end And set this decoder at serverside to prevent people can use the decoder at home. I bet you can find a creative way to do this. http://lua-users.org/wiki/StringLibraryTutorial
  19. The first argument after the string event("armaAA"), will be the source. triggerServerEvent ( "armaAA", theDealer, theDealer, hitElement ) triggerServerEvent ( string event, [color=#FF0000]element theElement[/color], [arguments...] ) Is the source. The rest will be the arguments > (argument1,argumen2)
  20. Debug your code with outputDebugString, if nobody can see why it doesn't work, you should make it visible. You will make more trouble then fixing it, by redefine predefined variables. and if you aren't sure they do work well, you can compare them with the function that returns that value. if localPlayer == getLocalPlayer() then and you will be fine. @THASMOG I hope you can do that next time by yourself, instead of saying that you can't find your problem. local lastDamageTime = 0 function VehicleGetDamageDayZ ( attacker, weapon, loss, x, y, z, tyre ) outputDebugString("addEventHandler works") local vehicle = getPedOccupiedVehicle( localPlayer ) local timeNow = getTickCount() if timeNow > lastDamageTime and source == vehicle and not getElementData ( localPlayer, "tempodosexo" ) then outputDebugString("tickCount system works, vehicle check works, elementdata check works") outputDebugString("weapon: " .. tostring(weapon) .. ", attacker: " .. tostring(attacker).. ", element type " .. tostring(attacker and getElementType(attacker))) if weapon and weapon > 1 and attacker and getElementType(attacker) == "player" then outputDebugString("weapon check works,attacker exist, element type is a player.") lastDamageTime = timeNow+300 -- can only be executed every 300 ms. setTimer (deslogger, 10000, 1, localPlayer) setTimer ( setElementData, 10000, 1, localPlayer, "tempodosexo", false ) setElementData ( localPlayer, "tempodosexo", true ) outputChatBox ( "Your car received damage! Do not log out in 10 seconds or you will die!", localPlayer, 255, 5, 0 ) end end end addEventHandler ( "onClientVehicleDamage", root, VehicleGetDamageDayZ ) outputDebugString("code loaded!")
  21. outputChatBox ( "Your car received damage! Do not log out in 10 seconds or you will die!", [color=#FF0000]localPlayer[/color], 255, 5, 0 ) outputChatBox ( "Your car received damage! Do not log out in 10 seconds or you will die!", 255, 5, 0 ) You don't have to send it to anybody at clientside, since you are the client.
  22. getLocalPlayer -- this is a function getLocalPlayer() -- this is calling the function(using the function) localPlayer -- this is the result of the function, but predefined.
  23. You don't need to use interpolateBetween for dx image when you only use "Linear". Well just as example: You image is 500px x 200px Your resolution is: 1920px x 1080px. You start drawing the image at: 1420px x 1080px NOT TESTED local sX,sY = guiGetScreenSize() local moveTime = 3000 -- define how long it takes before the animation is complete. local imageXSize,imageYSize = 500,200 -- define the image size local imageXStart,imageYStart = sX-imageXSize,sY-- define where you start drawing you image local imageX_Distance = sX-imageXStart -- define how much you move local imageMoveStateOut = true -- define the state you are using local imageTimeEnd = getTickCount()+moveTime -- set up the time before the animation ends. addEventHandler("onClientRender",root, function () local timeNow = getTickCount() if timeNow > imageTimeEnd then -- check if the future time is still higher then the time now. Else we: imageTimeEnd = timeNow+moveTime-- set new future time. imageMoveStateOut = not imageMoveStateOut-- swap animation end local progress = (imageTimeEnd-timeNow)/moveTime -- calculate the progress. dxDrawImage( imageMoveStateOut and imageXStart+(imageX_Distance*progress) or imageXStart+(imageX_Distance*(1-progress)),imageYStart,imageXSize,imageYSize,"myImage") end) imageXStart+(imageX_Distance*progress) -- out imageXStart+(imageX_Distance*(1-progress)) -- in With other words, its is easier then you think. Also if you want to choose something else then "linear": Then you better can use: getEasingValue Which will give the same result.
×
×
  • Create New...