Jump to content

Schlammy

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by Schlammy

  1. not legal: decompile it. legal: buy it.
  2. Schlammy

    doubt

    scripting with editor epic ^^ the most of lua scripters using Notepad ++
  3. wie kann man denn "ein" MTA "weg" machen? MTA ist der Mod für GTA SA Verantwortlich ist der, der die resource auf den Server lädt.
  4. ???? What yu mean? Line 1: hello line 2: what line 3: up now you wanna change line 2 or what you mean?
  5. Interiors just from 0 to 255 valid "interior: The interior you want to set the element to. Valid values are 0 to 255. " change 999 to 255
  6. i would create the gui when the player join and then hide it with guiSetVisible. With the command you can hide or show it using guiSetVisible
  7. if you want to save it save you have to use two or more serverside tables exampel like element data playerVarTable[source]["elementdataname"] = "new Value"
  8. And for your script: function teleportarPlayer ( source, posX, posY, posZ ) getPlayerFromName ( source ) getElementPosition ( source ) setElementPosition ( source, posX, posY, posZ ) end addCommandHandler ( "goto", teleportarPlayer ) source is not able to use it as paramater. change source -> theplayer or else. player (element) = getPlayerFromName(thePlayer or else) you get a player you can use but thePlayer or else is already a player which use the command. x,y,z = getElementPosition(thePlayer or else) you`ll get the position of the player but not needed here. setElementPosition(thePlayer or else, tonumber(posX), tonumber(posY), tonumber(posZ)) tonumber() becouse you give a string ( a text ) and text is not a Integer
  9. you get the ip of the player and then you locate him Take a look at the admin panekl i think its using this technic
  10. elementdata of player "choosenLanguage" = "global" and then with commandhandler change and with bind at l output text to all players where elementdata "choosenLanguage" == the same of the player who write the text Privat chatsystem which works fine
  11. then use my script wheres the problem?
  12. bindKey ( source, "H","down","command") ???
  13. else you could reset the nameplayertagtext with a function but i dont know if it will work with your scripts you made which change the nametag text try this nameTag = {} function nameTag:resourceStart() setTimer(function() nameTag:resetAll() end, 500, 0) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), nameTag:resourceStart) function nameTag:resetAll() for _,player in ipairs(getElementsByType("player")) do local tempPlayerName = getPlayerName(player) local tempPlayerNametagText = getPlayerNametagText(player) if not (tempPlayerName == tempPlayerNametagText) then -- for performance setPlayerNametagText(player, tempPlayerName) end end end -- Not tested at all pleas debug my faults
  14. do not use getPlayerName if you edit the nametag text with setPlayerNametagText. Use https://wiki.multitheftauto.com/wiki/Ge ... ametagText
  15. number = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} numbers = number [ math.random ( #number ) ] function randomnum outputChatBox ( " The random number is ".. numbers ..". " ) end addCommandHandler ( "callrandom", randomnum ) This will not work correctly. try this. function randomnum(player) local numbers = tostring(math.random(1,100)) outputChatBox ( " The random number is ".. numbers ..". ", player ) end addCommandHandler ( "callrandom", randomnum)
  16. begin with a simple function to output something in the chatbox Don`t start with 100% it will help you trust me
  17. i dont see any function called "Window"
  18. local circlearea = createColCircle ( 0, 0, 10 ) function ColShapeHit ( hitElement, matchingDimension ) local detection = isElementWithinColShape ( hitElement, circlearea ) if (detection and (getElementType(hitElement) == "vehicle")) then setVehicleEngineState (hitElement, false) end end addEventHandler("onColShapeHit", circlearea, ColShapeHit) It will not work with Command handler becouse the parameters are hitElement and the dimension. CommandHandler givs player, commandname and rest. And a Player is not a vehicle. Use onColShapeHit or make 2 functions: local circlearea = createColCircle ( 0, 0, 10 ) function ColShapeHit ( hitElement, matchingDimension ) local detection = isElementWithinColShape ( hitElement, circlearea ) if (detection and (getElementType(hitElement) == "vehicle")) then setVehicleEngineState (hitElement, false) end end addEventHandler("onColShapeHit", circlearea, ColShapeHit) function triggerEventColShapeHit(player) local pVeh = getPedOccupiedVehicle ( player ) local curDimen = getElementDimension(player) if (pVeh and curDimen) then triggerEvent("onColShapeHit", player, pVeh, curDimen) else outputChatBox("Vehicle not found! Enter a vehicle", player, 255, 0, 0) end end addCommandHandler("tColshape", triggerEventColShapeHit) Not tested at all but after debugging it should work like this
  19. Using Table Try this (but debug first i made it in 2 Minutes without checking for bugs or else) -- Pleas add [TiLex Produkt] as commentary to your script while using this addEvent("onPlayerHealthChange", true) local playerOldHealthTable = {} function healthChangedTriggerFunction() setTimer(function() local playerTable = getElementsByType("player") for index, player in ipairs(playerTable) do local oldLive = playerOldHealthTable[player] if oldLive and (oldLive > 0) then local curLive = getElementHealth(player) if not (curLive == oldLive) then local changedlive = 0 if (curLive > oldLive) then changedlive = (curLive - oldLive) else changedlive = (oldLive - curLive) end triggerEvent ( "onPlayerHealthChange", player, player, curLive, oldLive, changedlive) -- trigger Event playerOldHealthTable[player] = curLive end else playerOldHealthTable[player] = (getElementHealth(player)) end end end, 500, 0) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), healthChangedTriggerFunction) -- EXAMPEL FUNKTION FOR EVENT function healthChanged(player, newHealth, oldHealth, changedLive) -- Live changed. Here some stuff outputChatBox("Your Live had changed from " ..tostring(oldHealth).. " to " ..tostring(newHealth)), player, 255, 0, 0) end addEventHandler("onPlayerHealthChange", getRootElement(), healthChanged) EventName: onPlayerHealthChange Parameters: element Player, int newhealth, int oldHealth, int howManyHealthChanged [sERVERSIDE]
  20. first you need to learn sql bevore using it! --> sqlzoo.net <--
  21. Don`t forget @DakiLLa: he also had the same answer just with variables
  22. function startingHandler ( ) outputChatBox ( "Test Start", getRootElement(), 255, 255, 255, true ) startResource(getResourceFromName( "skin2" )) stopResource(getResourceFromName( "skin1" )) end addEvent( "onStarting", true ) addEventHandler( "onStarting", getRootElement(), startingHandler ) function stopingHandler ( ) outputChatBox ( "Test Stop", getRootElement(), 255, 255, 255, true ) startResource(getResourceFromName( "skin1" )) stopResource(getResourceFromName( "skin2" )) end addEvent( "onStoping", true ) addEventHandler( "onStoping", getRootElement(), stopingHandler )
×
×
  • Create New...