-
Posts
1,903 -
Joined
-
Last visited
-
Days Won
1
Everything posted by xeon17
-
Pozdrav ljudi , radim na svom sistemu baza i ide mi super ali evo naprijimjer gang ''WANTEDS '' kupi bazu Area 51 koja je oznacena na mapi sa Radar Areom ,onda gang WANTEDS spawn u bazi Area 51 , na kordinatama koje ja odlucim. Ali ne znam kako to da uradim , ni koje funkcije da koristim , znam tablu da napravim sa kordinatama ali sta posle ? Evo ovo je baza Area 51 , radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) createBlip(279.40317, 1831.25439, 7.72656,62) marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255) addCommandHandler ( "comprar51", function ( player ) local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if(isElementWithinMarker(player,marker2)) then setRadarAreaColor ( radararea2, r, g, b, 155 ) local money = getPlayerMoney ( player ) if ( money >= 1000000 ) then takePlayerMoney ( player, 1000000 ) local color = getTeamColor ( playerTeam ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", player, 0, 0, 0, true ) end end end end ) addEventHandler("onMarkerHit", marker2, function (player) outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) end )
-
Topic od prije 3 godine , hmmm
-
I'm wanna make a gate who open when player get in contact with the Gate, and close when player is away from Gate. this is my frist time , so i ask is this code correct ? local gate = createObject(id, x, y, z, rx, ry, rz) local marker = createMarker(x, y, z, "cylinder", 2, 0, 200, 255) function openGate (hitPlayer, matchingDimension) moveObject(gate, x, y, z) end addEventHandler("onClientMarkerHit", marker, openGate) function closeGate(leavingPlayer, matchingDimension) moveObject(gate, x, y, z) end addEventHandler("onClientMarkerLeave", marker, closeGate)
-
Scripts is working good , but i got so much bugs any help please? function criarGang ( source, commandName, teamName ) local getaMoney = getPlayerMoney (source) if teamName then if getaMoney <400000 then outputChatBox("#F4A460[GANG]#F08080 Você não tem dinheiro suficiente para criar uma gang Valor 400000$",source,255,255,255,true) else if ( getPlayerTeam(source) ~= false ) and ( countPlayersInTeam(getPlayerTeam(source)) == 1 ) then destroyElement(getPlayerTeam(source)) outputChatBox("#F4A460[GANG]#F08080 Sua gang antiga foi deletada e foi criada uma nova!",source,255,255,255,true) end local newTeam = createTeam ( teamName) if newTeam then takePlayerMoney (source,400000 ) local getGang = getTeamName ( newTeam ) setTeamColor (newTeam,math.random(0,255), math.random(0,255), math.random(0,255)) setPlayerTeam ( source, newTeam ) local playerTeam = getPlayerTeam( source ) outputChatBox("#F4A460[GANG]#F08080 Gang criada com sucesso!! Valor 4.000$",source, 255, 255, 255, true) end end else outputChatBox("#F4A460[GANG]#F08080 Uso correto: /fundargang [nome]",source,255,255,255,true) end end addCommandHandler("gangcriar",criarGang) addEventHandler("onPlayerLogin",root,function() local team = getAccountData (getPlayerAccount(source), "team") if (team==getTeamName(getTeamFromName(team))) then setPlayerTeam(source, getTeamFromName(team)) end end) function save() local team = getPlayerTeam(source) local account = getPlayerAccount(source) if not isGuestAccount(account) then if(team)then setAccountData(account, "team", getTeamName(team)) end end end addEventHandler("onPlayerLogout", root, save) addEventHandler("onPlayerQuit", root, save) function sairDaGang(source) local playerTeam = getPlayerTeam (source) if (playerTeam) then setPlayerTeam (source, nil) outputChatBox("#F4A460[GANG]#F08080 Você saiu da gang",source,255,255,255,true) else outputChatBox("#F4A460[GANG]#F08080 Você não tem gang",source,255,255,255,true) end end addCommandHandler("gangabandonar", sairDaGang) function desfazerGang (source) local playerVeri = getPlayerTeam (source) if (playerVeri) then destroyElement (playerVeri) outputChatBox("#F4A460[GANG]#F08080 Você deletou sua gang",source,255,255,255,true) else outputChatBox("#F4A460[GANG]#F08080 Você não tem gang",source,255,255,255,true) end end addCommandHandler("gangdeletar", desfazerGang) function enviarGang(source,cmd,targetPlayer) local target = getPlayerFromName (targetPlayer) local geta = getPlayerName (target) gang = getPlayerTeam (source) local getName = getTeamFromName(source) lala = getTeamName(source) local convidado = true setElementData(target, "gangConvite", gang, false) if gang == getName then outputChatBox("#F4A460[GANG]#F08080 Você não pertence a nenhuma gang",source, 255, 255, 255, true) else outputChatBox("#F4A460[GANG]#F08080 Convite de recrutamento enviado para "..targetPlayer,source, 255, 255, 255, true) outputChatBox("#F4A460[GANG]#F08080 Você foi convidado para o recrutamento digite /aceitargang Gang: "..getTeamName(gang),target, 255, 255, 255, true) end end addCommandHandler("gangconvite", enviarGang) function Recrutamento(source) local gangConvite = getElementData(source, "gangConvite") if isElement(gangConvite) then outputChatBox("#F4A460[GANG]#F08080 Você entrou na gang "..getTeamName(gang),source, 255, 255, 255, true) setPlayerTeam (source, gangConvite) else outputChatBox("#F4A460[GANG]#F08080 Você não foi convidado para nenhuma gang",source, 255, 255, 255, true) end end addCommandHandler("gangaceitar",Recrutamento) function Infor(source) outputChatBox("#F4A460[GANG]#F08080 Use : /gang|criar|convite|deletar|tag|sair|abandonar|",source, 255, 255, 255, true) end addCommandHandler ("gang",Infor) Bugs : [2014-01-24 22:32:27] WARNING: GangPRO\server.lua:72: Bad argument @ 'getPlayerFromName' [2014-01-24 22:32:27] WARNING: GangPRO\server.lua:73: Bad argument @ 'getPlayerName' [Expected element at argument 1, got boolean] [2014-01-24 22:32:27] WARNING: GangPRO\server.lua:75: Bad argument @ 'getTeamFromName' [2014-01-24 22:32:27] WARNING: GangPRO\server.lua:76: Bad 'team' pointer @ 'getTeamName'(1) [2014-01-24 22:32:27] WARNING: GangPRO\server.lua:78: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2014-01-24 22:32:27] ERROR: GangPRO\server.lua:82: attempt to concatenate local 'targetPlayer' (a nil value) [2014-01-24 22:32:31] WARNING: GangPRO\server.lua:73: Bad argument @ 'getPlayerName' [Expected element at argument 1, got boolean] [2014-01-24 22:32:31] WARNING: GangPRO\server.lua:75: Bad argument @ 'getTeamFromName' [2014-01-24 22:32:31] WARNING: GangPRO\server.lua:76: Bad 'team' pointer @ 'getTeamName'(1) [2014-01-24 22:32:31] WARNING: GangPRO\server.lua:78: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2014-01-24 22:32:31] WARNING: GangPRO\server.lua:83: Bad argument @ 'outputChatBox' [Expected element at argument 2, got boolean] [2014-01-24 22:32:34] WARNING: GangPRO\server.lua:72: Bad argument @ 'getPlayerFromName' [2014-01-24 22:32:34] WARNING: GangPRO\server.lua:73: Bad argument @ 'getPlayerName' [Expected element at argument 1, got boolean] [2014-01-24 22:32:34] WARNING: GangPRO\server.lua:75: Bad argument @ 'getTeamFromName' [2014-01-24 22:32:34] WARNING: GangPRO\server.lua:76: Bad 'team' pointer @ 'getTeamName'(1) [2014-01-24 22:32:34] WARNING: GangPRO\server.lua:78: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2014-01-24 22:32:34] ERROR: GangPRO\server.lua:82: attempt to concatenate local 'targetPlayer' (a nil value)
-
I crated a base system with 10 other bases , i seen in 1 server when some team buy a base then they spawn there , their scripter given me the frist code . If the radar area have color of the player gang then that gang spawn there. my base system : radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) createBlip(279.40317, 1831.25439, 7.72656,62) marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255) addCommandHandler ( "comprar51", function ( player ) local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if(isElementWithinMarker(player,marker2)) then setRadarAreaColor ( radararea2, r, g, b, 155 ) local money = getPlayerMoney ( player ) if ( money >= 1000000 ) then takePlayerMoney ( player, 1000000 ) local color = getTeamColor ( playerTeam ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", player, 0, 0, 0, true ) end end end end ) addEventHandler("onMarkerHit", marker2, function (player) outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) end ) A little photo , look the radar area , it have color of players gang and the gang members spawn in their radar area (base)
-
I'm learning i do my beast but some things i no understand , you are scripter much years , me only 1 mounth . And now i have the table but how i can set when player have area 51 then he spawn there.. with this ? function getSpawnPoint(player) local x, y, z if(getElementData(player, "isInGang")) then x, y, z = getBaseSpawnpoint(player) if(not x or not y or not z) then x, y, z = getGangZoneSpawnpoint(player) if(not x or not y or not z) then x, y, z = getRandomSpawnPoint(player) end end end return x, y, z end or this radararea = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) function onSpawn ( player ) playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if getRadarAreaColor ( radararea ) == r, g, b then setElementPosition ( player, 298.98865, 1815.90613, 3.71094 ) end end addEventHandler ( "onPlayerSpawn", player, onSpawn )
-
addEventHandler ( "onPlayerLogin", getRootElement ( ), function ( _, theCurrentAccount ) setPlayerName ( source, getAccountName ( theCurrentAccount ) ) end ) addEventHandler ( "onPlayerChangeNick", getRootElement ( ), function ( ) cancelEvent() end )
-
Any answer please ? i no understand this
-
I no understand much about table , realy nothing.. Area 51 Spawnpoint 1 > 331.06286621094, 1855.9083251953, 7.828125 Area 51 Spawnpoint 2 > 216.45199584961, 1822.6893310547, 6.4140625 Area 51 Spawnpoint 3 > 211.66558837891, 1810.6231689453, 21.8671875 Normall Spawnpoint 1 > 2171.90625, 1392.59765625, 10.8203125 Normall Spawnpoint 2 > 2265.3674316406, 2398.3068847656, 10.8203125 Normall Spawnpoint 3 > 2361.689453125, 2070.2077636719, 10.671875
-
Znam ja skriptati i sve , ne trazim scriptera nego eto zanima me zna li iko na ovom forumu da scripta..
-
I'm working at a base system , but i wanna crate when extample FsN have Area 51 , the radar area of Area 51 get color of FsN gang then the FsN gang spawn in area 51 , after extample WANTEDS buy the Area 51 and the Area 51 radar area get the WANTEDS color and WANTEDS gang spawn in Area 51 , can someone help me radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) createBlip(279.40317, 1831.25439, 7.72656,62) marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255) addCommandHandler ( "comprar51", function ( player ) local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if(isElementWithinMarker(player,marker2)) then setRadarAreaColor ( radararea2, r, g, b, 155 ) local money = getPlayerMoney ( player ) if ( money >= 1000000 ) then takePlayerMoney ( player, 1000000 ) local color = getTeamColor ( playerTeam ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", player, 0, 0, 0, true ) end end end end ) addEventHandler("onMarkerHit", marker2, function (player) outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) end ) My friend said me i need add something like this , but i no have idea how this should work function getSpawnPoint(player) local x, y, z if(getElementData(player, "isInGang")) then x, y, z = getBaseSpawnpoint(player) if(not x or not y or not z) then x, y, z = getGangZoneSpawnpoint(player) if(not x or not y or not z) then x, y, z = getRandomSpawnPoint(player) end end end return x, y, z end Or maybe something like this : radararea = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) function onSpawn ( player ) playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if getRadarAreaColor ( radararea ) == r, g, b then setElementPosition ( player, 298.98865, 1815.90613, 3.71094 ) end end addEventHandler ( "onPlayerSpawn", player, onSpawn )
-
Thank you Solidsnake14 Yes TAPL i know
-
Something wrong with my godmode script , when godmode is activated on the player should be text ''GOD'' but there is ''GOD true'' dxDrawText( 'GOD ' .. tostring( getElementData( player, "invincible" ) ), px, py, px, py, tocolor( 255, 255, 255, 255 ), 1, "sans", "center", "center", false, false, false , true ); it should written only ''GOD'' but there is ''GOD true '' i no have idea how.. i need post the full script or this is enough ?
-
Thanks TAPL it work thank you very much
-
No work again i changed 3 times the size of marker , but now i get the message [CRIME] bem vindo a gang.. see the screenshot
-
No work TAPL nothing in debug , maybe no work becouse the marker is very up ,
-
No work , nothing happen. With my code CRIME gang get crated but player no join crime with command /ingressar i found a bug and fixed : addCommandHandler("ingressar", CRIME) to addCommandHandler("ingressar", Gang) But again not work. I think this is wrong , becouse the gang get crated but player no join gang. function Gang (source) setPlayerTeam ( source, CRIME )
-
I have problem with my script , when some player write /ingressar he should be in gang CRIME , but that no happen here is the script : CRIME = createRadarArea ( 1264.7268066406, -767.19152832031, 200, -200, 255, 0, 0 ) createBlip(1293.5074462891, -772.97387695313, 95.95964050293,16) marker1 = createMarker(1293.5074462891, -772.97387695313, 95.95964050293,"cylinder",2,0,0,255,255) function CRIME () createTeam ( "CRIME", 255, 0, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( ), CRIME ) function Gang (source) setPlayerTeam ( source, CRIME ) outputChatBox ( "#FF0000 [CRIME] #FFF000 Bem vindo a gang #FF0000 CRIME !", source, 0, 0, 0, true ) addEventHandler ( "onPlayerSpawn", source, onSpawn ) end addCommandHandler("ingressar", CRIME) function onSpawn ( ) setElementPosition ( source, 1293.5074462891, -772.97387695313, 95.95964050293 ) end addEventHandler("onMarkerHit", marker1, function (player) outputChatBox ( "#FF0000 [CRIME] #FFF000 Para entra a gang CRIME digita #00FF00 /ingressar", player, 0, 0, 0, true) end ) function sairDaGang(source) local playerTeam = getPlayerTeam (source) if (playerTeam) then setPlayerTeam (source, nil) outputChatBox("#FF0000[CRIME]#FFF000 Você saiu da gang",source,255,255,255,true) else outputChatBox("#FF0000[CRIME]#FFF000 Você não tem gang",source,255,255,255,true) end end addCommandHandler("gangabandonar", sairDaGang) i tryed this too : but only the frist player who write /ingressar get in the gang , other players no. CRIME = createRadarArea ( 1264.7268066406, -767.19152832031, 200, -200, 255, 0, 0 ) createBlip(1293.5074462891, -772.97387695313, 95.95964050293,16) marker1 = createMarker(1293.5074462891, -772.97387695313, 95.95964050293,"cylinder",2,0,0,255,255) function CRIME ( source, commandName, CRIME ) if(isElementWithinMarker(source,marker1)) then local CRIME = createTeam ( "CRIME", 255, 0, 0 ) if CRIME then setPlayerTeam ( source, CRIME ) outputChatBox ( "#FF0000 [CRIME] #FFF000 Bem vindo a gang #FF0000 CRIME !", source, 0, 0, 0, true ) addEventHandler ( "onPlayerSpawn", source, onSpawn ) end end end addCommandHandler("ingressar", CRIME) function onSpawn ( ) setElementPosition ( source, 1293.5074462891, -772.97387695313, 95.95964050293 ) end addEventHandler("onMarkerHit", marker1, function (player) outputChatBox ( "#FF0000 [CRIME] #FFF000 Para entra a gang CRIME digita #00FF00 /ingressar", player, 0, 0, 0, true) end ) function sairDaGang(source) local playerTeam = getPlayerTeam (source) if (playerTeam) then setPlayerTeam (source, nil) outputChatBox("#FF0000[CRIME]#FFF000 Você saiu da gang",source,255,255,255,true) else outputChatBox("#FF0000[CRIME]#FFF000 Você não tem gang",source,255,255,255,true) end end addCommandHandler("gangabandonar", sairDaGang) please help
-
hmmm see the problem : 2 markers , 1 place , when you enter in bank the other marker teleport you out the bank interior id : 3 , i need the interiors resource for my ammu & fast food shops , but with the interior resource bank is bugged. any help please?
-
I need interiors for my ammu shop and fast food scripts , but i cant use the bank system becouse there are 2 markers and i cant enter bank , i can only enter when interiors are off. Can someone help me please , can i set off the marker in bank system or the marker in interiors for bank? its verry imporant
-
Thank you , but is there any way to disable that players can change name. This script is great , but players can change their name after. I use this scores system : 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 ) There is another Scores system who save score of players in their accounts when they logout , but is full of bugs. addEventHandler ( "onPlayerWasted", root, function( totalAmmo, killer, killerWeapon, bodypart, stealth ) if killer then local account = getPlayerAccount ( killer ) if killer ~= source then setAccountData( account,"totalkillsdeaths.Kills",tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) +1 ) setElementData( killer, "Kills", tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) ) ) setElementData( killer, "ratio", tonumber(getElementData( killer, "Kills" )/getElementData( source, "Deaths") ) ) end else local accountSource = getPlayerAccount ( source ) setAccountData( accountSource,"totalkillsdeaths.Deaths",tonumber( getAccountData(accountSource,"totalkillsdeaths.Deaths") or 0 ) +1 ) setElementData( source, "Deaths", tonumber( getAccountData( accountSource,"totalkillsdeaths.Deaths" ) ) ) setElementData( source, "ratio", getElementData( killer, "Kills" )/getElementData( source, "Deaths") ) end end ) addEventHandler( "onPlayerLogin",root, function( thePreviousAccount, theCurrentAccount, autoLogin ) local account = getPlayerAccount ( source ) if not getAccountData( account,"totalkillsdeaths.Kills" ) and not getAccountData( account,"totalkillsdeaths.Deaths" ) then setAccountData( account,"totalkillsdeaths.Kills",0 ) setAccountData( account,"totalkillsdeaths.Deaths",0 ) end setElementData( source,"Deaths",tonumber( getAccountData( account,"totalkillsdeaths.Deaths" ) or 0 ) ) setElementData( source,"Kills",tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) ) setElementData( source, "ratio", getElementData( source, "Kills" )/getElementData( source, "T/D") ) end ) addEventHandler( "onResourceStart",resourceRoot, function( ) outputDebugString( "add Total Kills to scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "Kills",root,2, 0.032 ) ) ) outputDebugString( "add ratioto scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "ratio",root,4, 0.047 ) ) ) outputDebugString( "add Total Deaths to scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "Deaths",root,3, 0.032 ) ) ) end ) is there any way to save the scores of the frist scores system in accounts , when play logout
-
i wanna crate a script , when player enter server when he login that his name get changed to his account name. i added a login/register system when someone join server , extample his name was : XeonsDK when he login to his account ''EufraT'' his name get changed to ''EufraT'' not more XeonsDK. What functions i need to use for this? And how to crate save player score , extample when player quit his kills,deaths and kdr get saved in his account.