-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
since author totally edited his original post, moved to General Discussion.
-
moved to German section. EDIT: great, NOW you've edited it. sorry, but now i can't move this topic.
-
you'll need a DB with external access. or https://wiki.multitheftauto.com/wiki/PHP_SDK
-
well maybe it is.
-
if tostring(songName) ~= "none" then http://lua-users.org/wiki/ExpressionsTutorial
-
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?
-
addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() , playmusic) you have ) missing after getThisResource().
-
same thing, if "n_polaczenie" is your resource — dont specify it's name in relative file path.
-
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.
-
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
-
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)
-
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).
-
«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.
-
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
-
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.
-
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
-
well you're always getting 0, because nodes dont have children. you should count children of accountRoot, not idsRoot, which is a node itself.
-
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.
-
where's the getCarIndex function? and youre using the same index in xmlFindChild for user and car, idk what is the purpose of that.
-
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 )
-
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?
-
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
-
try engineSetModelLODDistance
-
what are posX, posY, posZ?
