Jump to content

Pirulax

Discord Moderators
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Pirulax

  1. Could you use /debugscript 3?I dont know whats the problem with it.
  2. Why would you create a car, and freeze it afterwards?
  3. Hello, @Dutchman101. Is it possible to add a link to the debugging tutorial? There are a lot of questions which could be solved just by reading it, and it would prevent a lot of questions that are related to some kind of syntax errors.
  4. @IIYAMA How should be this used?With dbPoll?
  5. Doesnt my example work? Yeah, actually it doesnt, since it doesnt matter where it put the things to be drawn in the queue, because it will be always drawn after GTA renders the world.
  6. local CHAT_RANGE = 100--> meters local function localChat(source, _, ...) if not (...) then return end local dm = getElementDimension(source) local msg = "(Local) "..(getPlayerName(source) or "Unknown")..": "..table.concat({...}, " ") local r, g, b = getPlayerNametagColor(source) local sourceDim = getElementDimension(source) local sourcePos = Vector3(getElementPosition(source)) for _, player in pairs(getElementsByType("player")) do if (getElementDimension(player)==sourceDim) then if (getDistanceBetweenPoints3D(sourcePos, getElementPosition(player))<=CHAT_RANGE) then --If hes in the same dimension as the source[player] outputChatBox(msg, player, r, g, b, true)--> It will output the msg to chatbox with colorcodes[So, if he types #10FFFF, then it will be a redish text.]. Set 'true' to 'false' to disable this. end end end end addCommandHandler("local", localChat, false, false) addCommandHandler("Local", localChat) @kowixd Use this instead please, i've forgot something.
  7. Whats the problem with it? Edit: fount it.Try this: addEventHandler("onClientPlayerJoin", localPlayer, function() local camPositions = { {-2816.0283203125, 2125.6923828125, 156.8657989502, -2720.1396484375, 1835.1181640625, 133.21673583984}, {-1145.0048828125, 879.6533203125, 9.1189212799072, -1357.7978515625, 719.6279296875, 14.321132659912}, {1135.3759765625, -1977.408203125, 78.517211914063, 1413.7529296875, -1617.5576171875, 63.588264465332}, {2160.0869140625, -102.408203125, 5.6070313453674, 1894.4580078125, -146.1396484375, 21.12876701355} } fadeCamera(source, true, 5) setCameraMatrix(source, unpack(camPositions[math.random(1, #camPositions)])) end) Only replace this on client-side.And it should work.
  8. What? I cant understand ur question.
  9. Why would't it be? Just set the right x, y, z positions.If you want it to be visible thru an object use 'onClientRender' event, if you dont want it to be, use 'onClientPreRender'. Why? See Game Processing Order.
  10. This should be client-side. addEventHandler("onClientPlayerJoin", localPlayer, function() local camPositions = { {-2816.0283203125, 2125.6923828125, 156.8657989502, -2720.1396484375, 1835.1181640625, 133.21673583984}, {-1145.0048828125, 879.6533203125, 9.1189212799072, -1357.7978515625, 719.6279296875, 14.321132659912}, {1135.3759765625, -1977.408203125, 78.517211914063, 1413.7529296875, -1617.5576171875, 63.588264465332}, {2160.0869140625, -102.408203125, 5.6070313453674, 1894.4580078125, -146.1396484375, 21.12876701355} } fadeCamera(source, true, 5) setCameraMatrix(source, camPositions[math.random(1, #camPositions)]) end) And this should be server-side. local randomSpawnTable = { { 270.92654418945, -1986.3665771484, 797.52966308594 }, { 270.92654418945, -1986.3665771484, 797.52966308594 }, { 270.92654418945, -1986.3665771484, 797.52966308594 } } local function randomSpawn(thePlayer) spawnPlayer(thePlayer, unpack(randomSpawnTable[math.random(1, #randomSpawnTable)])) setElementModel(thePlayer, 312) giveWeapon(thePlayer, 46) giveWeapon(thePlayer, 9) giveWeapon(thePlayer, 25, 5000, true) giveWeapon(thePlayer, 28, 5000, true) giveWeapon(thePlayer, 31, 5000, true) giveWeapon(thePlayer, 22, 5000, true) end local function restorePlayer(player) fadeCamera(player, true) setElementFrozen(source, true) setCameraTarget(player, source) randomSpawn(player) end addEventHandler("onPlayerJoin", root, function() fadeCamera(player, false, 1000, 0, 0, 0)--> Set the color you want, and the time you want(but i think you wanted it to be 1000ms) setElementFrozen(source, false) setTimer(restorePlayer, 950, 1, source)--> You should't create a new function every time the event is called, and the timer is set.set it to slightly less than the timer, since it may not be that accuret. end)
  11. I dont think so, im not an expert with such things, sorry. Consider dropping a like, if i helped you! Use code tags (<>) please. Use /debugscript 3, please. Thanks.
  12. My script is the better one, since it runs on client-side, and will hide every nametag.
  13. If you cant even implement a MySQL save for this, then i dont think, that u are the one who wrote this script.Mostly because of line 50, its a gm called SanMTA, which is a totally edited gm from ExternalGaming, and such gms, therefore i think this topic should be closed, since we do not provide help with stolen scripts. @Dutchman101
  14. @JagleW Hello, this will work until someone joins after the resource started.Use this code instead: addEventHandler ( "onResourceClienttart", resourceRoot, function() for _,player in ipairs (getElementsByType ("player")) do setPlayerNametagShowing (player, false) end end) Also, this is the worst code i've ever seen: Why? First of all: Why did you just put that 'players' into a variable? Why did you put the eventhandler on root?This will cause higher CPU usage, since the function will be called every time a resource starts. Its on server-side.
  15. So you want, to all players be able to hear the same song? Just create a WB for every player. Isnt a big thing.
  16. I know, but i just gave him tips, if he asks for help in the future.
  17. Its not that terrible, but its 'hours', and not 'hourse'. Use: setTimer() Set it to 60000[1min], and add a minute toPlayedMinute variable[U'll need to save this as an account data btw.], and then do you job.Use some if condition then end And thats it.
  18. Pirulax

    Shader

    Use the original fire's .txd from GTA, and model it onto an element, and use that element as fire, its very hard to create a fire with shader, and since, theres very little amount of ppl who knows how to use shader, i dont think that u will get answers.
  19. Consider dopping me a like at my comment(s) @kowixd
  20. Its much more complicated, than this script you pasted here. You may want to use you position, but you know what? Take a look at this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=12641
  21. Use code tags (<>) please. Use /debugscript 3, please. Thanks.
  22. Pirulax

    godmode

    Please paste in the 'togdamage' function.
×
×
  • Create New...