Jump to content

Al3grab

Members
  • Posts

    431
  • Joined

Everything posted by Al3grab

  1. yes its possible using triggerServerEvent Example : -- Client-Side local myped = createPed(46,0,0,3) triggerServerEvent("giveWeaponToMyPed",myped,myped) --++ Server Side ++-- addEvent("giveWeaponToMyPed",true) addEventHandler("giveWeaponToMyPed",root,function(thePed) giveWeapon(thePed,31) end )
  2. to add colums to the scoreboard use exports.scoreboard:scoreboardAddColumn("Column Name")
  3. attach the "onPlayerLogin" event to the function : addEventHandler("onPlayerLogin",root,check)
  4. local streamURL = "http://www.true.nl/streams/slamfmlivestream.pls" local radius = 150 local volume = 1.0 local s = false function radio3d() if s then stopSound(sound) s = false return end s = true local x, y, z = getElementPosition(localPlayer) local sound = playSound3D(streamURL, x, y, z, true) setSoundVolume(sound , volume) setSoundMaxDistance(sound , radius) end addCommandHandler("staffradio", radio3d)
  5. well, for camera you can use setCameraMatrix function to do that , and check this topic : viewtopic.php?f=91&t=38392
  6. have you added it server-side ?
  7. i re-uploaded the file : http://www.mediafire.com/?xg7ku238u22wf72 including - QtDesignerLite - QtToLua
  8. function hud ( player , command ) showPlayerHudComponent ( player , "all", false ) outputChatBox ( "HUD bolo uspesne vypnute", player , 0, 255, 0 ) end addCommandHandler ( "hud", hud )
  9. ok thx , in your code you made it set the player total time to 0 every time , this will work : exports.scoreboard:addScoreboardColumn('Time') function updateTimePlayed() setTimer(updateTimePlayed,1000,1) for index, player in ipairs(getElementsByType("player")) do local totalTime = getElementData(player,"totalTime") if not totalTime then setElementData(player,"totalTime",0) end setElementData(player,"totalTime",totalTime+1) setElementData(player,"Time",math.floor(tonumber(totalTime)/60).." Mins") end end setTimer(updateTimePlayed,1000,1)
  10. exports.scoreboard:addScoreboardColumn('Time') addEventHandler("onPlayerJoin",root, function() setElementData(source,"totalTime",0) checkTimer = setTimer ( function ( source ) if isElement(source) then local totalTime = getElementData(source,"totalTime") setElementData(source,"totalTime",totalTime+1) setElementData(source,"Time",math.floor(tonumber(totalTime)/60).." Mins") end end , 1000 , 0 , source ) end ) addEventHandler("onPlayerQuit",root,function() if isTimer(checkTimer) then killTimer(checkTimer) end end ) this should solve the warnings
  11. Hi , i want to Extract a number from a string example : i have "arena 20" string , i need a way to make a function that returns "20" only . any help ?
  12. recording time is easy , like this : exports.scoreboard:addScoreboardColumn('Time') addEventHandler("onPlayerJoin",root,function() setElementData(source,"totalTime",0) setTimer ( function ( source ) local totalTime = getElementData(source,"totalTime") setElementData(source,"totalTime",totalTime+1) setElementData(source,"Time",math.floor(tonumber(totalTime)/60).." Mins") end , 1000 , 0 , source ) end ) don't forget to reconnect while testing the code =D
  13. function redirect() redirectPlayer(source, "178.33.90.184", tonumber(20002)) end addEventHandler("onPlayerJoin", root, redirect)
  14. setTimer(start, 1000,1, player) you have to define who is player here
  15. Al3grab

    GhostMode

    yes but setElementCollisionsEnabled is for both sides
  16. Al3grab

    GhostMode

    for peds use -- Client-Side setElementCollidableWith for vehicles use -- Client/Server-Side setElementCollisionsEnabled
  17. Al3grab

    Changing Nick Spam !

    Thanks but the problem has been solved now , using the code i posted yes they were spamming using the /nick command, they was binding many keys with nick command to change the nick so they cant spam from settings
  18. you use this function to check if player downloading isTransferBoxActive Like this -- Client Side local localPlayer = getLocalPlayer() function checkIfDown() if isTransferBoxActive() == false then triggerServerEvent( "onClientSend",localPlayer ) -- trigger to remove text if player downloaded if isTimer(Timer) then killTimer(Timer) end -- kills the checking timer end end Timer = setTimer(checkIfDown,1000,0)
  19. Al3grab

    Changing Nick Spam !

    we made a temporary solution for now , addEventHandler("onPlayerChangeNick",root, function() cancelEvent() end ) the code cancel changing nick via command /nick , so you will be able to change it only from settings or admin panel
  20. Al3grab

    Functions.

    But that defeats the purpose of ACL.. You might as well do user.* and it's as good as deleted giving all resources admin rights wont make a problem , because you are the one who installing the resources so you must be sure about what you are installing =D
  21. Al3grab

    Functions.

    you can remove all these resources and add <object name="resource.*"></object>
  22. createPed createMarker "onMarkerHit"
  23. function CommandFunction ( Player , Command ) -- First you make the command function , including command parameters (player and command) outputChatBox(getPlayerName(Player),Player) -- your code goes here , this code outputs the player name to the chat box and only the player who entered the command will see it , notice the code is SERVER-SIDE end addCommandHandler("MyCommand",CommandFunction) -- then you add the Command Handler , and MyCommand will be the command you are handling , and CommandFunction is the function to handle with command , for more information enter the wiki : [url=https://wiki.multitheftauto.com/wiki/Scripting_Introduction#Creating_a_simple_command]https://wiki.multitheftauto.com/wiki/Scr ... le_command[/url]
  24. Al3grab

    Changing Nick Spam !

    yes that what are we going to do , but there should be a solution for this problem in the next versions
×
×
  • Create New...