Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. np.
  2. 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
  3. 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
  4. 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)
  5. 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!")
  6. 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.
  7. getLocalPlayer -- this is a function getLocalPlayer() -- this is calling the function(using the function) localPlayer -- this is the result of the function, but predefined.
  8. 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.
  9. Client: line 15 : triggerServerEvent("setteam", localPlayer,playerName,teamName) line 10: remove: local team = getTeamName(teamName) Server: line 5: Typo(teamnale): local team = getTeamFromName(teamname or "") NOTE: You can also send elements(userdata's) from client to server and from server to client. Like: triggerServerEvent("example", localPlayer,getPedOccupiedVehicle(localPlayer),getPlayerFromName("IIYAMA"))
  10. Of course it isn't working it is much more complicated then that. You can try this, which I am 10% sure it will work. I have build something like this before, except I can't remember me how I wrote it. local gunTable = { 23, 30, 32, 20, 9 } local weaponDisable = function (slotChange) local validSlots = {0,1,2,3,4,5,6,7,8,9,10,11,12} local lastSlot = getPedWeaponSlot ( localPlayer ) for slot=0,12 do local weapon = getPedWeapon(localPlayer,slot) for wI=#gunTable,1,-1 do--inverse loop > table.remove if weapon == gunTable[wI] then table.remove(validSlots,slot) break end end end local lastSlotFound = false if slotChange == 1 then local saveTheLastPositions = {} for i=1,#validSlots do-- don't break this loop local slot = validSlots[i] if slot == lastSlot then lastSlotFound = i end saveTheLastPositions[i]=slot end if lastSlotFound then if saveTheLastPositions[lastSlotFound+1] then setPedWeaponSlot(localPlayer,saveTheLastPositions[lastSlotFound+1]) elseif saveTheLastPositions[1] then setPedWeaponSlot(localPlayer,saveTheLastPositions[1]) else error("something went very bad....") end elseif saveTheLastPositions[1] then error("player is not using a valid slot.") setPedWeaponSlot(localPlayer,saveTheLastPositions[1]) end elseif slotChange == -1 then local saveTheLastPositions = {} for i=#validSlots,1,-1 do-- don't break this loop local slot = validSlots[i] if slot == lastSlot then lastSlotFound = i end saveTheLastPositions[i]=slot end if lastSlotFound then if saveTheLastPositions[lastSlotFound-1] then setPedWeaponSlot(localPlayer,saveTheLastPositions[lastSlotFound-1]) elseif saveTheLastPositions[#saveTheLastPositions] then setPedWeaponSlot(localPlayer,saveTheLastPositions[#saveTheLastPositions]) else error("something went very bad....") end elseif saveTheLastPositions[#saveTheLastPositions] then error("player is not using a valid slot.") setPedWeaponSlot(localPlayer,saveTheLastPositions[#saveTheLastPositions]) end end end addEventHandler("onClientResourceStart",resourceRoot, function () bindKey("next_weapon","both",weaponDisable,1) bindKey("previous_weapon","both",weaponDisable,-1) end) addEventHandler("onClientResourceStop",resourceRoot, function () toggleControl ("next_weapon", true ) toggleControl ("previous_weapon", true ) end) addEventHandler("onClientRender",root, function () toggleControl ("next_weapon", false ) toggleControl ("previous_weapon", false ) end)
  11. Of course it isn't working. You should not use math random in the first place. Every type has it's own texture's and models. See wiki example: https://wiki.multitheftauto.com/wiki/Ge ... yTypeIndex function scriptNextClothes ( thePlayer, key, clothesType ) local currentTexture, currentModel = getPedClothes ( thePlayer, clothesType ) -- get the current clothes on this slot local clothesIndex = -1 if ( currentTexture ) then -- if he had clothes of that type local tempA, tempB = getTypeIndexFromClothes ( currentTexture, currentModel ) -- get the type and index for these clothes, so we can increase it to get the next set in the list if ( tempA and tempB ) then -- if we found them clothesType, clothesIndex = tempA, tempB end end clothesIndex = clothesIndex + 1 local texture, model = getClothesByTypeIndex ( clothesType, clothesIndex ) -- get the new texture and model if ( texture == false ) then -- if we've reached the end of the list removePedClothes ( thePlayer, clothesType ) else addPedClothes ( thePlayer, texture, model, clothesType ) end end addCommandHandler ( "nextClothes", scriptNextClothes )
  12. Only the client version can get this information. Also this event can be cancelled. "onClientVehicleDamage" local lastDamageTime = 0 function VehicleGetDamageDayZ ( attacker, weapon, loss, x, y, z, tyre ) local vehicle = getPedOccupiedVehicle( localPlayer ) local timeNow = getTickCount() if timeNow > lastDamageTime and source == vehicle and not getElementData ( localPlayer, "tempodosexo" ) then if weapon and weapon > 1 and attacker and getElementType(attacker) == "player" then 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 You used getLocalPlayer instead of getLocalPlayer() or localPlayer.
  13. I am not sure if you understand what I mean. You have to debug the data before it got saved and after it has been loaded. outputDebugString(tostring(getPedWeapon (source, 0))) Also if that is fine, debug the result of the functions tostring(setAccountData(....)) and tostring(getAccountData(....)) Simply checking the data that goes in and out..... btw getPedTotalAmmo doesn't work always correctly.
  14. I don't see anything wrong with the code. Why don't you debug it yourself with outputDebugString()?
  15. https://wiki.multitheftauto.com/wiki/Anti-cheat_guide
  16. IIYAMA

    [Solved]

    Maybe you should send the player name too? https://wiki.multitheftauto.com/wiki/TriggerServerEvent triggerServerEvent ( string event, element theElement, [arguments...] ) triggerServerEvent("mute", player,playerName)
  17. IIYAMA

    Compass

    oh lol I haven't seen that too.
  18. IIYAMA

    Weird error

    function serverfire (thePlayer) local team = getTeamFromName( "Los Santos Fire Department" ) if team then for k, v in ipairs ( getPlayersInTeam (team) ) do outputChatBox("[RADIO] This is dispatch, We've got a report from a fire at " .. randomfire[4] .. " via the emergency line, over.", v, 245, 40, 135) outputChatBox("[RADIO] Please report there NOW.", v, 245, 40, 135) end else outputChatBox("ERROR: team doesn't exist.",thePlayer) end if exports.global:isPlayerAdmin(thePlayer) then triggerClientEvent( "burnbabyburn", getRootElement(), jevifire ) triggerClientEvent( "ringTheBell", root, fdbell ) outputChatBox("Fiiiire!", thePlayer) end end addCommandHandler ( "jevifire" , serverfire )
  19. Moeilijk om mensen te helpen? Niemand kan je helpen met een antwoord als dat... zeker als men je meerdere malen moet vragen voor een beter/ander antwoord. Moet je ook niet raar op gaan kijken als mensen je voor een kleuter houden. Wat wij verwachten is dat je de resource namen neerschrijft of de auteurs of een link naar de resources. Dit slaat echt helemaal nergens op.
  20. Laat maar, hij is 9 of zo. Ik ga daar geen moeite in stoppen.
  21. https://forum.multitheftauto.com/viewtopic.php?f=108&t=27006&start=0&st=0&sk=t&sd=a
  22. np.
  23. This is how you solve that problem. local healthLoss = 30 addCommandHandler("kill", function() local health = getElementHealth(localPlayer) if healh =< healthLoss then setElementHealth(localPlayer,0) else setElementHealth(localPlayer,healh-healthLoss) end end) Health gets refilled because you can't have negative health for players.
  24. IIYAMA

    Compass

    function dxDrawImageX() local rotz = getElementRotation(getLocalPlayer()) local now = rotz local End = 360 local progress = now / End dxDrawImageSection(65+(progress*250),516,500, 50, 65, 0, 100, 50, "360.png") end addEventHandler("onClientRender", getRootElement(), dxDrawImageX) As you said image is 500x 50 and not 165x50 which you did. Does the image move or what? And at what value does the image starts? Is the 0 in the middle? You have to see dxImageSection as a photoshop masker(except it isn't moving with the image). Between those arguments the image is visible: [b]u:[/b] the absolute X coordinate of the top left corner of the section which should be drawn from image [b]v:[/b] the absolute Y coordinate of the top left corner of the section which should be drawn from image [b]usize:[/b] the absolute width of the image section [b]vsize:[/b] the absolute height of the image section My screen is 1920x1080. And I want to show an image on my screen which has a non pixel border(50 px). Then I would use those values: posX = [color=#FF8000]0[/color] posY = [color=#FF8000]0[/color] width =[color=#FF8000] 1920[/color] height =[color=#FF8000] 1080[/color] u =[color=#FF8000] 50[/color] v =[color=#FF8000] 50[/color] usize = [color=#FF8000]1870[/color][color=#00FF00] -- 1920-50[/color] vsize = [color=#FF8000]1030[/color] [color=#00FF00]-- 1080-50[/color]
  25. Er zijn heel veel login panels en spawn panels.(zo als ik al gezegd heb) Het lijkt er op dat je scripts niet samen kunnen werken. Hoe je dat oplost is aan jouw, zoek scripts die wel kunnen samenwerken of pas de code aan.
×
×
  • Create New...