-
Posts
1,134 -
Joined
-
Last visited
-
Days Won
37
Everything posted by NeXuS™
-
After my testings, it seems like MTA still cant use colshape events after the colshape is attached. Just don't use attachElements and use setElementPosition instead.
-
Are you using this on server-side?
-
I dont know if you can attach colshapes at all. Try to use setDevelopmentMode and showcol.
-
@raynner can you goddamn stop using my signature? Like you didn't even ask if you could use it. I made that GIF, if you want to use it, at least ASK.
-
Server.
-
function spawnHandler() giveWeapon(source, 46, 500) end addEventHandler("onPlayerSpawn", getRootElement(), spawnHandler) This is the right code. He needs to give them a parachute when they spawn, not when they join.
-
Does this happen on other servers too?
-
onPlayerWasted, getPlayerWantedLevel and setElementPosition. You'll have to create a jail system for it too. You could use setElementData and a colshape to check if he leaves the jail area.
-
So use getElementData or getElementModel on the peds to check their skin.
-
The only way you could do it is addDebugHook, but it may degrade script performance.
-
local sX, sY = guiGetScreenSize() local bgW, bgH = 390, 675 -- Background item size local bgX, bgY = (sX-bgW)/2, (sY-bgH)/2 -- Background pos local lW = 160 -- Large item width local sW = 80 -- Small item width local itemTable = { "large", "large", "large", "small", "small", "small", "small" } function drawItems() dxDrawImage(bgX, bgY, bgW, bgH, "background.png") local offsetX, offsetY = 30, 30 for i = 1, #itemTable do outputChatBox("i: " .. i .. " X: " .. offsetX .. " Y: " .. offsetY) if bgW - offsetX < (itemTable[i] == "large" and lW or sW) then offsetX = 30 offsetY = offsetY + 90 end dxDrawImage(bgX+offsetX, bgY+offsetY, itemTable[i] == "large" and lW or sW, 80, itemTable[i] .. "item.png") offsetX = offsetX + (itemTable[i] == "large" and lW or sW)+10 end end addEventHandler("onClientRender", root, drawItems) Try to understand the code. If you have issues, feel free to reply.
-
You can use getElementData to test if the ped is a zombie.
-
onClientResourceStart is triggered at each client. So if you have 2 players online, it'll be triggered twice when started and will be triggered whenever someone joins.
- 2 replies
-
- triggerserverevent
- onclientresourcestart
-
(and 2 more)
Tagged with:
-
You'll have to use the width of the panel and two variables as X offset and Y offset, so you can easily change the rectangle's position. 1. You start your X offset and Y offset at 0. 2. You draw the first item, and then you add the width of the first item to the X offset + some pixels. 3. If you have enough space to draw the next item in the same line, you repeat step 2. 4. If you don't, you reset the X offset and add the height of the items + some pixels to the Y offset. Use a loop to draw them.
-
Much easier way. local allowedAccountSerials = { ["1K23GKG4K12B4B4K12B4K1B4J1BK1B43"] = true, ["F2412KL4NHLK1NH41NH24KJ14K1B4144"] = true, ["FB1244HK4HK1H1H4K14H12HK4K1H4142"] = true, ["89AF8AFAW90F8A08FAW9FAF8ASF9WAF8"] = true } addEventHandler("onPlayerJoin", getRootElement(), function() local playerSerial = getPlayerSerial(source) --Get players serial if not allowedAccountSerials[playerSerial] then kickPlayer(source, "Serial " ..playerSerial.. " is not allowed to join.") --Kick them return else outputChatBox(source, "Welcome to the server "..playerSerial) end end)
-
Picture isn't shown for me.
-
addEventHandler("onResourceStart", root, function() local q = dbQuery(function(nrQ) local rQ = dbPoll(nrQ, 0) for i, k in pairs(rQ) do table.insert(general, {k["first"], k["second"]}) end end, connection, "SELECT * FROM table") end) I'd never use dbPoll with -1 timeout, as it can cause freezes. dbPoll returns a table of all data, { { ["first"] = "first", ["second"] = "second" }, { ... }, { ... } } so you have to loop through it.
-
You can execute those commands in the chat too. It doesn't matter. It seems like your ACL.xml has some bad settings. Maybe restore it to a default file.
-
You wont decrypt it. You can use setAccountPassword to set a new password.
-
Why would you want to decrypt the passwords?...