pa3ck
Members-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
7
Everything posted by pa3ck
-
What about the event onClientPlayerTarget?
-
I'm sorry to inform you, this section of the forum is not a gamemode supermarket where you can just ask for a complete list of resources, especially from other servers.. like, did you really think we will be able to give you all of those stuff? Go to https://community.multitheftauto.com/ and look for specific resources, you might find the one you're looking for, if not, either learn scripting or hire a guy.
-
From server to client use triggerClientEvent From client to server use triggerServerEvent
-
Youre welcome
-
I'm not sure what you're trying to achieve, but I will tell you how I would do it. local payphones = {} for _, row in ipairs (result) do local newTable = {} table.insert(newTable, row["PosX"]) table.insert(newTable, row["PosY"]; table.insert(newTable, row["PosZ"]; table.insert(payphones, newTable) end --[[ payPhones = { [1] = { 1000, 500, 50 } } ]] table.insert( intoTable, data) -> this will insert the data in the table called intoTable. You don't have to specify the key, it will be automatically assigned. If you could tell me what exactly you want to achieve, I can explain it to you further.
-
Sure, if you follow the same structure of the code (setting the X/Y, width/height) correctly, you should be able to add more. The calculation for armor is the same, imageHeight / 100 * armor, but for the oxygen, the maximum value is 1000, so it will be imageHeight / 1000 * oxygenLevel
-
Yea.. it happens sometimes, you're welcome
-
Short answer: yes, it is possible. Long answer: you will need to do it yourself, as you will not find any resources that does what you want and it's quite tricky to get it all working. You can look at this topic, some of the code that has been posted might help you:
-
Is the script set to be server side? (type="server" in meta.xml)
-
local scrX, scrY = guiGetScreenSize() local hudS = {} hudS.bgX = scrX - 300 -- X position of background hudS.bgY = 20 -- Y position of background hudS.bgW = 128 -- background width (img size in pixels) hudS.bgH = 128 -- background height (img size in pixels) hudS.fX = scrX - 275 -- X position of fill hudS.fY = 51 -- Y position of fill hudS.fW = 78 -- fill width (img size in pixels) hudS.fH = 66 -- fill height (img size in pixels) addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientRender", root, function() dxDrawImage(hudS.bgX, hudS.bgY, hudS.bgW, hudS.bgH, "heart_bg.png") local currHeight = hudS.fH / 100 * getElementHealth(localPlayer) dxDrawImageSection(hudS.fX, hudS.fY, hudS.fW, currHeight, 0, 0, hudS.fW, currHeight, "heart_fill.png") end) end) https://i.imgur.com/z2qzSA8.png http://imgur.com/6gOIw5i Change the images and width/height, X/Y positions.
-
row["USERNAME"] should work, I see you edited your question, is your problem resolved now?
-
When using dbQuery, you will also need to use the function dbPoll which will automatically put the result in a table. You don't really need to use the ';' when doing single queries, but you will need it when executing multiple SQL queries with a single dbQuery or dbExec.
-
Try to use the example first, that should get you started. You will need to set the "vsize" parameter depending on the player's health. You can easily calculate that like this: local health = getElementHealth(localPlayer) local myIconHeight = 120 --pixels local vSize = myIconHeight / 100 * health If you can't figure it out, come back with the code you tried (for the dxDrawImageSection).
-
Yea, that's a bit better, but no, it's not dxDrawImage what you're looking for. You will need to use dxDrawImageSection
-
The table returns accounts, why do you want to output them as string? Even if you make them string they would look like "Userdata: xxxxx" which is no use at all. Do you want to output the account names because that's a different thing.
-
When you spawn the cars you probably use a table or something already so you know whom the car belongs to, right?
-
When you do a query to get all of the vehicles for the specific player you get a table back. Maybe you could use the table index there?
-
Your question was how to add row ID to cars, I said use primary, A_I keys, I believe that's pretty much the answer for your question?
-
Basically every single time you create a new SQL table, you will need a primary key with auto increment. This is a number that gets incremented every time you insert a new row. You don't have to do anything with it, SQL will handle that for you, all you have to do is create the column. This way every vehicle will have a unique ID.
-
Did you also check the handlings? There might be a handling option to change that angle.
-
@Rudransh is right in a way that you can use a plugin to create movable objects via Map Editor. Not sure how it works or if you would be able to lock it down to teams, but if he feels like trying out the plugin, here's the link: https://wiki.multitheftauto.com/wiki/Resource:Editor/Plugins the bottom one, or direct link to said resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1224 With minimal knowledge, this topic will definitely help you write the code 'yourself':
-
You're kind of skipping a step there, try this: addCommandHandler ( "blip", function ( thePlayer ) local theTeam = getTeamFromName ( "Spectators" ) if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) for index, plr in ipairs ( players ) do for k, el in ipairs(getAttachedElements ( plr )) do if ( getElementType ( el ) == "blip" ) then destroyElement ( el ) end end end end end )
-
You can do something like this: local strkFnd = false for _, player in ipairs(players) do if player ~= source then if getElementData(player, "Streak") then if getElementData(player, "Streak") > 1 then exports.messages:outputGameMessage(getPlayerName(source):gsub("#%x%x%x%x%x%x", "").." broke "..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."'s WinStreak of "..getElementData(player, "Streak"), getRootElement(), 2, 30, 144, 255) strkFnd = true opponentStreak = nil -- make sure it's cleared opponentName = nil end setElementData(player, "Streak", nil) end end end if opponentStreak and opponentName and not strkFnd then if opponentStreak > 1 then exports.messages:outputGameMessage(getPlayerName(source):gsub("#%x%x%x%x%x%x", "").." broke "..opponentName:gsub("#%x%x%x%x%x%x", "").."'s WinStreak of "..opponentStreak, getRootElement(), 2, 30, 144, 255) end opponentStreak = nil opponentName = nil end