Jump to content

Aibo

Retired Staff
  • Posts

    1,105
  • Joined

  • Last visited

Everything posted by Aibo

  1. Aibo

    MTA:SA => RP MP !

    since author totally edited his original post, moved to General Discussion.
  2. moved to German section. EDIT: great, NOW you've edited it. sorry, but now i can't move this topic.
  3. you'll need a DB with external access. or https://wiki.multitheftauto.com/wiki/PHP_SDK
  4. if tostring(songName) ~= "none" then http://lua-users.org/wiki/ExpressionsTutorial
  5. your resource must be in one folder like "deathmatch/resources/YOURRESOURCE" and can have whatever subfolders you want. each separate resource must be in a separate folder. what else you cant understand?
  6. addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() , playmusic) you have ) missing after getThisResource().
  7. same thing, if "n_polaczenie" is your resource — dont specify it's name in relative file path.
  8. file path should be relative to your resource folder, not "resources" folder. assuming that your resource is "n_polaczenie": <meta> <info author="NL team" version="1.0" type="gamemode" /> <script src="login_c.lua" type="client" /> <file src="img/pokazlogo.png" /> </meta> and if "n_polaczenie" is not your resource, but a folder IN your resource, then you need to specify it in guiCreateStaticImage(). basically, paths should be the same in meta and script.
  9. next time use "/debugscript 3" command to see if your script gives any errors, if it has marker type name error, it'll obviously be there
  10. have you added it correctly to meta.xml? does it even starts? if it does — add some debug output to event handlers to see if event is triggered at all like: local Poortzombie = createObject (10841,1202.5509033203,-1389.4356689453,20.241466522217,0,0,179.99450683594) local marker = createMarker(1201.7279052734,-1389.3259277344,13.16607093811, "cylinder",20, 255, 0, 0, 0) function openZombieGate(hitplayer) outputChatBox("gate opens") moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,6.4914665222168) end addEventHandler("onMarkerHit",marker,openZombieGate) function closeZombieGate(hitplayer) outputChatBox("gate closes") moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,20.241466522217) end addEventHandler("onMarkerLeave",marker,closeZombieGate) try to replace "Cylinder" with "cylinder" (honestly, i dont know if it's case-sensitive, just to be safe) but first change your marker alpha (last 0) to something else than 0 (you wont see a marker with zero alpha) local marker = createMarker(1201.7279052734,-1389.3259277344,13.16607093811, "cylinder", 20, 255, 0, 0, 128)
  11. is it client or server script? if it's client-side — it won't work because of events. if server — idk, tell us what happens (like marker is there but nothing happens) and what doesnt (like even no marker created).
  12. Aibo

    array problem

    «i» is an index/key of a value in a table and «v» is the value itself. so either use: if isElement(vehicle[tostring(name)][i]) then destroyElement(vehicle[tostring(name)][i]) end or just v: if isElement(v) then destroyElement(v) end and if you're so afraid that player's name wont be a string (although getPlayerName returns string ), you can convert it once like local name = tostring(getPlayerName(source)) no need to call tostring() everytime.
  13. Aibo

    array problem

    quick way to fix this: if not vehicle[tostring(name)] or type(vehicle[tostring(name)]) ~= "table" then vehicle[tostring(name)] = {} end but it's best to create/destroy all player-related tables and stuuf when he joins/leaves, imo. EDIT: damn this post editing
  14. Aibo

    array problem

    vehicle[tostring(name)] = {} you're emptying the player's vehicle table on each spawn_car call. so vehicle[tostring(name)][tonumber(ID)] is always nil, therefore vehicle is never destoyed.
  15. and if want you to combine the two ways: parse meta.xml nodes with mp3's into a table on resource start. that way you wont have to edit the table when you add/delete mp3 files from meta/resource. function getRandomSounds() local t = {} local meta = xmlLoadFile("meta.xml") for i, node in ipairs(xmlNodeGetChildren(meta)) do if xmlNodeGetName(node) == "file" and xmlNodeGetAttribute(node, "src"):find("someRandomSoundsFolder/.+\.mp3") then table.insert(t, xmlNodeGetAttribute(node, "src")) end end xmlUnloadFile(meta) return t end
  16. Aibo

    xml problem

    well you're always getting 0, because nodes dont have children. you should count children of accountRoot, not idsRoot, which is a node itself.
  17. Aibo

    xml problem

    still no sign of any «index+1» or xmlCreateChild. and you've posted XML with 0's but not the part which writes the XML itself and: local idsRoot = xmlFindChild (accountRoot,"car",index) local allIds = #xmlNodeGetChildren (idsRoot) here you're getting some car node and the trying to get it's children, which it doesnt have. well, judging by XML you've posted.
  18. Aibo

    xml problem

    where's the getCarIndex function? and youre using the same index in xmlFindChild for user and car, idk what is the purpose of that.
  19. Aibo

    How i can...

    add this to killmessages_client.lua killerName = killerName:gsub("#%x%x%x%x%x%x", "") wastedName = wastedName:gsub("#%x%x%x%x%x%x", "") before this: return outputMessage ( {killerName, {"padding",width=3}, {"icon",id=weapon}, {"padding",width=3},{"color",r=wr,g=wg,b=wb}, wastedName}, kr,kg,kb )
  20. if decY >= -0.6 then local objects = getElementsByType("object") local n = table.getn(objects) blocks[n+1] = createObject (model,intX+20,intY,posZ+0.5) if sounds == 1 then playSound3D ("placing.mp3",intX+20,intY,posZ,false) end elseif decY > -0.6 then -- this will never happen, not after «if decY >= -0.6» perhaps you meant < -0.6?
  21. 1. create your image 2. place it in your resource folder, add it to meta.xml with 3. create some client-side script file, add it to meta.xml 4. use onClientResourceStart event to draw the image 5. draw image either by guiCreateStaticImage or dxDrawImage (with onClientRender event) 6. set a timer or some event handler that will remove/hide the image
  22. what are posX, posY, posZ?
×
×
  • Create New...