Jump to content

Scooby

MTA Contributors
  • Posts

    976
  • Joined

  • Last visited

Everything posted by Scooby

  1. Scooby

    ACL help

    At a glance, lines 2 to 13 are duplicated.
  2. Scooby

    Intro maker?

    Its possible to make, u would need to script it... i suppose u could create an element, attach a plane to it, make the element move from a to b then just set the players cam to view it for the duration. if u wanted a border around it u could overlay an image of it... its all possible but nothing is ready made.
  3. sure, u already have ur functions server side for ghostmode on/off which uses element data, but it needs changing to synch client side, just remove the 'false' ( or if this is done this way for some unseen reason u can add another element data line) anyway, u have the code needed server side, just edit the 'setElementData' lines in the on/off functions function gmon(player) for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData( thePlayer, "overrideCollide.uniqueblah", 0 ) outputChatBox("GM enabled",thePlayer,186,212,71,true) end end function gmoff(player) for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData(thePlayer, "overrideCollide.uniqueblah", nil ) outputChatBox("GM disabled",thePlayer,255,255,255,true) end end then clientside: this will check element data and if it exists it will show the image: local screenWidth,screenHeight = guiGetScreenSize() function showGhostModeImage() local ghostModeOn = getElementData(getLocalPlayer(),"overrideCollide.uniqueblah") if ghostModeOn then dxDrawImage (screenWidth/2 - 65, 0, 165, 65, "gm_on.png", 0, 0, -120 ) end end addEventHandler ( "onClientRender", root, showGhostModeImage) i havent tested it so let me know if u still need more help.
  4. just for something simple like 1 small image, u could use element data, even more so since u set it in ur function. u have: 'setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false )' if u use 'true' (or leave blank) its synched clientside. then in onClientRender u can check if the elementData exists or == 0, and if so, show the image. u have all the code and lines needed, so i think u can manage without the trigger for just 1 thing.
  5. i suppose u could get some ideas from cdm (classic deathmatch) resource which comes with mta. however if ur not a scripter u might want to learn the basics first.
  6. 'return true' should be at the bottom of function assemblePlayersByID()
  7. i tested the script and got no errors... it worked fine, although i had to blank out the exports line. did u change anything else?
  8. if u made the change like i said, then it would have fixed the error. The reason ur scoreboard isnt showing is coz u need to add 'return true' at the bottom of that function because in the function 'drawPlayerList()' which is called when u press 'tab', u do: local done = assemblePlayersByID( ) if ( done ) then so its waiting for the variable 'done' to be true.
  9. maybe just add some outputs to debug to see whats happening... at least u should be able to find where its getting to and then fix whats wrong.
  10. at a glance, shouldnt line 44 be: if ( array == nil ) ?
  11. u should use [ /lua ] tags so its easier for us to read. (rather than [ /code ]) at a glance ur line 1 is missing the () from 'function createKeypad' remember to use /debugscript 3 when debugging, it could save u a lot of time
  12. Scooby

    Question.

    Set it server side
  13. Thanks guys^^ Just a followup on this really in case anyone else has a similar problem, it seems all i could put it down to was the download of 4 vehicle skins at once was too much. (40mb approx) i split it into 4 individual scripts (1 script per vehicle skin) and the files download fine now. maybe this is just an issue for those with slow internet speeds or something but all is working now with it as individual scripts.
  14. ah sorry, my bad, a couple of errors.. this will work. client: local fishTank = createMarker(-205.8, -573.3, 1, "cylinder", 260, 255, 0, 0, 150) function markerHit(player,dim) if player == getLocalPlayer() and dim then outputChatBox ("You can /fish here.",0,255, 0) end end addEventHandler ( "onClientMarkerHit", fishTank, markerHit ) addEvent("goFishing", true) function goFish() if isElementWithinMarker (source,fishTank) then triggerServerEvent ("castOutput", source) else outputChatBox ("You cant /fish here!",255, 0, 0) end end addEventHandler("goFishing", root, goFish) server: function startFishing(player) if not exports.global:hasItem(player, 49) then outputChatBox("You need a rod to fish.", player, 255, 0, 0) else triggerClientEvent(player, "goFishing", player) end end addCommandHandler("fish", startFishing) addEvent("castOutput",true) function playerCastOut() outputChatBox("You Cast Out......",source,0,255,0) end addEventHandler("castOutput",root,playerCastOut)
  15. not really sure what ur asking for here...but.. if u want to just display it using colours, when not use them as parameters in ur function? something like this for your 1st msg servertalkprivate("MESSAGE1", source, msg_red, msg_green, msg_blue) then use this for your 2nd msg servertalkprivate("MESSAGE1", source, msg2_red, msg2_green, msg2_blue) then in ur function: function servertalkprivate(message, sendto, r, g, b) use the rgb's u send and the text will be outputted in the colours u want.
  16. Hi, thats quite a mess, try this: client: local fishTank = createMarker(-205.8, -573.3, 1, "cylinder", 260, 255, 0, 0, 150) addEventHandler ( "onClientMarkerHit", fishTank, markerHit ) function markerHit(player) if player == getLocalPlayer() then outputChatBox ("You can /fish here.",0,255, 0) end end addEvent("goFishing", true) function goFish() if isElementWithinMarker (source,fishTank) then triggerServerEvent ("castOutput", source) else outputChatBox ("You cant /fish here!",255, 0, 0) end end addEventHandler("goFishing", root, goFish) server: function startFishing(player) if not exports.global:hasItem(player, 49) then outputChatBox("You need a rod to fish.", player, 255, 0, 0) else triggerClientEvent(player, "goFishing", player) end end addCommandHandler("fish", startFishing) addEvent("castOutput",true) function playerCastOut() outputChatBox("You Cast Out......",source,0,255,0) end addEventHandler("castOutput",root,playerCastOut) its kinda late here so i dont have time to test it... sorry, let me know how it turns out or if u get errors and if so what they are with /debugscript 3
  17. for something simple u could use ur setTimer method but store the timer on the players IP or serial. just start the timer when they use the command, it will remain till 6hrs has passed. playerTimer = {} -- create a table with the active timers in playerTimer[playersIP] = setTimer(removeTimerInfo,21600000,1,playersIP) -- store the ip or serial when they use the command function removeTimerInfo(ip) -- function to remove the table info when the timer is up. playerTimer[ip] = nil end unless u mean u want it to work for 6hrs in real life time, but only count when the player is in game... then ignore this
  18. try this: local loopedTimer = nil function startLoopTimer(player,cmd) if isTimer(loopedTimer) then outputChatBox("Error - Timer already Active!",player,255,0,0) else loopedTimer = setTimer(twentyfourhours,86400000,0) outputChatBox("24hr timer started",root,255,0,0) end end addCommandHandler("startLoop",startLoopTimer) function twentyfourhours() outputChatBox("24hour loop timer restarted",root,255,0,0) end function stopLoopTimer(player,cmd) if isTimer(loopedTimer) then killTimer(loopedTimer) end end addCommandHandler("stopLoop",stopLoopTimer) this will start and run endlessly outputting every 24hrs of course the 24hrs start when u start it, not at 00:00
  19. You will get errors if u didnt add a function on start to set the players timers to 0 just add a simple loop like this: function startGameTimer() for k,v in ipairs(getElementsByType("player")) do time[v] = 0 end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), startGameTimer) also i see u changed the 'Score' to 'TimeAlive' so make sure u update the variable name If u still get errors, post ur error msgs from debug along with the relevant lines in the script so we can help u fix it.
  20. Scooby

    HELP-ME !!

    so u want that while theyre using the drug they cant die? try this: function stopDamage ( attacker, weapon, bodypart ) if isDrugActive then cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage )
  21. keep ur pocket change.... local time = {} local timerInc = setTimer(incTimes,1000,0) local scoreboardName = "score" -- not sure what ur scoreboard column name is.. function playerSpawned() time[source] = 0 end addEventHandler("onPlayerSpawn",root,playerSpawned) function incTimes() for k,v in ipairs(getElementsByType("player")) do time[v] = time[v] + 1000 setElementData(v,scoreboardName,tostring(time[v] / 600)) if time[v] > 300000 then killTimer(timerInc) payPlayers(v) --if u dont want people to draw, u will need to break the loop here end end end function playerQuit() time[source] = nil end addEventHandler("onPlayerQuit",root,playerQuit) function payPlayers(winner) givePlayerMoney(winner,22000) outputChatBox(getPlayerName(winner) .. " Wins $22000!!!",root,0,255,0) for k,v in ipairs(getElementsByType("player")) do if v ~= winner then givePlayerMoney(winner,500) end end startNewMap() end function startNewMap() -- i dont use race resource so... add what u need here to start a new map end this should get u started... i dont use race resource so i dont know how u normally start new maps... i'll let u figure that part out, also i dont know if u already have the scoreboard column already added.. u didnt say sorry i dont have time to test this script... ive just woke up and have to go to work soon. post any errors and im sure i or someone else can help u out. probably best not to insult people again with ur pocket change.
  22. Try this: local miniadminbase = createMarker(-1749, -3030, 53.6, 'cylinder', 1.5, 255, 0, 0, 150) function duty(element, matchingDimension) if getElementType(element) == "player" and matchingDimension then -- if the element is a player in the same dimension if not isPedInVehicle(element) then -- if the player is not in a vehicle setElementPosition (element, 0, 0, 5 ) -- move the player to coords end end end addEventHandler("onMarkerHit",miniadminbase,duty)
×
×
  • Create New...