Jump to content

Agon

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by Agon

  1. Is it possible to add new anims (or change) into our mta servers? Or will it be possible? It could be awesome if it was added because a lot of players (one of them is me ) want to use that parkour anims, climbing anims or falling anims.
  2. Type start interiors in console. Or in game: /start interiors
  3. Agon

    VC and III

    Oh thanks i'll have a look
  4. Agon

    VC and III

    Are there still players and servers on MTA:VC and MTA:III ? I just never played them online before and i want to play at least once
  5. resource="blabla" /> you should add this to the meta.xml wiki.multitheftauto.com/wiki/Meta.xml
  6. What's your gamemode resource's name? It must be blabla. Because you get blabla resource in your map file
  7. Agon

    About Tables

    oh thank you. I forgot to add the ped to the function
  8. Agon

    About Tables

    gives error again... and the script changes setPedFrozen to setElementFrozen automatically.
  9. Agon

    About Tables

    oh my fault i thought the script was client side btw it says bad argument @setPedFrozen and setPedAnimation..
  10. I think some files just have xmls (without .lua files) and some of the resources have only server or client side. it will be perfect if you check them and i can't reach some of the resources
  11. Agon

    About Tables

    I get no errors, no output messages, no drugs. what's wrong with this script? local numbers ={'1','2','3','4','5'} local myPlayer = getLocalPlayer() local drugPickupBlip = createBlip ( -1145, -1134, 130, 46, 1, 0, 0, 0, 255, 0, 99999.0 ) local drugPickup = createMarker( -1145, -1134 ,129, "cylinder", 1, 0, 0, 0, 255 ) local drugMarkerBlip = createBlip ( -2179, 715.5, 53, 24, 1, 0, 0, 0, 255, 0, 99999.0 ) local drugMarker = createMarker( -2180, 715.5, 53, "cylinder", 1, 255, 0, 0, 170 ) local drugSeller = createPed( 29, -2177, 715.5, 55, 90 ) function drugSellerAnim() setElementFrozen(drugSeller, true) setPedAnimation(drugSeller, "cop_ambient", "Coplook_loop",-1,true,false,false) end setTimer(drugSellerAnim, 1000, 1) function drugSellerImmortal ( attacker ) cancelEvent() end addEventHandler( "onClientPedDamage", getRootElement(), drugSellerImmortal ) function giveNumber(myPlayer) local account = getPlayerAccount(myPlayer) local rand = numbers[math.random(#numbers)] if (rand == '1') then setAccountData(account, "myPlayer", 'One') outputChatBox("You have found 10 weeds. Go and sell them to a drug seller!", myPlayer, 255, 0, 0, true) elseif (rand == '2') then setAccountData(account, "myPlayer", 'Two') outputChatBox("You have found 20 weeds. Go and sell them to a drug seller!", myPlayer, 255, 0, 0, true) elseif (rand == '3') then setAccountData(account, "myPlayer", 'Three') outputChatBox("You have found 30 weeds. Go and sell them to a drug seller!", myPlayer, 255, 0, 0, true) elseif (rand == '4') then setAccountData(account, "myPlayer", 'Four') outputChatBox("You have found 40 weeds. Go and sell them to a drug seller!", myPlayer, 255, 0, 0, true) elseif (rand == '5') then setAccountData(account, "myPlayer", 'Five') outputChatBox("You have found 50 weeds. Go and sell them to a drug seller!", myPlayer, 255, 0, 0, true) end end addEventHandler("onMarkerHit", drugPickup, giveNumber) function giveMySalary(myPlayer) local account = getPlayerAccount(myPlayer) if (getAccountData(account,"myPlayer") == "One") then giveMoney(myPlayer, 100) setAccountData(account, "myPlayer", 'Zero') outputChatBox("There is just 1 drug. Here is your money. Don't forget, more drugs, more money!", myPlayer, 255, 0, 0, true) elseif (getAccountData(account,"myPlayer") == "Two") then giveMoney(myPlayer, 150) setAccountData(account, "myPlayer", 'Zero') outputChatBox("There are 2 drugs. Here is your money. Don't forget, more drugs, more money!", myPlayer, 255, 0, 0, true) elseif (getAccountData(account,"myPlayer") == "Three") then giveMoney(myPlayer, 200) setAccountData(account, "myPlayer", 'Zero') outputChatBox("There are 3 drugs. Here is your money. Don't forget, more drugs, more money!", myPlayer, 255, 0, 0, true) elseif (getAccountData(account,"myPlayer") == "Four") then giveMoney(myPlayer, 250) setAccountData(account, "myPlayer", 'Zero') outputChatBox("There are 4 drugs. Here is your money. Don't forget, more drugs, more money!", myPlayer, 255, 0, 0, true) elseif (getAccountData(account,"myPlayer") == "Five") then giveMoney(myPlayer, 300) setAccountData(account, "myPlayer", 'Zero') outputChatBox("There are 5 drugs. Here is your money. Don't forget, more drugs, more money!", myPlayer, 255, 0, 0, true) elseif (getAccountData(account,"myPlayer") == "Zero") then outputChatBox("It seems you don't have any weed on you. Go and find some.", myPlayer, 255, 0, 0, true) end end addEventHandler("onMarkerHit", drugMarker, giveMySalary)
  12. Agon

    About Tables

    I want to create all the pickups. For example i have 2 pickups one of them is on chiliad, and the other is in groove street. The player wont be able to see the pickup on the chiliad until he gets the pickup in the groove street with your code. And the players will have to search all the san andreas map everytime.
  13. Agon

    About Tables

    Thanks anyway. Your second answer will help me but still want an easy way to question 1
  14. Agon

    About Tables

    Oh thank you guys. Two more questions. 1) for example i have 20 pickups (for another script). When i get one pickup, i want to remove it. Should i use table again? Because making 20 functions is so difficult... 2) i want to give 10000 $ if the player get all the pickups. Should i use setAccountData? I mean i can make it if the player get first pickup, set his account data "player.first". But you know players can find the pickups randomly. So if player finds last pickup as a chance, it will get 10000$ and i dont want it to happen. He should get all the pickups. What should i do then? Just give me some tips or examples..
  15. Agon

    About Tables

    Hi. i want to give player random numbers from the table i prepared. How to do it? I know i should use math.random but how? math.random(v) ? And second question is; is [if getAccountData(source) == "player.one" then] true? If it isn't is there a way to do it? Hope you understand me numbers ={'1';'2';'3';'4';'5';} local pickup = createPickup(0,0,5, pickupid) local marker = createMarker ( 2, 0, 5, "cylinder", 1, 255, 0, 0, 170 ) local account = getPlayerAccount(source) function giveNumber(source) for i,v in pairs(number) do -- give random numbers code here i think. After that (you can see the script below) the script will check which number was given to the player. If the number is 1, it will give 10 $ for example. if v == '1' then setAccountData(account, "player.one", playerone) elseif v == '2' then setAccountData(account, "player.two", playertwo) blah blah addEventHandler("onPickupHit", pickup, giveNumber) function giveMySalary(source) if (getAccountData(account) == "player.one") then giveMoney(source, 10) elseif (getAccountData(account) == "player.two") then giveMoney(source, 20) blah blah blah addEventHandler("onMarkerHit", marker, giveMySalary)
  16. Agon

    adding XML Files

    ok thank you guys (again)
  17. Agon

    adding XML Files

    Thank you it works and last thing when i click close it closes but cursor is still there, i press f9 again and click close again, cursor disappears. how can i fix it? addEventHandler("onClientGUIClick",root, function () if (source == closeButton) then guiSetVisible(helpWindow,not guiGetVisible(helpWindow)) showCursor(not isCursorShowing()) end end )
  18. Agon

    adding XML Files

    i know. i made <rules> some test rules </rules> but didn't work and this is the thingy you want local node = xmlFindChild( file, "rules", 0 ) right?
  19. Agon

    adding XML Files

    ok it appears but when i click an item it says bad argument @ xmlNodeGetValue and it types "false" instead of my things in my .xml files
  20. Agon

    adding XML Files

    ok made it and changed this <script src="newhelp.lua" type="server"/> to this <script src="newhelp.lua" type="client"/> lol idk why i made it server. but still can't see the gui. the gui doesn't appear with /help or F9. and no error in debugscript 3
  21. Agon

    adding XML Files

    CLIENT local myFiles = { ["Destruction Zones"] = "destruction.xml", ["Environment"] = "env.xml", ["Ferris Wheel"] = "ferris.xml", ["HeadQuarters"] = "hq.xml", ["Horseshoe Mission"] = "horseshoe.xml", ["Shops"] = "shops.xml", ["Skins"] = "skins.xml", ["UFO"] = "ufo.xml", ["Vehicles"] = "veh.xml", ["Weapons"] = "weap.xml", ["Weed Mission"] = "weed.xml", } function myHelpList() helpWindow = guiCreateWindow(0.1768,0.2188,0.6475,0.6641,"Help Window",true) guiSetAlpha(helpWindow,1) guiWindowSetSizable(helpWindow,false) closeButton = guiCreateButton(0.3725,0.8922,0.2398,0.0784,"Close",true,helpWindow) guiSetFont(closeButton,"default-bold-small") helpEdit = guiCreateEdit(0.2247,0.1471,0.7225,0.7137,"",true,helpWindow) guiEditSetReadOnly( helpEdit, true ) helpGrid = guiCreateGridList(0.0136,0.1451,0.1961,0.7157,true,helpWindow) showCursor(true) guiGridListSetSelectionMode(helpGrid,2) guiGridListAddColumn(helpGrid,"Freeroam",0.2) for name, file in pairs(myFiles) do local row = guiGridListAddRow(helpGrid) guiGridListSetItemText(helpGrid,row,1,tostring(name),false,false) end end addCommandHandler("help", myHelpList) function bindTheKey() bindKey("F9", "down", myHelpList) end addEventHandler("onClientPlayerJoin", getRootElement(), bindTheKey) addEventHandler("onClientGUIClick",root, function () if (source == helpGrid) then local row,col = guiGridListGetSelectedItem(source) if (row and col and row ~= -1 and col ~= -1) then local name = guiGridListGetItemText(source,row,1) if fileExists(myFiles[name]) then local file = xmlLoadFile(myFiles[name]) local text = xmlNodeGetValue(file) guiSetText(helpEdit, tostring(text)) xmlUnloadFile(file) end end end end ) META.XML <meta> <info description="Help manager" author="MTA" type="script" version="1.0.0"/> <script src="newhelp.lua" type="server"/> <config src="destruction.xml" type="client"/> <config src="env.xml" type="client"/> <config src="ferris.xml" type="client"/> <config src="horseshoe.xml" type="client"/> <config src="hq.xml" type="client"/> <config src="shops.xml" type="client"/> <config src="skins.xml" type="client"/> <config src="ufo.xml" type="client"/> <config src="veh.xml" type="client"/> <config src="weap.xml" type="client"/> <config src="weed.xml" type="client"/> </meta> OTHER XMLs (for example skins.xml) <help> blah blah blah </help> but when i type /help or press F9, the gui doesn't appear. should other xmls' type be server?
  22. Agon

    Login GUI

    <script src="login/gui.lua" type="client" /> <script src="login/login.lua" type="server" /> this may help..
  23. Agon

    adding XML Files

    Oh thank you but can you explain them? You know i'm a still beginner for name, file in pairs (myFiles) do -- i know this is a table but what can i do with this? What does this do? Where can i use this? if (row and col and row ~= -1 and col ~= -1) then -- and this is a little bit confusing..
×
×
  • Create New...