-
Posts
2,753 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Captain Cody
-
Sorry, usually when fixing scripts of people I just fix what needs to be done unless it requires an entire rewrite. Any ways, what you did knocked off an entire section of the code that he wanted working. DonotInclude = {38,34} addEvent("AdminPanel.giveWeap", true) function giveWeap(plr, getText) -- MAKE IT SEND OVER, THE SENDER if not isElement(plr) then return end local wepID,wepName = getWeaponIDFromName(getText),getWeaponNameFromID(getText) if wepID then id = wepID else id = wepName end for i,v in pairs(DonotInclude) do if v = id then no = true end end if no == true then return end if plr == client then amount = 500 else amount = 90 end outputChatBox("#FF0000" ..getPlayerName(client).."#00FF00 Te ha dado un Arma #0B00FF("..getText..") ("..amount..") ", plr, r, g, b, true) outputChatBox("#00FF00 Has dado a #FF0000" ..getPlayerName(plr).."#00FF00 un Arma #0B00FF(" ..getText..") ("..amount..") ", client, r, g, b, true) -- Changed source to client, this is coming from client side. giveWeapon(plr, id,amount, true) end end addEventHandler("AdminPanel.giveWeap", root, giveWeap)
-
addEvent("AdminPanel.giveWeap", true) function giveWeap(plr, getText, Ammo, id) -- MAKE IT SEND OVER, THE SENDER if plr == client then outputChatBox("#FF0000" ..getPlayerName(source).."#00FF00 Te ha dado un Arma #0B00FF("..getText..") (500) ", plr, r, g, b, true) outputChatBox("#00FF00 Has dado a #FF0000" ..getPlayerName(plr).."#00FF00 un Arma #0B00FF(" ..getText..") (500) ", source, r, g, b, true) else outputChatBox("#FF0000" ..getPlayerName(source).."#00FF00 Te ha dado un Arma #0B00FF("..getText..") (90) ", plr, r, g, b, true) outputChatBox("#00FF00 Has dado a #FF0000" ..getPlayerName(plr).."#00FF00 un Arma #0B00FF(" ..getText..") (90) ", source, r, g, b, true) end if (not isElement(plr)) then return end local Ammo = getWeaponAmmo(Ammo) local wepID = getWeaponIDFromName(getText) local wepName = getWeaponNameFromID(getText) if (wepID) then if plr == client then giveWeapon(plr, wepID, 500, true) else giveWeapon(plr, wepID, 90, true) end end if (wepName) then if plr == client then giveWeapon(plr, wepName, 500, true) else giveWeapon(plr, wepName, 90, true) end end end addEventHandler("AdminPanel.giveWeap", root, giveWeap)
-
addEvent("AdminPanel.giveWeap", true) function giveWeap(plr, getText, id) -- MAKE IT SEND OVER, THE SENDER outputChatBox("#FF0000" ..getPlayerName(source).."#00FF00 Te ha dado un Arma #0B00FF("..getText..") ", plr, r, g, b, true) outputChatBox("#00FF00 Has dado a #FF0000" ..getPlayerName(plr).."#00FF00 un Arma #0B00FF(" ..getText..") ", source, r, g, b, true) if (not isElement(plr)) then return end local wepID = getWeaponIDFromName(getText) local wepName = getWeaponNameFromID(getText) if (wepID) then if plr == client then giveWeapon(plr, wepID, 500, true) else giveWeapon(plr, wepID, 90, true) end end if (wepName) then if plr == client then giveWeapon(plr, wepName, 500, true) else giveWeapon(plr, wepName, 90, true) end end end addEventHandler("AdminPanel.giveWeap", root, giveWeap)
-
Before the part of the code that sets his new skin, use getElementModel(player).
-
Codylewiz
-
Oh I'm sorry didn't read it right function rankMySelf (thePlayer) local account = getPlayerAccount(thePlayer) if account and not isGuestAccount(account) then local accName = getAccountName (account) local oFaction = getElementData(thePlayer, "Faction") or 0 if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if tonumber(oFaction) == 0 then setElementData(thePlayer, "Faction", 1) setElementData(thePlayer, "Rank", 6) outputChatBox ("working", thePlayer) end end end end addCommandHandler( "rankme", rankMySelf)
-
To list alive players use -- local amount = #alivePlayers Then to award the last player for i,v in pairs(alivePlayers)do outputChatBox("Congrats you survived",v) end
-
aliveplayers = {} function setUpPlayers() for i,v in pairs(getElementsByType("player")) do if getElementData(v,"InSaidMiniGame") == true then aliveplayers[v] = v end end end function playerDeathOrQuit() for i,v in pairs(aliveplayers) do if v == source then aliveplayers[source] = nil end end end addEventHandler ( "onPlayerWasted", getRootElement(), playerDeathOrQuit) addEventHandler ( "onPlayerQuit", getRootElement(), playerDeathOrQuit)
-
Not available for download, this is part of @heretrics (Server) https://forum.multitheftauto.com/viewtopic.php?f=114&t=96175 Back round info on gostown. - Back in 2009~ gostown was a largely popular for SA. There were a few revisions, final put it as a huge jungle island, with a city atop of it. But then all work for sanAndreas was dumped, and they moved to IV. And from what It seams. IV project was dumped. Continued Work - Few months back, I was trying to come up with some ideas for server. That's when I found gostown. (Description above) Incomplete, missing alot of things and really not really playable. So I took it onto myself to continue development. And basicly make it something everyone would enjoy. What's different ? - Pictures for your viewing pleasure -- - The only gas station on the island - Port view - Distant airport view - Cannot give you much info about this. (It's similar to Area51) - Airport - City - Paradise bridge (Odd view because LODS are having issues in City) - Night view of bridge
-
Server - local groveSkin = { [106]=true, [105]=true, [107]=true, [271]=true, [270]=true } function skin () local thePlayer = client local fac = getElementData(thePlayer,"Faction") or 0 local rank = getElementData(thePlayer,"Rank") or 0 if thePlayer and isElement(thePlayer) then if (tonumber(fac) == 1) then if (tonumber(rank) == 1) then setElementModel(thePlayer,105) elseif (tonumber(rank) == 2) then setElementModel(thePlayer,105) elseif (tonumber(rank) == 3) then setElementModel(thePlayer,106) elseif (tonumber(rank) == 4) then setElementModel(thePlayer,107) elseif (tonumber(rank) == 5) then setElementModel(thePlayer,271) elseif (tonumber(rank) == 6) then setElementModel(thePlayer,270) end end end end addEvent ("skin", true) addEventHandler ("skin", root, skin) function givewaffe () local thePlayer = client local fac = getElementData(thePlayer,"Faction") or 0 local rank = getElementData(thePlayer,"Rank") or 0 if thePlayer and isElement(thePlayer) then if (tonumber(fac) == 1) then if (tonumber(rank) == 1) then giveWeapon (thePlayer, 5, 1) elseif (tonumber(rank) == 2) then giveWeapon (thePlayer, 5, 1) giveWeapon (thePlayer, 24, 1) elseif (tonumber(rank) == 3) then giveWeapon (thePlayer, 5, 1) giveWeapon (thePlayer, 24, 1) elseif (tonumber(rank) == 4) then giveWeapon (thePlayer, 5, 1) giveWeapon (thePlayer, 24, 1) giveWeapon (thePlayer, 32, 1) elseif (tonumber(rank) == 5) then giveWeapon (thePlayer, 5, 1) giveWeapon (thePlayer, 24, 1) giveWeapon (thePlayer, 32, 1) elseif (tonumber(rank) == 6) then giveWeapon (thePlayer, 5, 1) giveWeapon (thePlayer, 24, 1) giveWeapon (thePlayer, 32, 1) end end end end addEvent ("weapon", true) addEventHandler ("weapon", root, givewaffe) function money () local thePlayer = client local fac = getElementData(thePlayer,"Faction") or 0 local rank = getElementData(thePlayer,"Rank") or 0 if (tonumber(fac) == 1) then if (tonumber(rank) == 1) then givePlayerMoney (200, thePlayer) outputChatBox ("Вам зачислена зарплата - 200$", thePlayer, 0,191,255) elseif (tonumber(rank) == 2) then givePlayerMoney(thePlayer,250) outputChatBox ("Вам зачислена зарплата - 250$", thePlayer, 0,191,255) elseif (tonumber(rank) == 3) then givePlayerMoney(thePlayer,350) outputChatBox ("Вам зачислена зарплата - 350$", thePlayer, 0,191,255) elseif (tonumber(rank) == 4) then givePlayerMoney(thePlayer,450) outputChatBox ("Вам зачислена зарплата - 450$", thePlayer, 0,191,255) elseif (tonumber(rank) == 5) then givePlayerMoney(thePlayer,550) outputChatBox ("Вам зачислена зарплата - 550$", thePlayer, 0,191,255) elseif (tonumber(rank) == 6) then givePlayerMoney(thePlayer,700) outputChatBox ("Вам зачислена зарплата - 700$", thePlayer, 0,191,255) end end end setTimer (money, 3600000, 1) vehicle1 = createVehicle (492, 2509.3999, -1669.4, 13.3, 0, 0, 0, "Grove 01") setVehicleColor( vehicle1, 0,128,0 ) vehicle2 = createVehicle (492, 2507.2, -1677.4, 13.4, 0, 0, 330, "Grove 02") setVehicleColor( vehicle2, 0,128,0 ) vehicle3 = createVehicle (482, 2501, -1682.3, 13.6, 0, 0, 295, "Grove 03") setVehicleColor( vehicle3, 0,128,0 ) vehicle4 = createVehicle (600, 2493.1001, -1683.8, 13.2, 0, 0, 270, "Grove 04") setVehicleColor( vehicle4, 0,128,0 ) function respawn1 () setTimer (function () respawnVehicle (vehicle1) end, 3000,1) end addEventHandler ("onVehicleExplode", root, respawn1) function respawn2 () setTimer (function () respawnVehicle (vehicle2) end, 3000,1) end addEventHandler ("onVehicleExplode", root, respawn2) function respawn3 () setTimer (function () respawnVehicle (vehicle3) end, 3000,1) end addEventHandler ("onVehicleExplode", root, respawn3) function respawn4 () setTimer (function () respawnVehicle (vehicle4) end, 3000,1) end addEventHandler ("onVehicleExplode", root, respawn4) Rank thing function rankMySelf () local thePlayer = client local account = getPlayerAccount(thePlayer) if account and not isGuestAccount(account) then local accName = getAccountName (account) local oFaction = getElementData(thePlayer, "Faction") or 0 if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if tonumber(oFaction) == 0 then setElementData(thePlayer, "Faction", 1) setElementData(thePlayer, "Rank", 6) outputChatBox ("working", thePlayer) end end end end addCommandHandler( "rankme", rankMySelf)
-
You can use a table, when they start they are all in the table, as they die / disconnect they are removed from the table, then using a timer, check every few seconds how many people are left in the table, if only one then display the message to that person and advance the map.
-
function outputChange(dataName,oldValue) if dataName == "Job" then -- Continue on end end addEventHandler("onElementDataChange",element,outputChange)
-
You don't have you defined in this event handler. You need to send the reciver and the sender through.
-
Walid, this is an Event handler being sent over from another script (Or the same script) I'm not sure it would include source.
-
You need to send the sender through the event along with the receiver. --Give weapon addEvent("AdminPanel.giveWeap", true) function giveWeap(plr, getText, id, you) -- MAKE IT SEND OVER, THE SENDER outputChatBox("#FF0000" ..getPlayerName(source).."#00FF00 Te ha dado un Arma #0B00FF("..getText..") ", plr, r, g, b, true) outputChatBox("#00FF00 Has dado a #FF0000" ..getPlayerName(plr).."#00FF00 un Arma #0B00FF(" ..getText..") ", source, r, g, b, true) if (not isElement(plr)) then return end local wepID = getWeaponIDFromName(getText) local wepName = getWeaponNameFromID(getText) if (wepID) then if plr = you then giveWeapon(plr, wepID, 500, true) else giveWeapon(plr, wepID, 90, true) end end if (wepName) then if plr = you then giveWeapon(plr, wepName, 500, true) else giveWeapon(plr, wepName, 90, true) end end end addEventHandler("AdminPanel.giveWeap", root, giveWeap)
-
Oh sorry, that's because notePad++ Corrects that to a single ), always forget to fix it.
-
--giveVehicle addEvent("AdminPanel.giveVehicle", true) function giveVehicle(plr, getText) outputChatBox("#FF0000" ..getPlayerName(source).."#00FF00 Te ha dado un Vehiculo #0B00FF("..getText..") ", plr, r, g, b, true) outputChatBox("#00FF00Has dado a #FF0000" ..getPlayerName(plr).."#00FF00 Un Vehiculo #0B00FF(" ..getText..") ", source, r, g, b, true) if (not isElement(plr)) then return end if (isPedInVehicle(plr)) then outputChatBox("#00FF00Ya en un vehiculo", source, 225, 0, 0) else local veh local x, y, z = getElementPosition(plr) local rx, ry, rz = getElementRotation(plr) if (getVehicleModelFromName(getText)) then veh = createVehicle(getVehicleModelFromName(getText), x, y, z + 3) setElementData(veh,"spawner",plr) else veh = createVehicle(getText, x, y, z + 3) setElementData(veh,"spawner",plr) end if (veh) then warpPedIntoVehicle(plr, veh) setElementRotation(veh, 0, 0, rz) end end end addEventHandler("AdminPanel.giveVehicle", root, giveVehicle) function removeVeh() for i,v in pairs(getElementsByType("vehicle",resourceRoot) do if getElementData(v,"spawner") == source then destroyElement(v) end end end addEventHandler ( "onPlayerWasted", getRootElement(), removeVeh ) addEventHandler ( "onPlayerQuit", getRootElement(), removeVeh )
-
You need X11 forward, google it.
-
He's trying to disable the input only when a GUI edit is selected.
-
You may want to report on the bug tracker the fact that it some times does not work.
-
setElementData(thePlayer,"Original",getElementModel(thePlayer)) local original = getElementData(thePlayer,"Original")
-
It could be glitched, but you could do a work around use just "no_binds" and onClientGUIclick.
-
You can see the color of the wheels changing, so yes he just creating a new set of wheels. And changing suspension height. What this does not account for though is stability and off roading, just because you have large wheels with this process doesn't mean at all they will function as you plan. -- Source, I'm a mechanic In real life. -- Any ways - Using getVehicleComponentPosition, getVehicleComponentRotation, createObject, onClientRender. AttachElement, setAttachedOffsets, Now I would suggest you move Z access up a little bit as the wheel gets bigger to prevent the wheels from going into the ground.
-
local aSavePlaces = { Circle = { -- x, y, radius }, Cuboid = { -- x, y, z, Width, Depth, Height }, Rectangle = { -- X, Y, Width, Height { 108.46, -1977.84, 85, 58 }, -- Hospitals + Spawn Base { 1994.38, -1453.32, 110, 75 }, { 1155.28, -1350.23, 65, 58 }, { 1234.93, 302.44, 40, 58 }, { 191.56, -83.96, 40, 58 }, { 1589.75, 1800.18, 40, 58 }, { -339.67, 1029.49, 40, 58 }, { -1536.27, 2504.90, 40, 58 }, { -2681.42, 582.40, 40, 58 }, { -2224, -2326.97, 40, 58 }, { 1560, -1137.41, 165, 158 }, -- Boss { 2372.29, 1823.58, 135, 158 }, { -2145.80, 118.67, 158, 200 }, { 436.91, 767.93, 450, 280 }, -- Trabajos { -413.28, -1570.95, 270, 328 }, }, Sphere = { -- X, Y, Z, Radius }, Tube = { -- X, Y, Z, Radius, Height }, Polygon = { -- X, Y, X1, Y1, X2, Y2, X3, Y3, ... -- You can add like X4, Y4 .. } } local aRadarAreaPlaces = { { 108.46, -1977.84, 85, 58, 0, 255, 0, 0 }, -- Hospitals + Spawn Base { 1994.38, -1453.32, 110, 75, 0, 255, 0, 0 }, { 1155.28, -1350.23, 65, 58, 0, 255, 0, 0 }, { 1234.93, 302.44, 40, 58, 0, 255, 0, 0 }, { 191.56, -83.96, 40, 58, 0, 255, 0, 0 }, { 1589.75, 1800.18, 40, 58, 0, 255, 0, 0 }, { -339.67, 1029.49, 40, 58, 0, 255, 0, 0 }, { -1536.27, 2504.90, 40, 58, 0, 255, 0, 0 }, { -2681.42, 582.40, 40, 58, 0, 255, 0, 0 }, { -2224, -2326.97, 40, 58, 0, 255, 0, 0 }, { 1560, -1137.41, 165, 158, 0, 255, 0, 0 }, -- Boss { 2372.29, 1823.58, 135, 158, 0, 255, 0, 0 }, { -2145.80, 118.67, 158, 200, 0, 255, 0, 0 }, { 436.91, 767.93, 450, 280, 0, 255, 0, 0 }, -- Trabajos { -413.28, -1570.95, 270, 328, 0, 255, 0, 0 }, } local sResourceName = getResourceName ( resource ) local bUseGunsInSavePlace = get( sResourceName .. '.UseGunsInSaveZone' ) local bUseRadarArea = get( sResourceName .. '.UseRadarArea' ) local pColshape, pRadarArea local bUseRunInSaveZone = get( sResourceName .. '.UseRunInSaveZone' ) local bUseJumpInSaveZone = get( sResourceName .. '.UseJumpInSaveZone' ) local bUseWeaponHudInSaveZone = get( sResourceName .. '.UseWeaponHudInSaveZone' ) local bUseAmmoHudInSaveZone = get( sResourceName .. '.UseAmmoHudInSaveZone' ) local bUseDamageInSaveZone = get( sResourceName .. '.UseDamageInSaveZone' ) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) local display = textCreateDisplay () local text = textCreateTextItem("Estas en Zona Segura !", 0.9, 0.7, "high", 0, 255, 0, 255, 2, "right", "bottom") textDisplayAddText(display, text) for s, _ in pairs( aSavePlaces ) do for _, a in pairs( aSavePlaces[ s ] ) do pColshape = _G[ 'createCol' .. s ]( unpack( a ) ) --setElementData( pColshape, 'zombieProof', true ) addEventHandler ( 'onColShapeHit', pColshape, function ( pHitElement ) if getElementType( pHitElement ) == 'player' then textDisplayAddObserver(display, pHitElement) if not bUseGunsInSavePlace then end if not bUseDamageInSaveZone then setElementData( pHitElement, 'damage', 'no' ) end elseif getElementType( pHitElement ) == 'ped' then -- check if the entered ped kill it if getElementData(pHitElement, "zombie") then if getElementData(pHitElement,"boss") ~= false then killPed(pHitElement) end end-- end-- end-- ) addEventHandler ( 'onColShapeLeave', pColshape, function ( pLeaveElement ) if getElementType( pLeaveElement ) == 'player' then textDisplayRemoveObserver(display, pLeaveElement) if not bUseGunsInSavePlace then end if not bUseDamageInSaveZone then setElementData( pLeaveElement, 'damage', 'yes' ) end elseif getElementType( pLeaveElement ) == 'ped' then -- check if the entered ped kill it end end ) end end if bUseRadarArea then for _, a in ipairs( aRadarAreaPlaces ) do pRadarArea = createRadarArea ( unpack( a ) ) setElementData( pRadarArea, 'zombieProof', true ) end end end )
-
local aSavePlaces = { Circle = { -- x, y, radius }, Cuboid = { -- x, y, z, Width, Depth, Height }, Rectangle = { -- X, Y, Width, Height { 108.46, -1977.84, 85, 58 }, -- Hospitals + Spawn Base { 1994.38, -1453.32, 110, 75 }, { 1155.28, -1350.23, 65, 58 }, { 1234.93, 302.44, 40, 58 }, { 191.56, -83.96, 40, 58 }, { 1589.75, 1800.18, 40, 58 }, { -339.67, 1029.49, 40, 58 }, { -1536.27, 2504.90, 40, 58 }, { -2681.42, 582.40, 40, 58 }, { -2224, -2326.97, 40, 58 }, { 1560, -1137.41, 165, 158 }, -- Boss { 2372.29, 1823.58, 135, 158 }, { -2145.80, 118.67, 158, 200 }, { 436.91, 767.93, 450, 280 }, -- Trabajos { -413.28, -1570.95, 270, 328 }, }, Sphere = { -- X, Y, Z, Radius }, Tube = { -- X, Y, Z, Radius, Height }, Polygon = { -- X, Y, X1, Y1, X2, Y2, X3, Y3, ... -- You can add like X4, Y4 .. } } local aRadarAreaPlaces = { { 108.46, -1977.84, 85, 58, 0, 255, 0, 0 }, -- Hospitals + Spawn Base { 1994.38, -1453.32, 110, 75, 0, 255, 0, 0 }, { 1155.28, -1350.23, 65, 58, 0, 255, 0, 0 }, { 1234.93, 302.44, 40, 58, 0, 255, 0, 0 }, { 191.56, -83.96, 40, 58, 0, 255, 0, 0 }, { 1589.75, 1800.18, 40, 58, 0, 255, 0, 0 }, { -339.67, 1029.49, 40, 58, 0, 255, 0, 0 }, { -1536.27, 2504.90, 40, 58, 0, 255, 0, 0 }, { -2681.42, 582.40, 40, 58, 0, 255, 0, 0 }, { -2224, -2326.97, 40, 58, 0, 255, 0, 0 }, { 1560, -1137.41, 165, 158, 0, 255, 0, 0 }, -- Boss { 2372.29, 1823.58, 135, 158, 0, 255, 0, 0 }, { -2145.80, 118.67, 158, 200, 0, 255, 0, 0 }, { 436.91, 767.93, 450, 280, 0, 255, 0, 0 }, -- Trabajos { -413.28, -1570.95, 270, 328, 0, 255, 0, 0 }, } local sResourceName = getResourceName ( resource ) local bUseGunsInSavePlace = get( sResourceName .. '.UseGunsInSaveZone' ) local bUseRadarArea = get( sResourceName .. '.UseRadarArea' ) local pColshape, pRadarArea local bUseRunInSaveZone = get( sResourceName .. '.UseRunInSaveZone' ) local bUseJumpInSaveZone = get( sResourceName .. '.UseJumpInSaveZone' ) local bUseWeaponHudInSaveZone = get( sResourceName .. '.UseWeaponHudInSaveZone' ) local bUseAmmoHudInSaveZone = get( sResourceName .. '.UseAmmoHudInSaveZone' ) local bUseDamageInSaveZone = get( sResourceName .. '.UseDamageInSaveZone' ) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) local display = textCreateDisplay () local text = textCreateTextItem("Estas en Zona Segura !", 0.9, 0.7, "high", 0, 255, 0, 255, 2, "right", "bottom") textDisplayAddText(display, text) for s, _ in pairs( aSavePlaces ) do for _, a in pairs( aSavePlaces[ s ] ) do pColshape = _G[ 'createCol' .. s ]( unpack( a ) ) --setElementData( pColshape, 'zombieProof', true ) addEventHandler ( 'onColShapeHit', pColshape, function ( pHitElement ) if getElementType( pHitElement ) == 'player' then textDisplayAddObserver(display, pHitElement) if not bUseGunsInSavePlace then end if not bUseDamageInSaveZone then setElementData( pHitElement, 'damage', 'no' ) end elseif getElementType( pHitElement ) == 'ped' then -- check if the entered ped kill it if getElementData(pHitElement, "zombie") then if not getElementData(pHitElement,"boss") then killPed(pHitElement) end end end end ) addEventHandler ( 'onColShapeLeave', pColshape, function ( pLeaveElement ) if getElementType( pLeaveElement ) == 'player' then textDisplayRemoveObserver(display, pLeaveElement) if not bUseGunsInSavePlace then end if not bUseDamageInSaveZone then setElementData( pLeaveElement, 'damage', 'yes' ) end elseif getElementType( pLeaveElement ) == 'ped' then -- check if the entered ped kill it end end ) end end if bUseRadarArea then for _, a in ipairs( aRadarAreaPlaces ) do pRadarArea = createRadarArea ( unpack( a ) ) setElementData( pRadarArea, 'zombieProof', true ) end end end )
