Jump to content

Gr0x

Members
  • Posts

    109
  • Joined

  • Last visited

Everything posted by Gr0x

  1. No problem. You need to send the player element who joined the game as the first argument to the other function too, so it knows which player should be spawned, that's why it didnt work.
  2. count = 0 takenColShapes = {} for _,v in ipairs(getElementsByType('vehicle')) do for i=1, 5 do if isElementWithinColShape(v, cuboid[i]) then takenColShapes[i] = v count = count+1 end end end for i = 1,#takenColShapes do if takenColShapes[i] then outputChatBox(i .. " is taken by " .. getVehicleName(takenColShapes[i])) else outputChatBox(i .. " is free") end end outputChatBox(count) (Nevermind, this is wrong.)
  3. If you click those functions, you can find examples. Noone is going to write a full code for you here
  4. Pass the player argument too. setTimer(JoinHandler,1000,1,source)
  5. function revivePlayer(player) if player then if isElement(player) then spawnPlayer(player, x, y, z) setCameraTarget(player, player) fadeCamera(player, true) outputChatBox("You have been killed, a fee of $100 has been deducted from your account.", player) setPlayerMoney(player, (getPlayerMoney(player) - 100)) return end end if source then setTimer(revivePlayer,3000,1,source) end end addEventHandler("onPlayerWasted", root, revivePlayer) Kind of an ugly workaround, no idea why the timer in the previous comments are not working. Try this one
  6. guiSetVisible Use the wiki. For example, you can find client functions (Including the GUI ones) here. https://wiki.multitheftauto.com/wiki/Cl ... _Functions
  7. otherPlayer is a player element, not a string
  8. They might use the command 'refreshall' or maybe even 'refresh' when that happens. Or just simply run a server-sided code which takes a lot of time. (Like I've seen on DayZ servers about ~2 years ago)
  9. I guess you are trying to set the health of your own player. Change the first argument from player to localPlayer like this. setElementHealth(localPlayer, 100)
  10. Gr0x

    Account Data

    I'm going to assume that you set the "Team" data as a string for the team name. Try this. local Team = getTeamFromName(getAccountData (acc, "Team")) setPlayerTeam (source, Team)
  11. dxDrawText(string.format("$%05.0f",getPlayerMoney( localPlayer )),nW - 450,nH - 500,nW - 7,nH - 57,tocolor( 0,255,0,220 ),nW/500,'pricedown','right','top', false, false, false)
  12. Gr0x

    Marker problem

    Just simply check if the source of your onMarkerHit event is (one of the) the marker(s) you created. Example: transportMarker = createMarker(0,0,5,"cylinder",5) function onHitEvent(hitElement,matchingDimension) if matchingDimension then if source == transportMarker then -- Your code. end end end addEventHandler("onMarkerHit",root,onHitEvent) You can also do it like this i guess. (I'm not sure about this one though, I always use the upper one.) transportMarker = createMarker(0,0,5,"cylinder",5) function onHitEvent(hitElement,matchingDimension) if matchingDimension then -- Your code end end addEventHandler("onMarkerHit",transportMarker,onHitEvent)
  13. I made an example with the onClientRender event. There might be an easier way to do this, but this is what came into my mind. Untested. value = 0 des = false function onRender() value = value + (des and -1 or 1) if value >= 20 or value <= 0 then des = not des end end addEventHandler("onClientRender",root,onRender)
  14. It was boring to make these shades to cover the ugly stuff one by one, so i decided to make a little resource to handle it. Images: http://imgur.com/m2Rexdn http://imgur.com/4JHCHiO http://imgur.com/bkVtckT Video: Usage: - Start the resource - Press Shift + G - Select the options you want - Close the gui (By pressing Shift + G again) - Press F to enable your cursor - Select an object (Only the 3 "bigger" shades are supported) - Press the defined key (Default: G) - The shades are created. Note: I made it for myself, so I didn't plan to release it since the code is pretty bad, but some of my friends asked me to do so. I used Arezu's rotation functions from AMT to make it work, thanks for that. If you find a bug, just leave a comment. Download: https://community.multitheftauto.com/in ... s&id=11680
  15. You should use these functions. If you need an example (I wrote an unfinished dxgui which contains an editbox too), just send me a message. dxDrawRectangle dxDrawText onClientCharacter / onClientKey
  16. What do you want exactly? There are everything you need to display the images in that "code".
  17. Yeah, that was kind of an usual mistake. No problem.
  18. Gr0x

    MTA dir

    What do you mean exactly? This? HKEY_CURRENT_USER\Software\Multi Theft Auto: San Andreas 1.4 Here you can find a "Last Run Path".
  19. You have to provide a string, such as the player's name there, not the player element itself. function tagPlayer (player, command) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Supporter" ) ) then outputChatBox( "Supporter " .. getPlayerName(player) .. " is available for help ", root, 255, 171, 1) end addCommandHandler( "helpsup", tagPlayer )
  20. Gr0x

    Help scripting

    "vehicle.txd" /> "vehicle.dff" />
  21. Gr0x

    Siren related

    Try to use getVehicleSirensOn
  22. Why would you loop through all teams? function deleteTeam(teamName) if getTeamFromName(teamName) then destroyElement(getTeamFromName(teamName)) end end
  23. Gr0x

    SOLVED

    Doesn't it say any error about line 126? I'm not sure about that one. Have a look at the log and check it please.
  24. Gr0x

    SOLVED

    Then you failed something, show me your code.
×
×
  • Create New...