
Overkillz
Members-
Posts
545 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Overkillz
-
Hello dear community, I have a little question about triggers First of all, I won't use the function getEventHandlers() or the event onDebugMessage to cancell the event. Is there someway to avoid the typical message thats says: Server/Client triggered clientside/serverside EventName but event is not added if the script is not running. Im under an experimental script and I want to avoid such messages without having the resource running. Best regards.
-
As far as I know, you can use VM Workstation, install another O.S and install GTA:sA + MTA Im not sure if this is allowed, but is the unique way that worked for me some months ago. Regards.
-
Yes you can. You must probally use onResourceStart, getResourceName. Store the name of the resources (to start them by your code) in a list and add THAT RESOURCE you have to add on the previous list mentioned.
-
mtaserver.conf At the end of the file <resource src="admin" startup="1" protected="0" /> <resource src="defaultstats" startup="1" protected="0" /> <resource src="helpmanager" startup="1" protected="0" /> <resource src="joinquit" startup="1" protected="0" /> <resource src="mapcycler" startup="1" protected="0" /> <resource src="mapmanager" startup="1" protected="0" /> <resource src="parachute" startup="1" protected="0" /> <resource src="performancebrowser" startup="1" protected="0" /> <resource src="reload" startup="1" protected="0" /> <resource src="resourcebrowser" startup="1" protected="1" default="true" /> <resource src="resourcemanager" startup="1" protected="1" /> <resource src="scoreboard" startup="1" protected="0" /> ....
-
Try this: function setPlayerDimension(thePlayer, cmd, dimension) local dimensaoA = getElementDimension(thePlayer) local nomeJ = getPlayerName(thePlayer) if tonumber(dimension) then local dimensaoB = setElementDimension(thePlayer, dimension) if dimensaoB then outputChatBox(horaJ.. "Foste transferido da dimensão " ..corEspaco.. dimensaoA.. " para a dimensão " ..corEspaco.. tostring(dimension), thePlayer, isR, isG, isB, true) else outputChatBox("Erro") end end end addCommandHandler("dimension", setPlayerDimension)
-
Problem fixed. For a weird reason one of the scripts wan't restarting and the changes weren't being applied. Anyways thanks for ur help. It was a f**** mistake by me. Around a f**** day looking for the error but now it is solved. Thanks and regards.
-
It is function getMapSettings() triggerClientEvent(source,"ontestRegisterE",source) end addEvent("onRequestMapSettings",true) addEventHandler("onRequestMapSettings",root,getMapSettings) The script is triggered correctly when I use the following method but I won't use it due to I have other goals with it. function whateverFunctionName() outputChatBox("The Trigger Should work") end addEvent( "ontestRegisterE", true ) addEventHandler( "ontestRegisterE",getRootElement(), whateverFunctionName )
-
????? Am I using it ? Please, read the whole topic before answering.
-
Yes it is. This is how I run everything --## Lobby.lua function joinArena(arenaNo) if tonumber(arenaNo) == 1 then triggerServerEvent ( "onPlayerJoinArena", localPlayer, 1 ) end end bindKey("1","down",joinArena) --## Server.lua room[thisArena].joinArena = function (arenaNo) -- ## <-- room table and thisArena are defined if arenaNo ~= thisArena then return end triggerClientEvent(source, "onClientRoomJoin", source, thisArena) end addEvent("onServerRoomJoin",true) addEventHandler("onServerRoomJoin",getRootElement(),room[thisArena].joinArena) --## Client.lua function addingEvent() addEvent( "ontestRegisterE", true ) end addingEvent() function addingEventHandler() addEventHandler( "ontestRegisterE",getRootElement(), whateverFunctionName ) end function whateverFunctionName() outputChatBox("The Trigger Should work") end addEvent("onClientRoomJoin", true) addEventHandler("onClientRoomJoin", root, function(arenaNo) if arenaNo ~= thisArena then return end addingEventHandler() outputChatBox("Succesfully joined at the room ") end) -- ##TRIGGER FROM THE OTHER RESOURCE triggerClientEvent(source,"ontestRegisterE",source) And I said before. If I use the following method instead the previous one, the code works function whateverFunctionName() outputChatBox("The Trigger Should work") end addEvent( "ontestRegisterE", true ) addEventHandler( "ontestRegisterE",getRootElement(), whateverFunctionName ) I hope u can help me. Thanks. Regards.
-
dxDrawText() getPlayerAcls() onPlayerLogin() isObjectInACLGroup()
-
Hello dear community. Yesterday I've got an problem with the triggers that I really dont know why it is not working properly. When I try to do a trigger to the event: ontestRegisterE It doesn't execute the function: whateverFunctionName -- ##EVENTS PART function addingEvent() addEvent( "ontestRegisterE", true ) end addingEvent() function addingEventHandler() addEventHandler( "ontestRegisterE",getRootElement(), whateverFunctionName ) end -- ## FUNCTION PART function whateverFunctionName() outputChatBox("The Trigger Should work") end --## TRIGGER RECEIVED function triggerFromServer() outputDebugString("Trigger Received") addingEventHandler() end addEvent("onGetTriggerFromServer", true) addEventHandler("onGetTriggerFromServer", root, triggerFromServer) onGetTriggerFromServer is working correctly. I get the outputDebugString Message and it should start addingEventHandler() but when I try to do a trigger to ontestRegisterE it doesn't work. I don't want to do the following method function whateverFunctionName() outputChatBox("The Trigger Should work") end addEvent( "ontestRegisterE", true ) addEventHandler( "ontestRegisterE",getRootElement(), whateverFunctionName ) I hope you can help me, thanks. Regards.
-
Well, mybad. I have realized that this function has been updated. Previously there was the same function but made with dxDrawLines. It used to be a bit blurred but u could reach what are u looking for. Probabilly u will need to work with shaders or dxDrawImage/dxDrawImageSection
-
Read carefully the function. It allows you to leave the middle empty.
-
Just create more circles leaving some spaces between them ...
-
Well, but could I run just one of the functions by a trigger using the same name for the event ? Something like that. -- FOR ROOM 1 addEvent("onTestThisFunction",true) addEventHandler("onTestThisFunction",root,whateverFunctionName) -- Same event name FOR ROOM 2 addEvent("onTestThisFunction",true) addEventHandler("onTestThisFunction",root,whateverFunctionName) In case of no. which one would be the optimal way for it ? Thanks for ur help, regards.
-
You have to use shaders.
-
Well, according to your previous answer. Is there someway to execute the function for ROOM 1 (And not the ROOM 2) from an external resource without using a variable ? --## resourceName/room1/client.lua local function testFunction () --CODE end addEvent("onTestThisFunction",true) addEventHandler("onTestThisFunction",root,testFunction) --## resourceName/room2/client.lua -- <-- Now the folderRoom is the 2nd one (SAME Resource) local function testFunction () --CODE end addEvent("onTestThisFunction",true) addEventHandler("onTestThisFunction",root,testFunction) --## anotherResource/ -- triggerServerEvent ( "onTestThisFunction", localPlayer )
-
Well, but following this method I must to have all the rooms on the same file. I want to have them on different files but in the same resource. And I have another question. How can I call some of these functions from another resource without adding a custom event, exports and without using callClientFunction/callServerFunction ? Thanks for your help. I know I can sound so annoying but I would like to learn more about this. Regards.
-
What do you mean with table methods ? Something like this ? Room = {} function Room.Join() --Something Here end function Room.Leave() --Something Here end function Room.Start() --Something Here end --.....
-
Hello dear community. Today I wanted to create a multi room script. However, I have realized that might could be an easy way to make something similar like copy and paste to use almost the whole code as template but on different files. (ON THE SAME RESOURCE BUT DIFFERENT FILES) Here goes my question. Could I run the function from one file just changing a VARIABLE VALUE?. I would like that you explain me whats the best way to reach and optimize result without using different names for functions, events ..etc The code is going to be so long, thats why I wont to start yet. NOTE: The script looks the same 2 times due to I just change the variable 'currentArena'. Read it carefully please. --### guiResourceName/ --CIENT function joinArena(ID) if tonumber(ID) == 1 then triggerServerEvent ( "onPlayerJoinServerRoom", localPlayer, 1 ) elseif tonumber(ID) == 2 then triggerServerEvent ( "onPlayerLeaveServerRoom", localPlayer, 1 ) elseif tonumber(ID) == 3 then triggerServerEvent ( "onPlayerJoinServerRoom", localPlayer, 2 ) elseif tonumber(ID) == 4 then triggerServerEvent ( "onPlayerLeaveServerRoom", localPlayer, 2 ) end end bindKey("1","down",joinArena) bindKey("2","down",joinArena) bindKey("3","down",joinArena) bindKey("4","down",joinArena) -- ### roomResource/room1/ -> CLIENT & SERVER --CLIENT local currentArena = 1 local arenaList = {} function loadEvents() addEvent( "onEventTest", true ) end loadEvents() function removeHandlers() removeEventHandler( "onEventTest", getRootElement(), listEventTest) end addEvent("onPlayerJoinRoom", true) addEventHandler("onPlayerJoinRoom", root, function(ArenaNo) if ArenaNo == currentArena then outputChatBox("Succesfully joined at arena: "..currentArena) loadHandlers() end end) addEvent("onPlayerLeaveRoom", true) addEventHandler("onPlayerLeaveRoom", root, function(ArenaNo) if ArenaNo == ArenaNo then outputChatBox("Succesfully left arena: "..currentArena) removeHandlers() end end) function listEventTest(tableListTest) if tableListTest and type(tableListTest) == "table" then arenaList = tableListTest end end --SERVER local currentArena = 1 local srvArenaTable = {} local roomRunning = false function updateRoomResources() srvArenaTable = {} local resourceTable = getResources() for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceName(resourceValue) table.insert(srvArenaTable,{resourceName = name}) end end function updateRoomOnStart() updateRoomResources() outputChatBox("Updating Resource list for arena: "..currentArena) end addEventHandler("onResourceStart",resourceRoot,updateArenaonStart) function joinServerRoom(ArenaNo) if ArenaNo == currentArena then triggerClientEvent(source, "onPlayerJoinRoom", source, currentArena) loadArena() end end addEvent("onPlayerJoinServerRoom",true) addEventHandler("onPlayerJoinServerRoom",getRootElement(),joinServerRoom) function leaveServerRoom(ArenaNo) if ArenaNo == currentArena then triggerClientEvent(source,"onPlayerLeaveRoom",source, currentArena) end end addEvent("onPlayerLeaveServerRoom",true) addEventHandler("onPlayerLeaveServerRoom",getRootElement(),leaveServerRoom) function loadArena() if not roomRunning then startRoomApps() end end function startRoomApps() outputChatBox("Apps should be running for room: "currentArena) end -- ### roomResource/room2/ -> CLIENT & SERVER --CLIENT local currentArena = 2 -- <---- THIS CHANGES local arenaList = {} function loadEvents() addEvent( "onEventTest", true ) end loadEvents() function removeHandlers() removeEventHandler( "onEventTest", getRootElement(), listEventTest) end addEvent("onPlayerJoinRoom", true) addEventHandler("onPlayerJoinRoom", root, function(ArenaNo) if ArenaNo == currentArena then outputChatBox("Succesfully joined at arena: "..currentArena) loadHandlers() end end) addEvent("onPlayerLeaveRoom", true) addEventHandler("onPlayerLeaveRoom", root, function(ArenaNo) if ArenaNo == ArenaNo then outputChatBox("Succesfully left arena: "..currentArena) removeHandlers() end end) function listEventTest(tableListTest) if tableListTest and type(tableListTest) == "table" then arenaList = tableListTest end end --SERVER local currentArena = 2 -- <---- THIS CHANGES local srvArenaTable = {} local roomRunning = false function updateRoomResources() srvArenaTable = {} local resourceTable = getResources() for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceName(resourceValue) table.insert(srvArenaTable,{resourceName = name}) end end function updateRoomOnStart() updateRoomResources() outputChatBox("Updating Resource list for arena: "..currentArena) end addEventHandler("onResourceStart",resourceRoot,updateArenaonStart) function joinServerRoom(ArenaNo) if ArenaNo == currentArena then triggerClientEvent(source, "onPlayerJoinRoom", source, currentArena) loadArena() end end addEvent("onPlayerJoinServerRoom",true) addEventHandler("onPlayerJoinServerRoom",getRootElement(),joinServerRoom) function leaveServerRoom(ArenaNo) if ArenaNo == currentArena then triggerClientEvent(source,"onPlayerLeaveRoom",source, currentArena) end end addEvent("onPlayerLeaveServerRoom",true) addEventHandler("onPlayerLeaveServerRoom",getRootElement(),leaveServerRoom) function loadArena() if not roomRunning then startRoomApps() end end function startRoomApps() outputChatBox("Apps should be running for room: "currentArena) end
-
I had the same issue. Does someone know why is this currently happening ? Im not feeling pretty well having this temporal fix. Regards.
-
as far as I know, you can set a property in meta.xml <file src="fileName.TXD/DFF" download="false" /> Well, if you update/create another system to compile the file without requesting to change it a password each time u can keep the file on the client cache and it cant be used in other servers and I think thats your goal.
-
You need to create your own fileRead system to compile the TXD / DFF files with teaEncode and base64encode I guess. It is the best choice imo. Regards.
-
Well, I think I have found the problem. I guess I haven't got any issue the whole time. Why ? I thought that killing the timer and setting the variable as nil it would dissapear from the table, but, no, it still there with the name: userdata*x*****. Im still not understading why it doesn't dissapear from the table setting the variable as nil. Anyways, thanks for the help, if someone could argument why it doesn't dissapear would be great. Regards.