-
Posts
431 -
Joined
Everything posted by Al3grab
-
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 )
-
to add colums to the scoreboard use exports.scoreboard:scoreboardAddColumn("Column Name")
-
attach the "onPlayerLogin" event to the function : addEventHandler("onPlayerLogin",root,check)
-
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)
-
well, for camera you can use setCameraMatrix function to do that , and check this topic : viewtopic.php?f=91&t=38392
-
have you added it server-side ?
-
i re-uploaded the file : http://www.mediafire.com/?xg7ku238u22wf72 including - QtDesignerLite - QtToLua
-
function hud ( player , command ) showPlayerHudComponent ( player , "all", false ) outputChatBox ( "HUD bolo uspesne vypnute", player , 0, 255, 0 ) end addCommandHandler ( "hud", hud )
-
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)
-
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
-
That Works , Thanks <3
-
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 ?
-
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
-
function redirect() redirectPlayer(source, "178.33.90.184", tonumber(20002)) end addEventHandler("onPlayerJoin", root, redirect)
-
setTimer(start, 1000,1, player) you have to define who is player here
-
yes but setElementCollisionsEnabled is for both sides
-
for peds use -- Client-Side setElementCollidableWith for vehicles use -- Client/Server-Side setElementCollisionsEnabled
-
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
-
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)
-
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
-
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
-
you can remove all these resources and add <object name="resource.*"></object>
-
createPed createMarker "onMarkerHit"
-
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]
-
yes that what are we going to do , but there should be a solution for this problem in the next versions