Jump to content

AeroXbird

Members
  • Posts

    359
  • Joined

  • Last visited

Everything posted by AeroXbird

  1. That kind of resource wont even cause a little dent of lag. You will start to notice lag when restarting your resources when you have large files and 50.000+ lines of code.
  2. This is correct. All code will be loaded in the memory, this is done because RAM is about 30x faster then your average HDD. Also this is the reason why you have to restart a resource to load in new scripts The images and stuff also load in memory, but only for clients.
  3. This will only induce more rage with the kids, they will be able to use words like that to insult others all the time.
  4. I prefer MySQL over SQLITE just because of its flexability, you can simply move your MySQL Database all around whenever you want, and there's not too much hassle.. SQLite is handy if you want to save data real quick, but i really recommend MySQL as it's simply superior in flexibility and usability... ( imo ofcourse )
  5. AeroXbird

    how to

    Look for the resource called "Traffic" in the default resources pack that is included with MTA, or you can get it off of googlecode mtasa-resources..
  6. Just like Anderl said, its very easy. Just read what it says. so if it says: expected end at line 26. you do what it says, and you simply add an end at line 26. all you have to do is think with common sense, and scripting is a breeze.
  7. local GUIWindow local playerGridView local playerColumn --stat labels local GUILabelMoney2 local GUILabelPoints2 local GUILabelMatches2 local GUILabelFirst2 local GUILabelSecond2 local GUILabelThird2 local GUILabelKills2 function createGUIWindow(test) local width, height = guiGetScreenSize () local windowW,windowH = 700,350 --Main Window sizes local windowX = (width/2) - (windowW/2) --Main Window horizontal position local windowY = (height/2) - (windowH/2) --Main Window vertical position --Window GUIWindow = guiCreateWindow (windowX, windowY, windowW, windowH, "Player Information Screen", false) --Tabpanel local GUITabPanel = guiCreateTabPanel ( 0 ,0.1, windowW, windowH, true, GUIWindow ) local GUITabStatistics = guiCreateTab ( "Statistics", GUITabPanel ) --Labels local GUILabelPlayerName = guiCreateLabel(0.02,0.06,0.94,0.2,"[PLAYER] his stats:",true,GUITabStatistics) local GUILabelMoney = guiCreateLabel(0.02,0.11,0.94,0.2,"Money:",true,GUITabStatistics) GUILabelMoney2 = guiCreateLabel(0.09,0.11,0.94,0.2,"",true,GUITabStatistics) local GUILabelPoints = guiCreateLabel(0.02,0.16,0.94,0.2,"Points:",true,GUITabStatistics) GUILabelPoints2 = guiCreateLabel(0.09,0.16,0.94,0.2,"",true,GUITabStatistics) local GUILabelPlayTime = guiCreateLabel(0.35,0.11,0.94,0.2,"Playtime:",true,GUITabStatistics) local GUILabelMatches = guiCreateLabel(0.02,0.30,0.94,0.2,"Mathes played:",true,GUITabStatistics) GUILabelMatches2 = guiCreateLabel(0.15,0.30,0.94,0.2,"",true,GUITabStatistics) local GUILabelFirst = guiCreateLabel(0.02,0.35,0.94,0.2,"1st Place:",true,GUITabStatistics) GUILabelFirst2 = guiCreateLabel(0.11,0.35,0.94,0.2,"",true,GUITabStatistics) local GUILabelSecond = guiCreateLabel(0.02,0.40,0.94,0.2,"2nd Place:",true,GUITabStatistics) GUILabelSecond2 = guiCreateLabel(0.11,0.40,0.94,0.2,"",true,GUITabStatistics) local GUILabelThird = guiCreateLabel(0.02,0.45,0.94,0.2,"3rd Place:",true,GUITabStatistics) GUILabelThird2 = guiCreateLabel(0.11,0.45,0.94,0.2,"",true,GUITabStatistics) local GUILabelKills = guiCreateLabel(0.02,0.50,0.94,0.2,"Kills:",true,GUITabStatistics) GUILabelKills2 = guiCreateLabel(0.075,0.50,0.94,0.2,"",true,GUITabStatistics) --Gridview playerGridView = guiCreateGridList ( 0.60, 0.10, 0.35, 0.85, true, GUITabStatistics ) --Create a players column in the list playerColumn = guiGridListAddColumn( playerGridView, "Player", 0.85 ) triggerEvent ( "refreshGridView", getRootElement() ) triggerServerEvent("getallstats", getRootElement(), getLocalPlayer()) --Set label colors: guiLabelSetColor ( GUILabelPlayerName, 255, 0, 0 ) --Set all label fonts: guiSetFont ( GUILabelPlayerName, "default-bold-small" ) guiSetFont ( GUILabelMoney, "default-bold-small" ) guiSetFont ( GUILabelPoints, "default-bold-small" ) guiSetFont ( GUILabelMatches, "default-bold-small" ) guiSetFont ( GUILabelFirst, "default-bold-small" ) guiSetFont ( GUILabelSecond, "default-bold-small" ) guiSetFont ( GUILabelThird, "default-bold-small" ) guiSetFont ( GUILabelPlayTime, "default-bold-small" ) guiSetFont ( GUILabelKills, "default-bold-small" ) addEventHandler ( "onClientGUIClick", playerGridView, updateStats, false ) guiSetVisible(GUIWindow, false) end addEventHandler("onClientResourceStart", getRootElement(),createGUIWindow) ------------------------------------------------------------------------------------------------------------ addEvent("refreshGridView", true) function refreshPlayerGrid() guiGridListClear ( playerGridView ) --clear gridview if ( playerColumn ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerGridView ) guiGridListSetItemText ( playerGridView, row, playerColumn, getPlayerName ( player ), false, false ) end end end addEventHandler("refreshGridView", getRootElement(), refreshPlayerGrid) addEventHandler ( "onClientPlayerChangeNick", getRootElement(), refreshPlayerGrid) ------------------------------------------------------------------------------------------------------------ function showWindow(thePlayer) -- function for trigger if (guiGetVisible(GUIWindow) == true) then -- if window opened then guiSetVisible (GUIWindow,false ) -- close window showCursor(false) --disable cursor guiSetInputEnabled(false) --disable input focus else guiSetVisible (GUIWindow,true )-- enable --//-- showCursor(true) -- enable --//-- guiSetInputEnabled(true) --enable --//-- --trigger all stats event triggerServerEvent("getallstats",getRootElement(),thePlayer) end end addEvent( "showWdw", true ) addEventHandler( "showWdw", getRootElement(), showWindow ) ------------------------------------------------------------------------------------------------------------ function showStats(money, points, matches, first, second, third, kills) guiSetText ( GUILabelMoney2, money ) guiSetText ( GUILabelPoints2, points ) guiSetText ( GUILabelMatches2, matches ) guiSetText ( GUILabelFirst2, first ) guiSetText ( GUILabelSecond2, second ) guiSetText ( GUILabelThird2, third ) guiSetText ( GUILabelKills2, kills ) end addEvent( "showStats", true ) addEventHandler( "showStats", getRootElement(), showStats ) ------------------------------------------------------------------------------------------------------------ function updateStats() local playerName = guiGridListGetItemText ( playerGridView, guiGridListGetSelectedItem ( playerGridView ), 1 ) if(playerName ~= false and playerName ~= nil and playerName ~= "") then triggerServerEvent("getallstats",getRootElement(),getPlayerFromName(playerName)) end end ------------------------------------------------------------------------------------------------------------ You forgot to enter an arugment for getallstats, but you did require one on your serverside.
  8. What karthik said is a fairly common method to use. for example, you have a small dx rectangle, and it starts at x 6 and ends at x 13 then you simply do this: if ( x >= 6 and x <= 13 ) then and simply add the same for the y value, it will make a reasonably large if, but it will do the job perfectly without having to use any eventhandlers. ( other than onClientRender ofcourse )
  9. Today i'm going to show you how to debug your code, this is very helpful for both you, and the people who might help you in the scripting forum. for example: function peeps() if ( getElementType(source) == "player" ) then outputChatBox(getPlayerName(source), source) end end Is wrong and does not function, its a very simple example but shows how to debug your code effeciently. Now how do we get to work. We start off by checking if we actually pass our if check, like so: function peeps() if ( getElementType(source) == "player" ) then outputChatBox(getPlayerName(source), source) outputDebugString("We passed our check!",3) end end If we passed the check, it will show the message 'We passed our check!' in the debug log. Let's say it didn't. function peeps() outputDebugString(tostring(getElementType(source))) if ( getElementType(source) == "player" ) then outputChatBox(getPlayerName(source), source) outputDebugString("We passed our check!",3) end end We make sure that what we try to check for, is actually correct. In this example we're going to assume that source is nil. Now we know that source is not the player, say that this function is called by a command handler If we check the MTASA Wiki, we see that a commandhandler returns a playersource, which is what we need. function peeps(thePlayer) outputDebugString(tostring(getElementType(thePlayer))) if ( getElementType(thePlayer) == "player" ) then outputChatBox(getPlayerName(thePlayer), thePlayer) outputDebugString("We passed our check!",3) end end now we just replace all the source variables that we thought was the player with the variable thePlayer. and our script should function properly.. now we get things tidy: function peeps(thePlayer) if ( getElementType(thePlayer) == "player" ) then outputChatBox(getPlayerName(thePlayer), thePlayer) end end And that rounds up my small, but effective tutorial. I hope that this informs you a bit about how you can easily debug your code yourself, without help from anybody. All you need is to think wisely, and think with common sense. Usually the mistake is something very easy, or something you never imagined could be the issue
  10. Jay what you are doing is making everybody that is not in the group Default not able to call this command. What you need to do is use <right name="function.setVehicleColor" access="true" /> where you want the function to be usable. and use <right name="function.setVehicleColor" access="false" /> where you dont want it to be usable. then make sure all the ACL rights are correct ofcourse
  11. Try this: function anything( player, commandName ) if not isPedInVehicle ( player ) then -- checks if the player is already in a vehicle local color = {} -- table of random colors local color[1] = math.random(1,126) -- color 1 local color[2] = math.random(0,126) -- color 2 local color[3] = math.random(0,126) -- color 3 local color[4] = math.random(0,126) -- color 4 local sX, sY, sZ = getElementPosition ( player ) -- gets the player's position local blade = createVehicle ( 536, sX, sY, sZ ) -- create a vehicle "536" you can change it whatever you like warpPedIntoVehicle ( player, blade ) -- warp him into the car setVehicleColor ( blade, color[1], color[2], color[3], color[4] ) -- sets the vehicle random colors outputChatBox("Blade has been spawned",player,255,255,0, true) -- outPutChatBox that blade has been spawned setVehicleDamageProof ( blade, true ) -- sets the car infinity health else outputChatBox("You can not spawn a vehicle when you already in one",player,255,0,0, true) end end addCommandHandler ( "spawnblade", anything )-- add the command handler which the player will type you had one end too much, and using local variables is usually the best way to go.
  12. All i made this thread for is to see if others agree with me, i know that it is very hard to fix something like this, i'm merely interested in seeing who agrees with me.
  13. As everybody here knows MTA is growing exponentially, which is good for MTA. But on the other hand it is tearing MTA apart. We've become a lot larger than we were 1 - 2 years ago, and that has affected the community in a very bad way in my opinion. 2 years ago the community was a place for an MTA player to go to and get help whenever they needed it, and they could discuss MTA in general and such. It was a pleasant place to be, and the people were always nice, discussions were always according to the rules, and people respected eachother. Over the past 2 years that however, has drastically changed. Right now the MTA community is not very nice anymore, all you get is people swearing and shouting at one another. The respect that one had for another member is fading away, and is almost completely gone in my opinion. After MTA released version 1.0.0 things went downwards, more people from SA-MP started playing MTA, which in general is not a bad thing at all. But the types of people that started playing MTA are the root cause of how the community changed. Most of the people that came from SA-MP, were teenager from 10 - 16 years of age, now playing a game as GTA on that age is no problem at all in my perspective. But the language that they use is turning the MTA community into a pure source of hatred and flame. The average grammar of users has dropped by a lot as well, mostly because the people who joined are bad at the english language. I'm not implying that this cannot be fixed, I used to have terrible grammar too, but thanks to the people of this community I managed to teach myself English very well. The coming of all these new people has made MTA a lot larger, and that's been a blast for servers aswell. But as everybody has certainly noticed, is that theft of scripts and pointing fingers has become normal these days. Servers shutting down over a small argument and what not, it's the attitude of these 10 - 16 y/o's that has changed this community so much. I used to be a regular user to the forums, but because of the attitude that more and more people are having against eachother, it's simply no longer pleasant to have nice discussions about things. Ofcourse there are a lot of nice people left in the community, and they are what keeps this community from breaking down into a full flame forum. I'm very dissapointed of what the community has become, but i believe that there was no real way to stop it anyway. People may find me to be a nagger, and a grumpy person, but i don't want MTA to end up like SA-MP, it would be a total shame for the communtiy and everyone who helped making MTA what it is today. I hope that i'm not the only one that is concerned about this, it's a very worrying matter after all.
  14. Or attempt to finish my roleplay project, it's not even near completion, but worth a look. viewtopic.php?f=108&t=37086
  15. I cant believe people still give attention to that attentionwhore. His DDoS actions are worthless, he's a powerless noob that just wants a penis enlargement. Dont worry if he threatens you, he's pretty much harmless, scriptkiddies are everywhere and they are inevitable.
  16. let's get back on topic, and read the f*cking first post, i TOLD you guys not to make this a thread about one server god dammit.
  17. TheNightRider try typing this while in the folder of your mta installation: "chmod +x mta-server" and then "./mta-server" that should work.
  18. Let's all put our big e-penis back in our zipper shall we? I appreciate that your trying to help but all that happens is a flamewar. All i made this topic for mr ben_wright, is to show people of the pending danger. Like Oz said this is happening everywhere... And i am certainly NOT perfect and neither are you ben. So lets stop bashing eachother to make yourself look better, it has absolutely NO use.
  19. i lol'd hard look at what mta has become....
  20. Dev it might be an edit of vG, but it still one of the largest edits of vG around today. especially because the core is more stable than the original vG sapphire was.
  21. Intel HD will run just about 15 - 25 FPS at low settings. Intel HD is good for browsing but when it comes to gaming it is utter sh*te
  22. It sounds reasonable and all, but does MTA seriously need another RPG server? Perhaps a radical and unique gamemode would freshen your spirit? Just my 2 cents.
×
×
  • Create New...