-
Posts
44 -
Joined
-
Last visited
Everything posted by NeO_DUFFMAN
-
You can actually simplify your code by using one line statements. Anyway, check if the group element data of the founder matches the player's group data or not. Add the following line in your code: if group == getElementData(playerName, "safr.Group") then --your code else -- your message end I actually wanted to rewrite your function in a more simplified form but since I'm trying to make this post with my pathetically annoying blackberry, I doubt ill be able to lol. * Also, don't know why you're defining gorup.
-
Can you paste your code (Only parts that are relevant to your problem) ? I need to know how your system works.
-
Well, doesn't this seem right ? addEvent("setArenaProperties",true) addEventHandler("setArenaProperties",root, function() local g_Me = getLocalPlayer() if ( getElementData(g_Me,"Arena" ) == "Freeroam" ) then setSkyGradient(60, 100, 196, 136, 170, 212) setPedCanBeKnockedOffBike(g_Me, true) setWeather(0) resetRainLevel() elseif ( getElementData(g_Me,"Arena" ) == "Stuntage" ) then setPedCanBeKnockedOffBike(g_Me, false) resetSkyGradient() setWeather(0) resetRainLevel() elseif ( getElementData(g_Me,"Arena" ) == "DayZ" ) then showPlayerHudComponent("crosshair",true) showPlayerHudComponent("radar",true) setWeather(8) setRainLevel(0) resetSkyGradient setPedCanBeKnockedOffBike(g_Me, true) end end)
-
Are you sure you only want one message to stay on screen and then disappear after 3 seconds? I would suggest you to use a table and add an offset value ( Preferably y ) for the messages along with setTimer to remove the previous message(s) after a certain period of time. This way you will be able to see more than one message at a time. I can paste a sample code and help you in this regard if need be.
-
Alternatively, you can either use onClientPlayerJoin or onClientResourceStart.
-
Like i said, others might have a different perspective. I find it pretty complex. Perhaps cause i have a different method of dealing with something like this. But honestly, i guess segregating the different gamemodes among the players and creating a simple system to manage and handle all these gamemodes definitely seems like a better alternative. Wish, someone would have brought this topic up a month back lol.
-
Knowing the events and functions is not enough to create such a complex script. Infact, you need to create a lot of your own custom events and functions. I'm speaking from personal experience. Others might have a different perspective.
-
Like manev1 said, you're using relatively high integers. Try changing the values to the following: x = 0.614 * screenWidth y = 0.200 * screenHeight width = 0.791 * screenWidth height = 0.518 * screenHeight Basically, the values used for multiplication can't be higher than 1. For instance, if your screen resolution is 1366x768 and if you multiply 614 with 1366 and 200 with 768, you're bound to get impractical values which can be rectified if you use values less than one. Edit: I just realised that you can see the text without using screenWidth and screenHeight. Seems like you skipped the part where you first have to divide the values. Refer to the last section of this wiki page: https://wiki.multitheftauto.com/wiki/GuiGetScreenSize
-
As far as I know, you can't resize the default mta radar. But you could try searching for such a radar on the community site. I guess I do remember seeing one that was square shaped.
-
Good job pain. A very useful resource indeed. But it would be great if you could probably add dx elements in your future update. I am currently using one but honestly my code looks quite messy though it works fine.
-
Hi there Fractional! Well do you have any experience with Lua? I don't mind working with someone.
-
Yes, loadNumberData is defined. Well, these aren't even my issues lol.
-
Bump! I really need some guidance here
-
The correct syntax for "xmlLoadFile" is xmlnode xmlLoadFile ( string filePath ) I think what you're trying to do is this: addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), function () local file = xmlLoadFile ("warps.xml") local node = xmlFindChild(file,"warps",0) local houseroot = xmlFindChild (node,"warp",0) for k,v in ipairs (xmlNodeGetChildren(houseroot))do local x = xmlNodeGetAttribute ( v, "Name" ) outputChatBox ( x ) end end )
-
Here's the thing, I'm a member of a server which already has an irc channel for MTA. One of our members who was in charge of managing and handling all the scripts had stepped down. So i'm not sure how our irc bot works. Anyway, I had been working on some new additions for the server. Some of these additions include messages that have to be broadcasted on our irc channel since they are admin-related messages. Getting back to the problem, i think i will have to call these functions from my resource right ? I've just attached a sample code! Tell me if i'm doing this right addEventHandler ("onPlayerChat",getRootElement(), function(message,type) if (string.find(message,"@warnings")) and not (string.find(message," @warnings")) then local W_Number = loadNumberData (source) if (tonumber(W_Number) == 0) then setTimer(outputChatBox,50,1," #E9F006" .. getPlayerName (source) .. " #06F0DDhas #E9F006zero #06F0DDwarnings!",getRootElement(),255,0,0,true) call(getResourceFromName("irc"),"outputIRC",getPlayerName(source).." has zero warnings") end end end
-
I basically want to display certain script related messages on an irc channel. Initially, i had tried testing with outputIRC sadly i couldn't make it work. Btw, sorry for being so unclear.
-
Hello MTA'ers! Since my problem is pretty straightforward, I'm hoping to get a quick and simple reply lol. Anyway, my problem is with displaying messages on Irc! How can I do this ? I desperately need a solution for this.