-
Posts
6,089 -
Joined
-
Last visited
-
Days Won
216
Everything posted by IIYAMA
-
https://wiki.multitheftauto.com/wiki/AddCommandHandler
-
blip createBlipAttachedTo ( element elementToAttachTo, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, int ordering=0, float visibleDistance=99999.0, visibleTo = getRootElement()] ) The last argument is about the visibility from the blip, I can fill in 1 element or the root. Is it possible to fill in more elements(players)? https://wiki.multitheftauto.com/wiki/Cr ... AttachedTo support tables?
-
De volgorden moet zo: en niet: De meta moet in de eerste folder/zip zitten.
-
[Removed]
-
het geluid van het spel is gta. Zelf gemaakte geluiden gaan via een anderen channel.
-
YES! thx guys.
-
Now I get again two differed answers from two experienced posters........... (not me "Experienced"...) If I delete the element that is handled and after that I handle again, there won't be any errors. Is the handler gone from the previous element? grrrr I hate it when I can't see what happens.....
-
Windows geluidsinstellingen? Als goed is word mta geluid gesplitst van gta en mta.
-
yes, it should be jailedPlayer. Here fixed. local runningTimers = {} function jailPlayer( player, cmd, target, ttime ) if isPlayerAdmin ( player ) then jailedPlayer = getPlayerFromName ( target ) if jailedPlayer then if getElementData ( jailedPlayer, "jailed" ) == false then if isPedInVehicle ( jailedPlayer ) then removePedFromVehicle ( jailedPlayer ) end local jx, jy, jz = unpack(jailcells[math.random(#jailcells)]) setElementDimension ( jailedPlayer, 60601 ) setElementInterior ( jailedPlayer, 12 ) setElementPosition ( jailedPlayer, jx, jy, jz ) setElementData ( jailedPlayer, "jailed", true ) if not runningTimers[jailedPlayer] then runningTimers[jailedPlayer] = {} end local newTabPos = #runningTimers[jailedPlayer] +1 runningTimers[jailedPlayer][newTabPos] = setTimer ( function (newTabPos,jailedPlayer) runningTimers[jailedPlayer][newTabPos] = nil setElementData ( jailedPlayer, "jailed", false ) setElementDimension ( jailedPlayer, 0 ) setElementInterior ( jailedPlayer, 0 ) setElementPosition ( jailedPlayer, 2492.408, 2773.22, 10.80 ) end,1000,1,newTabPos,jailedPlayer) else outputChatBox ( "This Player is already jailed!", player, 255, 0, 0 ) end else outputChatBox ( "Player does not exist!", player, 255, 0, 0 ) end end end addCommandHandler ( "jail", jailPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() if runningTimers[source] then if next(runningTimers[source]) then for i,timer in pairs(runningTimers[source]) do if isTimer(timer) then killTimer(timer) end end end runningTimers[source] = nil end end) There are many ways to Rome. If I let somebody else, script this. It probably will look differed. I like to build my timers in to a table core, so I can easily manage them. With manage I mean: stop them when they should be stopped. With this you can add more timers in to the same system. When somebody leaves the server, all timers that have been managed will be killed before executing. local runningTimers = {} function timerset() local newTabPos = #runningTimers[myPlayer] +1 runningTimers[myPlayer][newTabPos] = setTimer ( function (newTabPos,myPlayer) runningTimers[myPlayer][newTabPos] = nil end,30000,1,newTabPos,myPlayer) end addEventHandler ( "onPlayerQuit", getRootElement(), function() if runningTimers[source] then if next(runningTimers[source]) then for i,timer in pairs(runningTimers[source]) do if isTimer(timer) then killTimer(timer) end end end runningTimers[source] = nil end end)
-
Thank you! That was a fast answer
-
local confirmButton = guiCreateButton(5, 5, 90, 70, "SPAWN!", false, spawnConfirmWindow) addEventHandler("onClientGUIClick", confirmButton, spawnClientPlayer) destroyElement(confirmButton) Will the handler still be there?
-
Als goed is heb je settings voor. Esc > settings > audio: Voice volume
-
ok, my bad.
-
Note: You already have a index. No need to re-index "[1]=", Only when you use keys or value's like this: local pedCoords = {["hey"]=-1, ["hey2"]=0, [1]=10, [2]=99, [3]=100, [4]=400} local pedCoords = { {280.59, -139.83, 1004.06,7,1}, {280.7, -135.64, 1004.06,7,1}, {284.45, -131.24, 1004.06,7,1}, {288.15, -134.05, 1004.06,7,1}, {290.01, -135.76, 1004.06,7,1}, {285.16, -137.9, 1004.06,7,1}, {279.2, -139.89, 1004.06,7,1}, {276.01, -135.35, 1004.06,7,1}, {278.4, -129.79, 1004.06,7,1}, {283.1, -130.99, 1004.06,7,1}, {289.98, -128.18, 1004.06,7,1}, {295.72, -129.21, 1004.06,7,1} }
-
I think that will be type() if type(value) =="table" then -- not sure if table is also a type, but yes I think it is. elseif type(value) =="string" then elseif type(value) =="number" then end But hex becomes a number....... or you should first convert it to a string. tostring() tonumber()
-
local runningTimers = {} function jailPlayer( player, cmd, target, ttime ) if isPlayerAdmin ( player ) then jailedPlayer = getPlayerFromName ( target ) if jailedPlayer then if getElementData ( jailedPlayer, "jailed" ) == false then if isPedInVehicle ( jailedPlayer ) then removePedFromVehicle ( jailedPlayer ) end local jx, jy, jz = unpack(jailcells[math.random(#jailcells)]) setElementDimension ( jailedPlayer, 60601 ) setElementInterior ( jailedPlayer, 12 ) setElementPosition ( jailedPlayer, jx, jy, jz ) setElementData ( jailedPlayer, "jailed", true ) if not runningTimers[jailedPlayer] then runningTimers[jailedPlayer] = {} end local newTabPos = #runningTimers[jailedPlayer] +1 runningTimers[player][newTabPos] = setTimer ( function (newTabPos,jailedPlayer) runningTimers[player][newTabPos] = nil setElementData ( jailedPlayer, "jailed", false ) setElementDimension ( jailedPlayer, 0 ) setElementInterior ( jailedPlayer, 0 ) setElementPosition ( jailedPlayer, 2492.408, 2773.22, 10.80 ) end,1000,1,newTabPos,jailedPlayer) else outputChatBox ( "This Player is already jailed!", player, 255, 0, 0 ) end else outputChatBox ( "Player does not exist!", player, 255, 0, 0 ) end end end addCommandHandler ( "jail", jailPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() if runningTimers[source] then if next(runningTimers[source]) then for i,timer in pairs(runningTimers[source]) do if isTimer(timer) then killTimer(timer) end end end runningTimers[source] = nil end end) and no I haven't test anything, there may some mistakes/bugs, but I don't have much time. Killing timers before executing will safe you some power. This system is only efficient when you use more then 1 timer.
-
Don't forget to check after the timer ends, if the player is an element else you will have warnings when he leaves before the timer ends. isElement() --- or as you said, put the timer in a table with the player user data as key. +argument timer location. When he leaves you can stop the timer easily. [player] ={timer,timer,timer} There are many possibility's.
-
Also about reconnect: If you reconnect, then you will download the server information from the location from the element. If the element do have sync_interval (ped/player vehicle) you will download the last element position. https://wiki.multitheftauto.com/wiki/Se ... Streamable SetElementStreamable, will only be managed at client side. Note sync_interval, you can disable it by using: (this is server side) https://wiki.multitheftauto.com/wiki/SetElementSyncer
-
If you set Element position of yourself, it will be synced for other players, but not directly. player_sync_interval 100ms Default update time. The time before this will be updated after the "setElementPosition" is between 1 t/m 100 milliseconds. https://wiki.multitheftauto.com/wiki/Sy ... l_settings When you set the position of another player, he will be updated back to his old position, unless he isn't streamed. With this you can control that: https://wiki.multitheftauto.com/wiki/Se ... Streamable
-
Note: When you hit every marker, this will be executed. The best way to solve this is by using special element id's. setElementID (element,"TOWmarker")-- when you create the marker. if getElementID(element)=="TOWmarker" then -- on marker hit
-
Vehicle user data should be there. (just the vehicle) Returns the vehicle(the wagon) behind it or false. https://wiki.multitheftauto.com/wiki/GetElementModel local model1 = getElementModel ( vehicle1 ) if towVehicles[model1] then --or if towVehicles[getElementModel ( vehicle1 )] then It works for sure.
-
Het is belangrijk dat de gamemode de bots kan exporteren. Sommige gamemodes hebben deze functies en anderen niet. Dat staat er als goed is bij. Ik denk dat je dat maar moet onderzoeken welke het wel en niet kan. https://community.multitheftauto.com/in ... =resources
-
jep, alles is mogelijk.
-
Zou kunnen, Alleen dan moet je een edf maken, want voor freeroam is er nog geen edf.
-
ok Is there any way to fix or prevent it from bugging?
