Adde

Members
  • Content Count

    234
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Adde

  • Rank
    Trick
  • Birthday 30/11/1995

Details

  • Gang
    ZO:R (Backup)
  • Location
    Sweden
  • Interests
    Scripting
  1. Read this: bool setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, bool loop=true, bool updatePosition=true, bool interruptable=true, bool freezeLastFrame = true] ) Optional Arguments NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments. block: the animation block's name. anim: the name of the animation within the block. time: how long the animation will run for in milliseconds. loop: indicates whether or not the animation will loop. updatePosition: will change the actual coordinates of the ped according to the animation. Use this for e.g. walking animations. interruptable: if set to 'false' other tasks wont be able to interupt the animation. Setting this to 'false' also gives this function more power to override other animations that are running. For example, squatting after a jump can be terminated. freezeLastFrame: ... (From 1.1 onwards). So.. You have to set animation time in milliseconds and loop (true or false).
  2. What´s your rpm on hdd and your ethernet speed? Because I had a windows XP PC with 2.6 ghz CPU, 4GB ram, 500gb hdd 5600rpm, 100/100 ethernet card and 100/10 modem. I ran a server with a lots of lots of scripts and could host a server with 25-30 players before it started to lag or crash. So depended on settings, rpm on hdd and ethernet modem/card you could host a server for about 15-20 players maybe. I am not an expert, that´s just what I think. So if anyone want´s to complain on my answear please.. I am just guessing.
  3. Hello, I am trying to help my friend but it seems like I would need some help as well. I am working with a script that will show the nemesis health ( if he isn´t dead) on the screen. He told me that I can call a function to get the health with "exports.extra_health:getElementExtraHealth(Nemesis)" but it does not work. "attempt to concatenate nHealth ( a boolean value)" in debug. Then how can I get the nemesis health? It´s the scripts nemesis, slothbot and extra_health from community, I think. Someone who want to help me or maybe knows how to do it? Current code (only the nemesis health part): nHealth = exports.extra_health:getElementExtraHealth(Nemesis) if ( nHealth ) and ( nHealth >= 1 ) then dxDrawText("Nemesis health: "..nHealth, 1550/1920*x, -1050/1080*y, x, y, tocolor(255, 0, 0), 1/1920*x, 1/1080*y, "pricedown", "left", "center", false, false, false) end
  4. Ye but nothing in debug, the text is there like before. But I have tried a lot myself, but nothing was working. That´s why I am asking here if someone knows how to do it. I fixed it, a small thing that wasn´t noticing in debug some reason. Thx your suggestion.
  5. Hmm, didn´t work. I´ve seen stuff like this around in the forum. Btw, I am using vehHP as: vehHP = getElementHealth(getPedOccupiedVehicle(localPlayer))
  6. Hello, I´m woundering how I can get a dxText to flash. Like change the alpha from 0 to 255 and then from 255 to 0. The lines looks like this atm: if ( vehHP <= 300 ) then dxDrawText("Warning", 0.37*x, 0.962*y, 0.5*x, 1.0*y, tocolor(255, 0, 0, 255), 0.0012*x, 0.0019*y, "default", "center", "center", false, false, true, false) else return end So I want to make that text flashing when it´s showing. Anyone who can help me?
  7. Thank you, now it´s working. I think I´ve seen that solution before, but it´s easy to forget. Anyway I appreciate your help.
  8. Hello, I got 1 line here that doesn´t do what it is ment to do. I have tried with "if ( guiGridListGetSelectedItem(teamGridlist) ) then" and "if guiGridListGetSelectedItem(teamGridlist) then" but non of them works. If the player haven´t selected anything in the gridlist then it should do "outputChatBox" instead of this "triggerClientEvent, showCursor and setGuiVisible". But it doesn´t work. It closes the gui even if I have selected a row in gridlist or not. Would be thankfull if I got a little help in this part. Here´s the function I need help with: function click () if guiGridListGetSelectedItem(teamGridlist) then local theRow, theCol = guiGridListGetSelectedItem(teamGridlist) local teamName = guiGridListGetItemText(teamGridlist, theRow, theCol) triggerServerEvent("chooseTeam", localPlayer, teamName) guiSetVisible(spawnWindow, false) showCursor(false) else outputChatBox("You have to choose a team before you press spawn", localPlayer, 220, 0, 0) end end addEventHandler("onClientGUIClick", spawnButton, click)
  9. Thank you, you´ve been very helpfull. I thought about using "for k, v in ipairs(getElementsByType("gui-window")) do", but I didn´t know if it was possible to use gui-window there. I didn´t have time to check on wiki ether. But thanks for helping me out (y)
  10. Oh, well that was easy. When I am scripting I am not thinking that it could be so easy. Now in retrospect, I understand that it ofcourse should be like this. Thank you.
  11. Hello, I want this to work so if I click on something in the world it should only trigger the event if the clicked object/element is a "player". Anc if the clicked player is me when I play it should set "aPlayer" as me, if I click on somone else then "aPlayer" should be set as that player. So if you can find the errors or what I should add then please help Bcs I can click on cars and players and the event will still trigger this is the part I need help with ( client side ). I can tell that the event will show a window with info about "aPlayer" that´s why I need no set "aPlayer" as the clicked element (player). function worldObject(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if ( clickedElement ) then local elementType = getElementType ( clickedElement ) if ( elementType ~= "localPlayer" ) then aPlayer = localPlayer elseif ( elementType ~= "source" ) then aPlayer = source end triggerEvent("showTheWindow", localPlayer, aPlayer) end end addEventHandler("onClientClick", getRootElement(), worldObject) I also want to ask if I can make it work when no guis are showing. Just an example so you understand, if ( not guiGetVisible(allGUI:s) ) then
  12. Thank you. Only that I forgot, lol. Anyway it works now.
  13. Hello, I have a script that will warn/kick the attacker when someone is killed. But one thing wont work, it should only work if the attacker and the player that is being killed is in the same team. I tried add that to the 3:d line but that don´t work. Anyone knows why? But it works with warning and then kick, but between everyone... Here is the script function theLastPiece( _, attacker) if ( getElementType ( attacker ) == "player" ) then if getPlayerTeam(attacker) == getPlayerTeam(source) then if getElementData(attacker, "Reported") then if ( getElementData(attacker, "Reported") == "1" ) then kickPlayer(attacker, "You have been kicked for deathmatching") outputChatBox(getPlayerName(attacker).." have been kicked for deathmatching, this is not acceptable. If you continue you will be kicked", root, 255, 0, 0) else setElementData(attacker, "Reported", getElementData(attacker, "Reported")+1) outputChatBox("You have been reported for deathmatching, this is not acceptable. If you continue you will be kicked", attacker, 255, 0, 0) end else setElementData(attacker, "Reported", "1") outputChatBox("You have been reported for deathmatching, this is not acceptable. If you continue you will be kicked", attacker, 255, 0, 0) end else return end end end addEventHandler("onPlayerWasted", getRootElement(), theLastPiece)