xXMADEXx
Members-
Posts
2,718 -
Joined
-
Last visited
Everything posted by xXMADEXx
-
I don't think it's possible to actually make a second seat in the rhino, however you could use some sort of technique. When the player is near one, and presses "G", you could set them to a different location, but then set their camera focused on the rhino using setCameraMatrix.
-
I was curious about this too, so I checked the resource source code. On line 30 in ipbc.lua you'll see the developer manually disabled, it, and never re-enabled it. Due to this, I don't believe you can check client performance, but I could be wrong.
-
That's what this forum is for... For people who are learning, we're basically all here to help.
-
You can check the MTA community website. https://community.multitheftauto.com/
-
Looks pretty cool. Can't wait to actually play it.
-
Released version 1.1.1 GitHub: https://github.com/braydondavis/Nerd-Gaming-Public Community: https://community.multitheftauto.com/index.php?p= ... s&id=10440 Changes:
-
I'd suggest checking out my notification system from Nerd Gaming. https://github.com/braydondavis/Nerd-Ga ... ages/c.lua
-
It would probably be best to use destroyElement on the client side, that way the game will completely remove it.
-
TAPL means that we can not help people using scripts from others to their tastes. you need the permission of the author of the script. Oh ok thank you.But it's not an open source script ? No, the scripts are leaked, meaning the script wasn't released into the community by the author, someone else released it without permission.
-
So, the problem is the ban details aren't getting correctly? If so, please post your script.
-
You can't export OOP functions.
-
You can take the turf and group systems from my NG gamemode, but it'll take a little bit of editing for it to work without the whole gamemode. Turf: https://github.com/braydondavis/Nerd-Ga ... ces/NGTurf Group: https://github.com/braydondavis/Nerd-Ga ... s/NGGroups
-
Try using this: RankingBoard = {} RankingBoard.__index = RankingBoard RankingBoard.instances = {} local screenWidth, screenHeight = guiGetScreenSize() local topDistance = 250 local bottomDistance = 0.23*screenHeight local posLeftDistance = 30 local nameLeftDistance = 60 local labelHeight = 20 local maxPositions = math.floor((screenHeight - topDistance - bottomDistance)/labelHeight) function RankingBoard.create(id) RankingBoard.instances[id] = setmetatable({ id = id, direction = 'down', labels = {}, position = 0 }, RankingBoard) end function RankingBoard.call(id, fn, ...) RankingBoard[fn](RankingBoard.instances[id], ...) end function RankingBoard:setDirection(direction,plrcount) self.direction = direction if direction == 'up' then self.highestPos = plrcount self.position = self.highestPos + 1 end end function RankingBoard:add(name, time) local position local y local doBoardScroll = false if self.direction == 'down' then self.position = self.position + 1 if self.position > maxPositions then return end y = topDistance + (self.position-1)*labelHeight elseif self.direction == 'up' then self.position = self.position - 1 local labelPosition = self.position if self.highestPos > maxPositions then labelPosition = labelPosition - (self.highestPos - maxPositions) if labelPosition < 1 then labelPosition = 0 doBoardScroll = true end elseif labelPosition < 1 then return end y = topDistance + (labelPosition-1)*labelHeight end local pos = self.position; if ( pos < 10 ) then pos = "0" .. pos; end local posLabel, posLabelShadow = createShadowedLabelFromSpare(posLeftDistance, y, 20, labelHeight, tostring(pos) .. ')', 'right') if time then if not self.firsttime then self.firsttime = time time = ': ' .. msToTimeStr(time) else time = ': +' .. msToTimeStr(time - self.firsttime) end else time = '' end local realName = name local theplayer = nil for _,ppp in ipairs(getElementsByType("player")) do if getPlayerName(ppp) == name then realName = _getPlayerName(ppp) theplayer = ppp local team = getPlayerTeam(ppp) if team then local r,g,b = getTeamColor(team) realName = RGBToHex(r,g,b)..realName end end end local playerLabel, playerLabelShadow = createShadowedLabelFromSpare(nameLeftDistance, y, 250, labelHeight, realName .. "#FFFFFF" .. time) setElementData( playerLabel, "spectatorLabel", theplayer ) table.insert(self.labels, posLabel) table.insert(self.labels, posLabelShadow) table.insert(self.labels, playerLabel) table.insert(self.labels, playerLabelShadow) playSoundFrontEnd(7) if doBoardScroll then guiSetAlpha(posLabel, 0) guiSetAlpha(posLabelShadow, 0) guiSetAlpha(playerLabel, 0) guiSetAlpha(playerLabelShadow, 0) local anim = Animation.createNamed('race.boardscroll', self) anim:addPhase({ from = 0, to = 1, time = 700, fn = RankingBoard.scroll, firstLabel = posLabel }) anim:addPhase({ fn = RankingBoard.destroyLastLabel, firstLabel = posLabel }) anim:play() end end function RankingBoard:scroll(param, phase) local firstLabelIndex = table.find(self.labels, phase.firstLabel) for i=firstLabelIndex,firstLabelIndex+3 do guiSetAlpha(self.labels[i], param) end local x, y for i=0,#self.labels/4-1 do for j=1,4 do x = (j <= 2 and posLeftDistance or nameLeftDistance) y = topDistance + ((maxPositions - i - 1) + param)*labelHeight if j % 2 == 0 then x = x + 1 y = y + 1 end guiSetPosition(self.labels[i*4+j], x, y, false) end end for i=1,4 do guiSetAlpha(self.labels[i], 1 - param) end end function RankingBoard:destroyLastLabel(phase) for i=1,4 do destroyElementToSpare(self.labels[1]) table.remove(self.labels, 1) end local firstLabelIndex = table.find(self.labels, phase.firstLabel) for i=firstLabelIndex,firstLabelIndex+3 do guiSetAlpha(self.labels[i], 1) end end function RankingBoard:addMultiple(items) for i,item in ipairs(items) do self:add(item.name, item.time) end end function RankingBoard:clear() table.each(self.labels, destroyElementToSpare) self.labels = {} end function RankingBoard:destroy() self:clear() RankingBoard.instances[self.id] = nil end -- -- Label cache -- local spareElems = {} local donePrecreate = false function RankingBoard.precreateLabels(count) donePrecreate = false while #spareElems/4 < count do local label, shadow = createShadowedLabel(10, 1, 20, 10, 'a' ) destroyElementToSpare(label) destroyElementToSpare(shadow) end donePrecreate = true end function destroyElementToSpare(elem) table.insertUnique( spareElems, elem ) guiSetVisible(elem, false) end function createShadowedLabelFromSpare(x, y, width, height, text, align) if #spareElems < 2 then if not donePrecreate then outputDebug( 'OPTIMIZATION', 'createShadowedLabel' ) end return createShadowedLabel(x, y, width, height, text, align) else local shadow = table.popLast( spareElems ) guiSetSize(shadow, width, height, false) --guiSetText(shadow, text) --guiLabelSetColor(shadow, 0, 0, 0) guiSetPosition(shadow, x + 1, y + 1, false) guiSetVisible(shadow, true) local label = table.popLast( spareElems ) guiSetSize(label, width, height, false) --guiSetText(label, text) setElementData( label, "dxlabel", text ) --guiLabelSetColor(label, 255, 255, 255) guiSetPosition(label, x, y, false) guiSetVisible(label, true) if align then guiLabelSetHorizontalAlign(shadow, align) guiLabelSetHorizontalAlign(label, align) else guiLabelSetHorizontalAlign(shadow, 'left') guiLabelSetHorizontalAlign(label, 'left') end return label, shadow end end
-
You install it the same as any other MTA resource. This is just a bundle of custom resources that I made. https://wiki.multitheftauto.com/wiki/Ser ... our_server
-
This is a little bit off topic, but it would probably be a lot easier to just save the bans into an xml or sql file.
-
I dont think that this can be done by script (I could be wrong), but I'm pretty sure you would have to make a new model for it.
-
I'm not 100% sure if you can, because I've never tried it. If you can, it should just use the example that Miika gave with the marker and vehicle switched.
-
Alright, I see. You'll need to trigger an event when "enableFire" is called, send an event to the server, and then bounce it back to all the clients. Try using this ((not tested)): ------------------------- -- Client-Side ------------------------- addEventHandler("onClientVehicleEnter", root, function(thePlayer, seat) local theVehicle = source if seat == 0 and thePlayer == localPlayer and getElementModel(theVehicle) == 405 then local x, y, z = getElementPosition ( theVehicle ) local rx, ry, rz = getElementRotation ( theVehicle ) minigun = createWeapon ( "minigun", x, y, z ) setElementAlpha ( minigun,0) attachElements ( minigun, theVehicle, -0.09, -1.1, 1.245, 0, 0, 90) bindKey ( "mouse1", "down", enableFire ) bindKey ( "mouse1", "up", disableFire ) end end ) addEventHandler("onClientVehicleExit", root, function(thePlayer, seat) local theVehicle = source if seat == 0 and thePlayer == localPlayer and getElementModel(theVehicle) == 405 then if minigun then destroyElement (minigun) unbindKey ( "mouse1", "down", enableFire ) unbindKey ( "mouse1", "up", disableFire ) end end end ) function enableFire() if isTimer(MGtimer) and minigun then killTimer(MGimer) else if ( getPlayerMoney ( localPlayer ) >= 10000 ) then triggerServerEvent ( "onMinigunBeginFireSound", localPlayer ); outputChatBox("#D31141 Libyan Kingdom #E2F50F|#FFFFFF تم سحب منك 10,000 ثمن الذخيرة", 255, 255, 255, true) else outputChatBox("#D31141 Libyan Kingdom #E2F50F|#FFFFFF ليس لديك المال الكافي", 255, 255, 255, true) end end end function disableFire() if isTimer(MGtimer) and minigun then killTimer(MGimer) else MGimer = setTimer(function() setWeaponState ( minigun, "ready" ) end, 50, 1) stopSound ( MiniSound ) end end function unb () unbindKey ( "mouse1", "down", unb ) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), unb ) local players = { } addEvent ( "onMinigunBeginFireSoundToClient", true ) addEventHandler ( "onMinigunBeginFireSoundToClient", root, function ( plr ) if ( players [ plr ] ) then if ( players [ plr ].timer and isTimer ( players [ plr ].timer ) ) then killTimer ( players [ plr ].timer ) end if ( players [ plr ].sound and isElement ( players [ plr ].sound ) ) then destroyElement ( players [ plr ].sound ) end players [ plr ] = nil; end players [ plr ] = { } players [ plr ].timer = setTimer ( function ( plr ) if ( players [ plr ].sound and isElement ( players [ plr ].sound ) ) then destroyElement ( players [ plr ].sound ) end players [ plr ].sound = playSound ( "LK.mp3", true ); setSoundVolume ( players [ plr ].sound, 1 ); end, 50, 1, plr ) end ); ------------------------- -- Server-Side ------------------------- addEvent("myLK",true) addEventHandler("myLK",resourceRoot, function() takePlayerMoney(source, 10000) end ) addEvent ( "onMinigunBeginFireSound", true ) addEventHandler ( "onMinigunBeginFireSound", root, function ( ) triggerClientEvent ( root, "onMinigunBeginFireSoundToClient", root, source ); end ); Really not sure if it'll work, but if it gives an error just post it.
-
Can you fix the link?
-
Alright, I've got version 1.1 uploaded on GitHub. Make sure to edit NGSQL/SQL.lua to your SQL connection information. GitHub: https://github.com/braydondavis/Nerd-Gaming-Public
-
It's extremely hard to understand your English. Could you please try to directly state your problem?
-
Have you tried it? It should work, due to the "\n" escape sequence.
-
Inside the event, you can check the table size to see how many players are remaining. If it's only one, you can access it with variable[1]. Example: local players = getAlivePlayers ( ); -- Get players if ( #players == 1 ) then -- only one player is remaining local player = players [ 1 ]; -- 'player' variable is the winning player end
-
When I get home, I will get those uploaded to GitHub, although it's going to be a few hours.
