-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
well if you want to store something client-side, your only option is XML really, file functions are server-side only as i recall. though you can export/create server-side Lua file which will create the objects, but then you'll need to figure a way for it to run. like some separate "lua-map" resource that you will update with your lua files and restart. that's first that comes to mind or something with runcode/loadstring. imo XML is the way, why create mapping system if there already is one.
-
replace tostring(vehicleID) with getVehicleNameFromModel(vehicleID)
-
1. you're not checking if pickup is a vehiclechange 2. you're getting vehicleOccupant of a player (source is player here), use getPedOccupiedVehicle() 3. no need to get player's vehicle/id, if you're using vehicle change addEvent("onPlayerPickupRacePickup") function sevehicle(pID, pType, vehicleID) if vehicleID then setElementData(source, "Vehicle", tostring(vehicleID)) end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),sevehicle) though if you want to update this on every pickup type: addEvent("onPlayerPickupRacePickup") function sevehicle() local vehicleID = getElementModel(getPedOccupiedVehicle(source)) if vehicleID then setElementData(source, "Vehicle", tostring(vehicleID)) end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),sevehicle) as for second question: there were some «login gui» resources in the community, search it or script one yourself. PS: you also may want to try using https://wiki.multitheftauto.com/wiki/Get ... eFromModel to set vehicle name instead of ID.
-
that video is not even 100% GTA, its a «greenscreen». DN3D interface layered over GTA gameplay. and it's from July (!) 2010.
-
you can script it using setTimer attachElements moveObject or try using this resource
-
это же когнитивный диссонанс какой-то
-
it works fine, you should play with the export settings though
-
see: and search for «Kam's max scripts»
-
in that case i dont know. as you can see — i've tested. maybe you dont have a hex code in the name at all. maybe something else, i cant see from here.
-
1. if you want to make !commands, i'd advise you to create normal command first (with addCommandHandler) and then trigger them (see viewtopic.php?f=91&t=30392#p329405) 2. player is not defined in PubMoney function, use source 3. executeSQLSelect returns a table (and it can be empty). if you want the first result, use Money[1].points, where «points» is column name from your SQL table 4. start using «/debugscript 3» it will help you greatly
-
you're not searching https://wiki.multitheftauto.com/wiki/Set ... tagShowing
-
you can try putting tree objects in a separate map file and the moving it using map mover by varez then copy back to your map.
-
again, you've posted 100+ lines of code saying "don't work". what doesnt work exactly?
-
the output is the name whitout codes but white ok, my bad, function doesnt read the color value if string starts with it, update dxDrawColorText function: function dxDrawColorText(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end --[[ testing: testname1 = "#FF0000RedGuy" testname2 = "White#0000FFBlue" testname3 = "#00FF00Green, #FFFFFFWhite white white, #FF0000Red" addEventHandler("onClientRender", getRootElement(), function() dxDrawColorText(testname1, 200, 300, 200, 50, tocolor(255,255,255,255), 1, "bankgothic") dxDrawColorText(testname2, 200, 320, 200, 50, tocolor(255,255,255,255), 1, "bankgothic") dxDrawColorText(testname3, 200, 340, 200, 50, tocolor(255,255,255,255), 1, "bankgothic") end ) --]] test:
-
depends on what you mean by "nomination" https://wiki.multitheftauto.com/wiki/Votemanager
-
are you sure? and what is the output? white with color code or white with color code deleted?
-
these are teams, probably custom script searches joined player's name for a tag, and if it is found, assigns him to a team.
-
does nick have color code in it at all?
-
well you have to handle this event: function adminKickPlayer(editbox) -- here's the editbox value you've passed from client local player = getPlayerFromName(editbox) -- getting the player from name containd in editbox if player then -- player found, kick him: kickPlayer(player) else -- output to event source (you) that player not found: outputChatBox("Player with name '"..editbox.."' not found", source) end end addEvent("someGUI2ServerEvent", true) -- adds event on the server, so it could be triggered addEventHandler("someGUI2ServerEvent", getRootElement(), adminKickPlayer) -- attached event handler its all on the wiki, actually.
-
what? why? you still need password. MTA wont login anyone if you just stick a serial in logIn function.
-
name should be a name, password should be a password. and serial is a serial it is not player's name OR password.
-
see GUI functions in wiki: https://wiki.multitheftauto.com/wiki/Cli ... _functions basically you'll need to get values from your gui element and trigger a server event to send it: local someGUIeditValue = guiGetText(someGUIelement) -- works for windows/buttons/edits/etc local someGUIscrollValue = guiScrollBarGetScrollPosition(someGUIscrollbar) -- scrollbar position local someGUIcheckboxValue = guiCheckBoxSetSelected(someGUIcheckbox) -- true/false from checkbox -- etc triggerServerEvent("someGUI2ServerEvent", getLocalPlayer(), someGUIeditValue, someGUIscrollValue, someGUIcheckboxValue) -- event needs to be added/handled on the server
