-
Posts
1,903 -
Joined
-
Last visited
-
Days Won
1
Everything posted by xeon17
-
busMarker = createMarker(1813.21045, -1900.71777, 12.57342, "cylinder", 1, 255, 255, 255) busBlip = createBlip(1778.73706, -1907.69165, 13.38839,56) local busTeam = createTeam("Bus Drivers", 0, 255, 0) addEventHandler("onMarkerHit", busMarker, function (player) if getPlayerTeam(player) ~= busTeam then setPlayerTeam ( player, busTeam ) end end )
-
Can someone fix the script please i really need it
-
no work nothing in debug this time. local pBlips = {} function onSpawn ( ) takeAllWeapons ( source ) setPlayerMoney ( source, 0 ) giveWeapon ( source, 24, 100 ) setPedStat ( source, 73, 1000 ) setPedStat ( source, 75, 1000 ) setPedStat ( source, 71, 1000 ) setPedStat ( source, 75, 1000 ) setPedStat ( source, 77, 1000 ) setPedStat ( source, 78, 1000 ) giveWeapon ( source, 26, 100 ) giveWeapon ( source, 32, 100 ) giveWeapon ( source, 31, 150 ) giveWeapon ( source, 46, 200 ) givePlayerMoney ( source, 5000 ) local playerTeam = getPlayerTeam(source) if (playerTeam) and not pBlips[source] then local r, g, b = getTeamColor(playerTeam) local myBlip = createBlipAttachedTo ( source, 0 , 2 , r,g,b ) pBlips[source] = myBlip elseif pBlips[source] then destroyPlayerBlip(source) end end function destroyPlayerBlip(pElement) local theElement = source or pElement if pBlips[theElement] then destroyElement(pBlips[theElement]) pBlips[theElement] = nil end end addEventHandler("onPlayerSpawn", getRootElement(), onSpawn) addEventHandler("onPlayerWasted", getRootElement(), destroyPlayerBlip) addEventHandler("onPlayerQuit", getRootElement(), destroyPlayerBlip)
-
none of your two code work nothing happen Krzo's one have a bug [2014-05-16 13:31:39] WARNING: [ST]Spawn\Spawn.lua:28: Bad argument @ 'getElementType' [Expected element at argument 1, got number '0'] [2014-05-16 13:31:50] ERROR: scores\scores.lua:93: attempt to perform arithmetic on a boolean value [2014-05-16 13:31:50] WARNING: [ST]Spawn\Spawn.lua:28: Bad argument @ 'getElementType' [Expected element at argument 1, got number '233']
-
+1 problem ,when a new player enter he no have kills/deaths/ratio on scoreboard , its emty.. i need to restart the resource that he get it.. anyone ? i tried to fix by my self .
-
function onSpawn ( ) takeAllWeapons ( source ) giveWeapon ( source, 24, 100 ) local playerTeam = getPlayerTeam(source) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local myBlip = createBlipAttachedTo ( source, 0 , 2 , r,g,b ) setPedStat ( source, 73, 1000 ) setPedStat ( source, 75, 1000 ) setPedStat ( source, 71, 1000 ) setPedStat ( source, 75, 1000 ) giveWeapon ( source, 26, 100 ) setPedStat ( source, 77, 1000 ) setPedStat ( source, 78, 1000 ) giveWeapon ( source, 32, 100 ) giveWeapon ( source, 31, 150 ) giveWeapon ( source, 46, 200 ) givePlayerMoney ( source, 5000 ) end end addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) function onPlayerQuit () destroyBlipsAttachedTo ( source ) end function onPlayerWasted ( ) destroyBlipsAttachedTo ( source ) end addEventHandler ( "onPlayerQuit", getRootElement(), onPlayerQuit ) function Blip ( ) local playerTeam = getPlayerTeam(source) if ( not playerTeam) then local MeuBlip = createBlipAttachedTo ( source, 0 , 2 , 255,255,255 ) end end addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) Blips for players without gang no work , and when players quit they blip no destroy.. can someone help me please
-
With this script : scores save but they restart after resource stop.. i tried to fix but failed.. help please local root = getRootElement() local scoresRoot = getResourceRootElement(getThisResource()) local scoreColumns = {"kills", "deaths", "self", "ratio", "status"} local isColumnActive = {} local KDR_DECIMAL_PLACES = 2 --http://lua-users.org/wiki/SimpleRound local function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end local function setScoreData (element, column, data) if isColumnActive[column] then setElementData(element, column, data) end end local function resetScores (element) setScoreData(element, "kills", 0) setScoreData(element, "deaths", 0) setScoreData(element, "self", 0) setScoreData(element, "ratio", "-") local status = "" if isPedDead(element) then status = "Dead" end setScoreData(element, "status", status) end local function updateRatio (element) local deaths = getElementData(element, "deaths") if deaths == 0 then setScoreData(element, "ratio", "-") else local kdr = round(getElementData(element, "kills") / deaths, KDR_DECIMAL_PLACES) setScoreData(element, "ratio", tostring(kdr)) end end function updateActiveColumns () for i, column in ipairs(scoreColumns) do if get(column) then isColumnActive[column] = true exports.scoreboard:addScoreboardColumn(column) elseif isColumnActive[column] then isColumnActive[column] = false exports.scoreboard:removeScoreboardColumn(column) end end end addEventHandler("onResourceStart", scoresRoot, function () updateActiveColumns() for i, player in ipairs(getElementsByType("player")) do resetScores(player) end end ) addEventHandler("onResourceStop", scoresRoot, function () for i, column in ipairs(scoreColumns) do if isColumnActive[column] then exports.scoreboard:removeScoreboardColumn(column) end end end ) addEventHandler("onPlayerJoin", root, function () resetScores(source) end ) addEventHandler("onPlayerWasted", root, function (ammo, killer, weapon) if killer then if killer ~= source then -- killer killed victim setScoreData(killer, "kills", getElementData(killer, "kills") + 1) setScoreData(source, "deaths", getElementData(source, "deaths") + 1) if isColumnActive["ratio"] then updateRatio(killer) updateRatio(source) end else -- victim killed himself setScoreData(source, "self", getElementData(source, "self") + 1) end else -- victim died setScoreData(source, "deaths", getElementData(source, "deaths") + 1) if isColumnActive["ratio"] then updateRatio(source) end end setScoreData(source, "status", "Dead") end ) addEventHandler("onPlayerSpawn", root, function () setScoreData(source, "status", "") end ) addCommandHandler("score", function (player) if player then for i, column in ipairs(scoreColumns) do if column == "status" then break end if isColumnActive[column] then exports.scoreboard:addScoreboardColumn(column) outputConsole(column .. ": " .. getElementData(player, column), player) end end end end ) function onQuit () local account = getPlayerAccount(source) if account and not (isGuestAccount (account)) then local kills = getElementData(source, "kills") local deaths = getElementData(source,"deaths") local self = getElementData(source,"self") local ratio = getElementData(source,"ratio") setAccountData (account, "kills", kills ) setAccountData (account, "deaths", deaths ) setAccountData (account, "self", self ) setAccountData (account, "ratio", ratio ) end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) function onLogin () local acc = getPlayerAccount(source) local kills = getAccountData(acc, "kills") local deaths = getAccountData(acc, "deaths") local self = getAccountData(acc, "self") local ratio = getAccountData(acc, "ratio") setElementData(source, "kills", kills) setElementData(source, "deaths", deaths) setElementData(source, "self", self) setElementData(source, "ratio", ratio) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
-
now script tottaly no work ( i changed a little too ) local root = getRootElement() local scoresRoot = getResourceRootElement(getThisResource()) local scoreColumns = {"kills", "deaths", "self", "ratio", "status"} local isColumnActive = {} local KDR_DECIMAL_PLACES = 2 --http://lua-users.org/wiki/SimpleRound local function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end local function setScoreData (element, column, data) if isColumnActive[column] then setElementData(element, column, data) end end local function updateRatio (element) local deaths = getElementData(element, "deaths") if deaths == 0 then setScoreData(element, "ratio", "-") else local kdr = round(getElementData(element, "kills") / deaths, KDR_DECIMAL_PLACES) setScoreData(element, "ratio", tostring(kdr)) end end function updateActiveColumns () for i, column in ipairs(scoreColumns) do if get(column) then isColumnActive[column] = true exports.scoreboard:addScoreboardColumn(column) elseif isColumnActive[column] then isColumnActive[column] = false exports.scoreboard:removeScoreboardColumn(column) end end end addEventHandler("onResourceStop", scoresRoot, function () for i, column in ipairs(scoreColumns) do if isColumnActive[column] then exports.scoreboard:removeScoreboardColumn(column) end end end ) addEventHandler("onPlayerWasted", root, function (ammo, killer, weapon) if killer then if killer ~= source then -- killer killed victim setScoreData(killer, "kills", getElementData(killer, "kills") + 1) setScoreData(source, "deaths", getElementData(source, "deaths") + 1) if isColumnActive["ratio"] then updateRatio(killer) updateRatio(source) end else -- victim killed himself setScoreData(source, "self", getElementData(source, "self") + 1) end else -- victim died setScoreData(source, "deaths", getElementData(source, "deaths") + 1) if isColumnActive["ratio"] then updateRatio(source) end end setScoreData(source, "status", "Dead") end ) addEventHandler("onPlayerSpawn", root, function () setScoreData(source, "status", "") end ) addCommandHandler("score", function (player) if player then for i, column in ipairs(scoreColumns) do if column == "status" then break end if isColumnActive[column] then exports.scoreboard:addScoreboardColumn(column) outputConsole(column .. ": " .. getElementData(player, column), player) end end end end ) function onQuit () local account = getPlayerAccount(source) if account and not (isGuestAccount (account)) then local kills = getElementData(source, "kills") local deaths = getElementData(source,"deaths") local self = getElementData(source,"self") local ratio = getElementData(source,"ratio") setAccountData (account, "kills", kills ) setAccountData (account, "deaths", deaths ) setAccountData (account, "self", self ) setAccountData (account, "ratio", ratio ) end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) function onLogin () local acc = getPlayerAccount(source) local kills = getAccountData(acc, "kills") local deaths = getAccountData(acc, "deaths") local self = getAccountData(acc, "self") local ratio = getAccountData(acc, "ratio") setElementData(source, "kills", kills) setElementData(source, "deaths", deaths) setElementData(source, "self", self) setElementData(source, "ratio", ratio) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
-
I need help on my script , i alerdy created a scores script it stoped working and on forum nobody helped me to fix it. I wanna change the MTA Scores script that it saves kills,deaths & ratio after player quit or server restart. local root = getRootElement() local scoresRoot = getResourceRootElement(getThisResource()) local scoreColumns = {"kills", "deaths", "self", "ratio", "status"} local isColumnActive = {} local KDR_DECIMAL_PLACES = 2 --http://lua-users.org/wiki/SimpleRound local function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end local function setScoreData (element, column, data) if isColumnActive[column] then setElementData(element, column, data) end end local function resetScores (element) setScoreData(element, "kills", 0) setScoreData(element, "deaths", 0) setScoreData(element, "self", 0) setScoreData(element, "ratio", "-") local status = "" if isPedDead(element) then status = "Dead" end setScoreData(element, "status", status) end local function updateRatio (element) local deaths = getElementData(element, "deaths") if deaths == 0 then setScoreData(element, "ratio", "-") else local kdr = round(getElementData(element, "kills") / deaths, KDR_DECIMAL_PLACES) setScoreData(element, "ratio", tostring(kdr)) end end function updateActiveColumns () for i, column in ipairs(scoreColumns) do if get(column) then isColumnActive[column] = true exports.scoreboard:addScoreboardColumn(column) elseif isColumnActive[column] then isColumnActive[column] = false exports.scoreboard:removeScoreboardColumn(column) end end end addEventHandler("onResourceStart", scoresRoot, function () updateActiveColumns() for i, player in ipairs(getElementsByType("player")) do resetScores(player) end end ) addEventHandler("onResourceStop", scoresRoot, function () for i, column in ipairs(scoreColumns) do if isColumnActive[column] then exports.scoreboard:removeScoreboardColumn(column) end end end ) addEventHandler("onPlayerJoin", root, function () resetScores(source) end ) addEventHandler("onPlayerWasted", root, function (ammo, killer, weapon) if killer then if killer ~= source then -- killer killed victim setScoreData(killer, "kills", getElementData(killer, "kills") + 1) setScoreData(source, "deaths", getElementData(source, "deaths") + 1) if isColumnActive["ratio"] then updateRatio(killer) updateRatio(source) end else -- victim killed himself setScoreData(source, "self", getElementData(source, "self") + 1) end else -- victim died setScoreData(source, "deaths", getElementData(source, "deaths") + 1) if isColumnActive["ratio"] then updateRatio(source) end end setScoreData(source, "status", "Dead") end ) addEventHandler("onPlayerSpawn", root, function () setScoreData(source, "status", "") end ) addCommandHandler("score", function (player) if player then for i, column in ipairs(scoreColumns) do if column == "status" then break end if isColumnActive[column] then exports.scoreboard:addScoreboardColumn(column) outputConsole(column .. ": " .. getElementData(player, column), player) end end end end ) i need help with setAccountData.
-
take a eye on the script , of course i save.
-
The problem was in a other resource i use , problem solved
-
When i choose the skin in selector-skin , it spawn me with that skin , but when i die next time , i'll have CJ skin ( id :0) not the skin who i choosen in skin selector.. I think all skins are valid
-
Still no work radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) createBlip(939.85992, 2080.10718, 10.82031,62) marker3 = createMarker(927.96558, 2076.13110, 9.82031,"cylinder",2,0,0,255,255) local Hydra = createVehicle ( 520, 951.7998046875,2132.1005859375,20.60000038147,0,0,283.74938964844 ) local Maverick = createVehicle ( 487, 954.90002441406,2154.1999511719,20,0,0,283.74938964844) local Rustler = createVehicle ( 476, 938.5,2071.0,22.89999961853,0,0,283.74938964844 ) local Infernus = createVehicle ( 411, 968.099609375,2057.6999511719,10.60000038147,0,0,0 ) local Infernus2 = createVehicle ( 411, 962.0,2057.5,10.60000038147,0,0,0 ) local Infernus3 = createVehicle ( 411, 953.7001953125,2057.3000488281,10.60000038147,0,0,0 ) addCommandHandler ( "comprar", function ( player ) local money = getPlayerMoney ( player ) local playerTeam = getPlayerTeam ( player ) if ( not playerTeam ) then return outputChatBox("#F4A460[bASE]#F08080 You need a Gang to buy a base.", player, 0, 0, 0, true) end local r, g, b = getTeamColor ( playerTeam ) local teamMates = getPlayersInTeam ( playerTeam ) if(isElementWithinMarker(player,marker3)) and ( money > 600000 ) then takePlayerMoney ( player, 600000 ) setRadarAreaColor ( radararea4, r, g, b, 999 ) outputChatBox ( "#F4A460[bASE]#F08080 You buyed a base Fabrica for $600000", player, 0, 0, 0, true ) for _, v in ipairs(teamMates) do outputChatBox ( "#F4A460[bASE]#F08080 Your gang buyed a base #00FF00 Fabrica!", v, 0, 0, 0, true ) end else outputChatBox ( "#F4A460[bASE]#F08080 You need to be on checkpoint and $600.000", player, 0, 0, 0, true ) end end) addEventHandler("onMarkerHit", marker3, function (player) outputChatBox ( "#F4A460[bASE]#F08080 To buy a base write #00FF00 /comprar (600000$)", player, 0, 0, 0, true) end ) function Vender ( player ) if(isElementWithinMarker(player,marker3)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then givePlayerMoney ( player, 600000 ) setRadarAreaColor ( radararea4, 255, 255, 255, 155 ) setVehicleColor( Maverick, 255, 255, 255 ) setVehicleColor( Infernus, 255, 255, 255 ) setVehicleColor( Infernus2, 255, 255, 255 ) setVehicleColor( Infernus3, 255, 255, 255 ) setVehicleColor( Rustler, 255, 255, 255 ) outputChatBox ( "#FFF000 [bASE] #FF0000 You selled a base #00ff00 Fabrica!", player, 0, 0, 0, true ) end end end end addCommandHandler ( "vender", Vender ) function Car_Color ( player ) if(isElementWithinMarker(player,marker3)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) setVehicleColor( Maverick, r, g, b ) setVehicleColor( Infernus, r, g, b ) setVehicleColor( Infernus2, r, g, b ) setVehicleColor( Infernus3, r, g, b ) setVehicleColor( Rustler, r, g, b ) end end end addCommandHandler ( "comprar", Car_Color ) radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) function Fabrica_Base_Spawn() local playerTeam = getPlayerTeam(source) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then setElementPosition(source, 927.96558, 2076.13110, 9.82031) end end end addEventHandler("onPlayerSpawn", getRootElement(), Fabrica_Base_Spawn) addEventHandler("onVehicleStartEnter", Hydra, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Maverick, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Rustler, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Infernus, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Infernus2, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Infernus3, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) function onStart ( ) setVehicleColor( Maverick, 255, 255, 255 ) setVehicleColor( Infernus, 255, 255, 255 ) setVehicleColor( Infernus2, 255, 255, 255 ) setVehicleColor( Infernus3, 255, 255, 255 ) setVehicleColor( Rustler, 255, 255, 255 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( ), onStart ) addEventHandler("onVehicleExplode", resourceRoot, function () setTimer(respawnVehicle, 5000, 1, source) end) addEventHandler("onVehicleExplode", resourceRoot, function () setTimer(respawnVehicle, 5000, 1, source) end) addEventHandler("onVehicleExplode", resourceRoot, function () setTimer(respawnVehicle, 5000, 1, source) end) addEventHandler("onVehicleExplode", resourceRoot, function () setTimer(respawnVehicle, 5000, 1, source) end) addEventHandler("onVehicleExplode", resourceRoot, function () setTimer(respawnVehicle, 5000, 1, source) end) addEventHandler("onVehicleExplode", resourceRoot, function () setTimer(respawnVehicle, 5000, 1, source) end)
-
no work the full script : radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) createBlip(939.85992, 2080.10718, 10.82031,62) marker3 = createMarker(927.96558, 2076.13110, 9.82031,"cylinder",2,0,0,255,255) local Hydra = createVehicle ( 520, 951.7998046875,2132.1005859375,20.60000038147,0,0,283.74938964844 ) local Maverick = createVehicle ( 487, 954.90002441406,2154.1999511719,20,0,0,283.74938964844) local Rustler = createVehicle ( 476, 938.5,2071.0,22.89999961853,0,0,283.74938964844 ) local Infernus = createVehicle ( 411, 968.099609375,2057.6999511719,10.60000038147,0,0,0 ) local Infernus2 = createVehicle ( 411, 962.0,2057.5,10.60000038147,0,0,0 ) local Infernus3 = createVehicle ( 411, 953.7001953125,2057.3000488281,10.60000038147,0,0,0 ) addCommandHandler ( "comprar", function ( player ) local money = getPlayerMoney ( player ) local playerTeam = getPlayerTeam ( player ) if ( not playerTeam ) then return outputChatBox("#F4A460[bASE]#F08080 You need a Gang to buy a base.", player, 0, 0, 0, true) end local r, g, b = getTeamColor ( playerTeam ) local teamMates = getPlayersInTeam ( playerTeam ) if(isElementWithinMarker(player,marker3)) and ( money > 600000 ) then takePlayerMoney ( player, 600000 ) setRadarAreaColor ( radararea4, r, g, b, 999 ) outputChatBox ( "#F4A460[bASE]#F08080 You buyed a base Fabrica for $600000", player, 0, 0, 0, true ) for _, v in ipairs(teamMates) do outputChatBox ( "#F4A460[bASE]#F08080 Your gang buyed a base #00FF00 Fabrica!", v, 0, 0, 0, true ) end else outputChatBox ( "#F4A460[bASE]#F08080 You need to be on checkpoint and $600.000", player, 0, 0, 0, true ) end end) addEventHandler("onMarkerHit", marker3, function (player) outputChatBox ( "#F4A460[bASE]#F08080 To buy a base write #00FF00 /comprar (600000$)", player, 0, 0, 0, true) end ) function Vender ( player ) if(isElementWithinMarker(player,marker3)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then givePlayerMoney ( player, 600000 ) setRadarAreaColor ( radararea4, 255, 255, 255, 155 ) setVehicleColor( Maverick, 255, 255, 255 ) setVehicleColor( Infernus, 255, 255, 255 ) setVehicleColor( Infernus2, 255, 255, 255 ) setVehicleColor( Infernus3, 255, 255, 255 ) setVehicleColor( Rustler, 255, 255, 255 ) outputChatBox ( "#FFF000 [bASE] #FF0000 You selled a base #00ff00 Fabrica!", player, 0, 0, 0, true ) end end end end addCommandHandler ( "vender", Vender ) function Car_Color ( player ) if(isElementWithinMarker(player,marker3)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) setVehicleColor( Maverick, r, g, b ) setVehicleColor( Infernus, r, g, b ) setVehicleColor( Infernus2, r, g, b ) setVehicleColor( Infernus3, r, g, b ) setVehicleColor( Rustler, r, g, b ) end end end addCommandHandler ( "comprar", Car_Color ) radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) function Fabrica_Base_Spawn() local playerTeam = getPlayerTeam(source) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then setElementPosition(source, 927.96558, 2076.13110, 9.82031) end end end addEventHandler("onPlayerSpawn", getRootElement(), Fabrica_Base_Spawn) addEventHandler("onVehicleStartEnter", Hydra, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Maverick, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Rustler, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Infernus, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Infernus2, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) addEventHandler("onVehicleStartEnter", Infernus3, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(radararea4) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[bASE]#F08080 Your gang hasn't bought this base.", player, 0, 0, 0, true) cancelEvent() end end) function onStart ( ) setVehicleColor( Maverick, 255, 255, 255 ) setVehicleColor( Infernus, 255, 255, 255 ) setVehicleColor( Infernus2, 255, 255, 255 ) setVehicleColor( Infernus3, 255, 255, 255 ) setVehicleColor( Rustler, 255, 255, 255 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( ), onStart ) addEventHandler("onVehicleExplode", Hydra, function () setTimer(respawnVehicle, 5000, 1, source) end) local Hydra = createVehicle(520, 951.8,2132.1,20.6,0,0,283.75) addEventHandler("onVehicleExplode", Maverick, function () setTimer(respawnVehicle, 5000, 1, source) end) local Hydra = createVehicle(520, 951.8,2132.1,20.6,0,0,283.75) addEventHandler("onVehicleExplode", Rustler, function () setTimer(respawnVehicle, 5000, 1, source) end) local Hydra = createVehicle(520, 951.8,2132.1,20.6,0,0,283.75) addEventHandler("onVehicleExplode", Infernus, function () setTimer(respawnVehicle, 5000, 1, source) end) local Hydra = createVehicle(520, 951.8,2132.1,20.6,0,0,283.75) addEventHandler("onVehicleExplode", Infernus2, function () setTimer(respawnVehicle, 5000, 1, source) end) local Hydra = createVehicle(520, 951.8,2132.1,20.6,0,0,283.75) addEventHandler("onVehicleExplode", Infernus3, function () setTimer(respawnVehicle, 5000, 1, source) end) i want all the vehicle respawn after they blow.
-
local Hydra = createVehicle ( 520, 951.7998046875,2132.1005859375,20.60000038147,0,0,283.74938964844 ) function respawnVehicle ( ) spawnVehicle ( Hydra, 951.7998046875,2132.1005859375,20.60000038147,0,0,283.74938964844 ) end function respawnExplodedVehicle() setTimer(respawnVehicle, 5000, 1, Hydra) end addEventHandler("onVehicleExplode", Hydra, respawnExplodedVehicle) Hydra should spawn every 5 seconds when explode , but didn't work .
-
I'm trying to make a Gang War server , i have a server with host in USA online 24/7 without problems , but i need help with Scripting & Mapping , website&forum i'll create. I have a lot great resources and awesome ideas who is interested contact me via PM on forum.. ( Seaching scripters & mappers ) Thanks
-
Hmm done , but there is a problem player always spawn with CJ skin (id 0 ) But he should spawn with the skin witch he choose in Selector-skin GUI local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875}, {2087.9260253906, 1448.8768310547, 10.8203125}, {2000.55, 1526.25, 14.6171875}, {1607.35, 1816.54, 10.82} } StartMoney = 2500 CashForKill = 2500 PayNSprayCost = 100 playerSkin = {} Garages = {0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30, 31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49} function SpawnPlayer(thePlayer,skin,r,g,b) spawnPlayer ( thePlayer, 2265.3674316406, 2398.3068847656, 10.8203125, 90.0, skin ) setCameraTarget (source, source) createBlipAttachedTo(source,0,2,r,g,b) setPlayerMoney(thePlayer,StartMoney) playerSkin[thePlayer] = {skin,r,g,b} setElementData(thePlayer,"Score",0) setPlayerNametagShowing ( thePlayer, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() local attachedElements = getAttachedElements ( source ) if ( attachedElements ) then for k,v in ipairs ( attachedElements ) do if ( getElementType ( v ) == "blip" ) then destroyElement(v) else end end end end) function PlayerDied(ammo,killer) if killer and getElementType ( killer ) == "player" then setPlayerMoney(killer,getPlayerMoney(killer)+CashForKill) local Score = getElementData(killer,"Score") setElementData(killer,"Score",Score+1) end setTimer(PlayerRespawn,1000,1,source) end addEventHandler("onPlayerWasted",getRootElement(),PlayerDied) function PlayerRespawn(diedPlayer) if not diedPlayer then else toggleAllControls(diedPlayer,true) setPlayerMoney(diedPlayer,StartMoney) local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(diedPlayer,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3],playerSkin[diedPlayer]) setCameraTarget (diedPlayer, diedPlayer) end end function FixPlayerVehicle(hitElement,number) local money = getPlayerMoney(hitElement) if money < PayNSprayCost then outputChatBox("*PM: You don't have enought cash.",hitElement,170,0,0,true) else if getPedOccupiedVehicle(hitElement) then local vehicle = getPedOccupiedVehicle(hitElement) fixVehicle(vehicle) playSoundFrontEnd(hitElement,16) toggleAllControls(hitElement,false) setPlayerMoney(hitElement,money-PayNSprayCost) local vehicle = getPedOccupiedVehicle(hitElement) setElementFrozen(vehicle,true) setTimer(function() toggleAllControls(hitElement,true) setCameraTarget (hitElement, hitElement) setElementFrozen(vehicle,false) end,2500,1) if number == 1 then setCameraMatrix(hitElement,1032.7685546875,-1039.337890625,45.220012664795,1030.095703125,-1027.6357421875,40.220008850098) elseif number == 2 then setCameraMatrix(hitElement,489.150390625,-1728.8310546875,31.169326782227,488.6884765625,-1734.04296875,21.179261207581) elseif number == 3 then setCameraMatrix(hitElement,2076.5859375,-1831.4208984375,18.546875,2072.626953125,-1831.361328125,18.546875) else end end end end addEvent( "onBoughtWeapon", true ) addEventHandler( "onBoughtWeapon", getRootElement(), function(thePlayer,id,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) if id == 500 then setPedArmor ( thePlayer, 100 ) else giveWeapon ( thePlayer, id, 120 ) end end) addEvent( "onBoughtBurger", true ) addEventHandler( "onBoughtBurger", getRootElement(), function(thePlayer,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) setElementHealth(thePlayer,getElementHealth(thePlayer)+cash) if getElementHealth > 100 then setElementHealth(thePlayer,100) end end) --server addEventHandler ( "onPlayerLogin",root, function() triggerClientEvent(source,"TriggerClient",root) end )
-
This ? local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875}, {2087.9260253906, 1448.8768310547, 10.8203125}, {2000.55, 1526.25, 14.6171875}, {1607.35, 1816.54, 10.82} }
-
local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875}, {2087.9260253906, 1448.8768310547, 10.8203125}, {2000.55, 1526.25, 14.6171875}, {1607.35, 1816.54, 10.82} StartMoney = 2500 CashForKill = 2500 PayNSprayCost = 100 playerSkin = {} Garages = {0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30, 31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49} } function SpawnPlayer(thePlayer,skin,r,g,b) spawnPlayer ( thePlayer, 2265.3674316406, 2398.3068847656, 10.8203125, 90.0, skin ) setCameraTarget (source, source) createBlipAttachedTo(source,0,2,r,g,b) setPlayerMoney(thePlayer,StartMoney) playerSkin[thePlayer] = {skin,r,g,b} setElementData(thePlayer,"Score",0) setPlayerNametagShowing ( thePlayer, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() local attachedElements = getAttachedElements ( source ) if ( attachedElements ) then for k,v in ipairs ( attachedElements ) do if ( getElementType ( v ) == "blip" ) then destroyElement(v) else end end end end) function PlayerDied(ammo,killer) if killer and getElementType ( killer ) == "player" then setPlayerMoney(killer,getPlayerMoney(killer)+CashForKill) local Score = getElementData(killer,"Score") setElementData(killer,"Score",Score+1) end setTimer(PlayerRespawn,1000,1,source) end addEventHandler("onPlayerWasted",getRootElement(),PlayerDied) function PlayerRespawn(diedPlayer) if not diedPlayer then else toggleAllControls(diedPlayer,true) setPlayerMoney(diedPlayer,StartMoney) local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(diedPlayer,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3],playerSkin[diedPlayer]) setCameraTarget (diedPlayer, diedPlayer) end end function FixPlayerVehicle(hitElement,number) local money = getPlayerMoney(hitElement) if money < PayNSprayCost then outputChatBox("*PM: You don't have enought cash.",hitElement,170,0,0,true) else if getPedOccupiedVehicle(hitElement) then local vehicle = getPedOccupiedVehicle(hitElement) fixVehicle(vehicle) playSoundFrontEnd(hitElement,16) toggleAllControls(hitElement,false) setPlayerMoney(hitElement,money-PayNSprayCost) local vehicle = getPedOccupiedVehicle(hitElement) setElementFrozen(vehicle,true) setTimer(function() toggleAllControls(hitElement,true) setCameraTarget (hitElement, hitElement) setElementFrozen(vehicle,false) end,2500,1) if number == 1 then setCameraMatrix(hitElement,1032.7685546875,-1039.337890625,45.220012664795,1030.095703125,-1027.6357421875,40.220008850098) elseif number == 2 then setCameraMatrix(hitElement,489.150390625,-1728.8310546875,31.169326782227,488.6884765625,-1734.04296875,21.179261207581) elseif number == 3 then setCameraMatrix(hitElement,2076.5859375,-1831.4208984375,18.546875,2072.626953125,-1831.361328125,18.546875) else end end end end addEvent( "onBoughtWeapon", true ) addEventHandler( "onBoughtWeapon", getRootElement(), function(thePlayer,id,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) if id == 500 then setPedArmor ( thePlayer, 100 ) else giveWeapon ( thePlayer, id, 120 ) end end) addEvent( "onBoughtBurger", true ) addEventHandler( "onBoughtBurger", getRootElement(), function(thePlayer,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) setElementHealth(thePlayer,getElementHealth(thePlayer)+cash) if getElementHealth > 100 then setElementHealth(thePlayer,100) end end) --server addEventHandler ( "onPlayerLogin",root, function() triggerClientEvent(source,"TriggerClient",root) end ) local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875}, {2087.9260253906, 1448.8768310547, 10.8203125}, {2000.55, 1526.25, 14.6171875}, {1607.35, 1816.54, 10.82}
-
Lol , amateur mistake but again new bug [2014-05-11 19:29:55] SCRIPT ERROR: selector-skin\s.lua:11: '}' expected (to close '{' at line 1) near 'StartMoney' [2014-05-11 19:29:55] ERROR: Loading script failed: selector-skin\s.lua:11: '}' expected (to close '{' at line 1) near 'StartMoney' [2014-05-11 19:29:55] selector-skin restarted successfully I no understand this bug lol
-
local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875}, {2087.9260253906, 1448.8768310547, 10.8203125}, {2000.55, 1526.25, 14.6171875}, {1607.35, 1816.54, 10.82} StartMoney = 2500 CashForKill = 2500 PayNSprayCost = 100 playerSkin = {} Garages = {0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30, 31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49} } function SpawnPlayer(thePlayer,skin,r,g,b) spawnPlayer ( thePlayer, 2265.3674316406, 2398.3068847656, 10.8203125, 90.0, skin ) setCameraTarget (source, source) createBlipAttachedTo(source,0,2,r,g,b) setPlayerMoney(thePlayer,StartMoney) playerSkin[thePlayer] = {skin,r,g,b} setElementData(thePlayer,"Score",0) setPlayerNametagShowing ( thePlayer, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() local attachedElements = getAttachedElements ( source ) if ( attachedElements ) then for k,v in ipairs ( attachedElements ) do if ( getElementType ( v ) == "blip" ) then destroyElement(v) else end end end end) function PlayerDied(ammo,killer) if killer and getElementType ( killer ) == "player" then setPlayerMoney(killer,getPlayerMoney(killer)+CashForKill) local Score = getElementData(killer,"Score") setElementData(killer,"Score",Score+1) end setTimer(PlayerRespawn,1000,1,source) end addEventHandler("onPlayerWasted",getRootElement(),PlayerDied) function PlayerRespawn(diedPlayer) if not diedPlayer then else toggleAllControls(diedPlayer,true) setPlayerMoney(diedPlayer,StartMoney) local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(diedPlayer,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3],playerSkin[diedPlayer]) setCameraTarget (diedPlayer, diedPlayer) end end function FixPlayerVehicle(hitElement,number) local money = getPlayerMoney(hitElement) if money < PayNSprayCost then outputChatBox("*PM: You don't have enought cash.",hitElement,170,0,0,true) else if getPedOccupiedVehicle(hitElement) then local vehicle = getPedOccupiedVehicle(hitElement) fixVehicle(vehicle) playSoundFrontEnd(hitElement,16) toggleAllControls(hitElement,false) setPlayerMoney(hitElement,money-PayNSprayCost) local vehicle = getPedOccupiedVehicle(hitElement) setElementFrozen(vehicle,true) setTimer(function() toggleAllControls(hitElement,true) setCameraTarget (hitElement, hitElement) setElementFrozen(vehicle,false) end,2500,1) if number == 1 then setCameraMatrix(hitElement,1032.7685546875,-1039.337890625,45.220012664795,1030.095703125,-1027.6357421875,40.220008850098) elseif number == 2 then setCameraMatrix(hitElement,489.150390625,-1728.8310546875,31.169326782227,488.6884765625,-1734.04296875,21.179261207581) elseif number == 3 then setCameraMatrix(hitElement,2076.5859375,-1831.4208984375,18.546875,2072.626953125,-1831.361328125,18.546875) else end end end end addEvent( "onBoughtWeapon", true ) addEventHandler( "onBoughtWeapon", getRootElement(), function(thePlayer,id,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) if id == 500 then setPedArmor ( thePlayer, 100 ) else giveWeapon ( thePlayer, id, 120 ) end end) addEvent( "onBoughtBurger", true ) addEventHandler( "onBoughtBurger", getRootElement(), function(thePlayer,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) setElementHealth(thePlayer,getElementHealth(thePlayer)+cash) if getElementHealth > 100 then setElementHealth(thePlayer,100) end end) --server addEventHandler ( "onPlayerLogin",root, function() triggerClientEvent(source,"TriggerClient",root) end )
