-
Posts
364 -
Joined
-
Last visited
-
Days Won
6
Everything posted by DRW
-
Client-sided and no errors.
-
function stopRPG ( attacker, weapon, bodypart ) if ( weapon == 36 ) then cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopRPG) Still not working
-
function propiedad() setWeaponProperty (36, "poor","damage", 0) end addEventHandler ("onResourceStart", getRootElement(),propiedad) I try to make the RPG to not be able to kill a player but only a vehicle, but it's not working, players still die...
-
There is a script called Turfsystem that uses castillo14's group system to make turfs and let gangs conquer them. But there is a problem, it always says this, every second. The resource itself works perfectly, but it keeps giving me those warnings and it's very annoying when I want to see the server in the remote console. Is there any way to disable those warnings for a specific resource or for all resources? [2015-04-25 08:36:41] ERROR: turfsystem\serverTurf.lua:102: bad argument #1 to 'unpack' (table expected, got nil) Server ------------------------------------------------------ -- Scripting By Sasuke* -- Por Favor, no remuevas los creditos. -- Copyright © 2013 - Todos los derechos reservados. ------------------------------------------------------ local turfPos = { { 2133.1950683594, 633.66455078125, 0, 197.5, 92, 90 }, { 2486.5935058594, 678.20172119141, 0, 245, 133, 30 }, { 1856.2864990234, 627.07629394531, 0, 138.25, 152.75, 90 }, { 1576.8956298828, 662.84362792969, 0, 181, 120.5, 90 }, { 1577.6783447266, 943.66607666016, 0, 190, 190, 90 }, { 1383.4364013672, 909.61499023438, 0, 142, 230, 90 }, { 956.94744873047, 1011.635925293, 0, 220, 140, 90 }, { 1017.7476196289, 1203.4068603516, 0, 180, 165, 90 }, { 1017.623046875, 1383.4741210938, 0, 190, 290, 90 }, { 917.99707031253, 1623.6003417969, 0, 80, 220, 90 }, { 1017.7178955078, 1862.6740722656, 0, 140, 180, 90 }, { 912.50573730469, 1958.6761474609, 0, 90, 230, 90 }, { 1017.3455200195, 2063.38671875, 0, 150, 300, 90 }, { 1300.7644042969, 2095.5100097656, 0, 200, 140, 90 }, { 1398.1997070313, 2323.5505371094, 0, 160, 65, 90 }, { 1578.1955566406, 2284.0825195313, 0, 180, 110, 90 }, { 1237.6285400391, 2581.4663085938, 0, 450, 130, 90 }, { 1780.478515625, 2567.2121582031, 0, 130, 130, 90 }, { 1698.2750244141, 2724.494140625, 0, 200, 150, 90 }, { 2237.9494628906, 2723.7814941406, 0, 180, 110, 90 }, { 2498.6853027344, 2704.6188964844, 0, 300, 140, 90 }, { 2798.1267089844, 2303.9643554688, 0, 120, 300, 90 }, { 2557.5688476563, 2243.4963378906, 0, 100, 230, 90 }, { 2532.5830078125, 2063.4118652344, 0, 100, 150, 90 }, { 2558.1779785156, 1624.0816650391, 0, 100, 300, 90 }, { 2437.685546875, 1483.7209472656, 0, 160, 120, 90 }, { 2077.7106933594, 1203.5559082031, 0, 340, 170, 90 }, { 2082.3193359375, 979.23583984375, 0, 270, 210, 90 } } local areaPos = { { 2130, 630, 200, 100 }, { 2488.8793945313, 680.78289794922, 250, 130 }, { 1858, 623, 140, 165 }, { 1577, 663, 180, 130 }, { 1577, 943, 185, 190 }, { 1383, 909, 120, 230 }, { 956, 1011, 220, 140 }, { 1017, 1203, 180, 165 }, { 1017, 1383, 190, 290 }, { 917, 1623, 80, 220 }, { 1017, 1862, 140, 180 }, { 912, 1958, 90, 240 }, { 1017, 2063, 150, 300 }, { 1300, 2092, 200, 140 }, { 1398, 2323, 160, 65 }, { 1578, 2284, 180, 110 }, { 1237, 2581, 450, 130 }, { 1780, 2567, 130, 130 }, { 1698, 2724, 200, 150 }, { 2237, 2723, 180, 110 }, { 2498, 2704, 300, 140 }, { 2798, 2303, 120, 300 }, { 2557, 2243, 100, 230 }, { 2532, 2063, 100, 150 }, { 2558, 1624, 100, 300 }, { 2437, 1483, 160, 120 }, { 2077, 1203, 340, 170}, { 2082, 979, 270, 210 } } local turfElement = {} local turfTimer = {} checkComplete = false language = "Spanish" -- Pon "Spanish" para español -- Put "English" for english text addEventHandler("onResourceStart", resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS Turf_System ( Turfs TEXT, GangOwner TEXT, r INT, g INT, b INT)") local check = executeSQLQuery("SELECT * FROM Turf_System" ) if #check == 0 then for i=1,#turfPos do executeSQLQuery("INSERT INTO Turf_System(Turfs,GangOwner,r,g,b) VALUES(?,?,?,?,?)", "Turf["..tostring(i).."]", "Nadie", 0, 255, 0) end end for i,v in ipairs(turfPos) do local sqlData = executeSQLQuery("SELECT * FROM Turf_System WHERE Turfs=?", "Turf["..tostring(i).."]") local turfCol = createColCuboid(unpack(v)) setElementData(turfCol, "getTurfGang", sqlData[1].GangOwner) local arg1,arg2,arg3,arg4 = unpack(areaPos[i]) local turfArea = createRadarArea(arg1, arg2, arg3, arg4, sqlData[1].r, sqlData[1].g, sqlData[1].b, 175) turfElement[turfCol] = {turfCol, turfArea, i} end if language == "Spanish" then outputDebugString("Sistema de turf by Sasuke* ha iniciado correctamente!") else outputDebugString("Turf System by Sasuke* was started correctly!") end end ) function radar ( player ) local turf,area,id = unpack(turfElement[source]) if turf and area and source == turf then local playerGang = getElementData ( player, "gang" ) local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(id).."]" ) if ( turfGang[1].GangOwner == playerGang ) then if language == "Spanish" then outputChatBox("Este territorio ya pertenece a "..turfGang[1].GangOwner or "Nadie", player, 0, 255, 0, false) else outputChatBox("This territory already belongs to "..turfGang[1].GangOwner or "None", player, 0, 255, 0, false) end else if not getPlayerTeam(player) then return end local team = getPlayerTeam ( player ) if ( getTeamName( team ) == "Alianza" ) or ( getTeamName( team ) == "Anarquía" ) then local playerGang = getElementData ( player, "gang" ) if ( isTimer ( turfTimer[source] ) ) then return end if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then if language == "Spanish" then outputChatBox("Entraste en la zona de "..turfGang[1].GangOwner..". Espera 2 minutos y la conquistarás.", player, 0, 255, 0, false) else outputChatBox("You enter into de "..turfGang[1].GangOwner.."'s turf zone. Wait 2 minutes to capture the turf and win 4k", player, 0, 255, 0, false) end else if language == "Spanish" then outputChatBox("¡Esta zona no pertenece a nadie, quédate aquí y conquistarás esta zona para el clan!", player, 0, 255, 0, false) else outputChatBox("This turf do not belong to anyone. Wait 2 minutes to capture the turf and win 4k", player, 0, 255, 0, false) end end turfTimer[source] = setTimer ( function ( ) local beachTurfCplayers = getElementColShape ( turf ) local players = getElementsWithinColShape ( turf, "player" ) setRadarAreaColor ( area, tonumber(r), tonumber(g), tonumber(b), 175 ) for _, player in ipairs ( players ) do if getElementData(player, "gang") == playerGang then if language == "Spanish" then outputChatBox("¡Tu clan ha conquistado la base!", player, 0, 255, 0, false) else outputChatBox("Congratulations. You capture the turf. +4K!", player, 0, 255, 0, false) end triggerClientEvent("onTakeTurf", player) executeSQLQuery("UPDATE Turf_System SET GangOwner=?,r=?,g=?,b=? WHERE Turfs=?", playerGang, tonumber(r), tonumber(g), tonumber(b), "Turf["..tostring(id).."]" ) -- setElementData ( turf, "getTurfGang", playerGang ) end end setRadarAreaFlashing ( area, false ) end ,120000, 1) -- 120000 end end end end end addEventHandler ( "onColShapeHit", root, radar ) Client addEventHandler("onClientResourceStart", resourceRoot, function() setDevelopmentMode(true) end) function music() local sound = playSound("missionDone.mp3") end addEvent("onTakeTurf", true) addEventHandler("onTakeTurf", getLocalPlayer(), music)
-
I have a problem. There is a resource called "carsystem" by diesel974, and I want it to save every modification that I do to my car, so when I respawn it, the upgrades would appear. This is the part I want to modify. addEvent("spawncar1",true) addEventHandler("spawncar1",getRootElement(), function() if not (isGuestAccount(getPlayerAccount(client))) then if not (isPedInVehicle(client)) then local x,y,z = getElementPosition(client) if (getElementData(client,"mycar1")) and (getElementData(client,"mycar1")~= nil) --[[and (getElementType(getElementData(client,"mycar1")) =="vehicle")]] then local vehicle = getElementData(client,"mycar1") destroyElement(vehicle) removeElementData(client,"mycar1") --local x,y,z = getElementPosition(vehicle) --setElementPosition(vehicle,x,y,z) outputChatBox("Vehicle destroyed",client) --[[ local vehicle = getElementData(client,"mybik1") destroyElement(vehicle) removeElementData(client,"mybik1") outputChatBox("Vehicle destroyed",client)]] elseif not (getElementData(client,"mycar1")) then local account = getPlayerAccount(client) local name = getAccountName(account) local playercar = executeSQLQuery("SELECT Model,Paintjob,Color,Upgrade0,Upgrade1,Upgrade2,Upgrade3,Upgrade4,Upgrade5,Upgrade6,Upgrade7,Upgrade8,Upgrade9,Upgrade10,Upgrade11,Upgrade12,Upgrade13,Upgrade14,Upgrade15,Upgrade16 FROM carslot1 WHERE PlayerName = ?",name) if (playercar) then if #playercar > 0 then local x,y,z = getElementPosition(client) local vehicle = createVehicle(playercar[1].Model,x + 5,y +2,z) setVehiclePaintjob(vehicle,playercar[1].Paintjob) setElementData(vehicle,"vehicleOwner","mycar1") setElementData (vehicle,"mycar1",getPlayerName(source)) setElementData (client, "mycar1", vehicle) setElementData(vehicle,"VOwner",getPlayerName(client)) outputChatBox ("Car spawned.", source, 255, 0, 0) addVehicleUpgrade(vehicle, playercar[1].Upgrade0) addVehicleUpgrade(vehicle, playercar[1].Upgrade1) addVehicleUpgrade(vehicle, playercar[1].Upgrade2) addVehicleUpgrade(vehicle, playercar[1].Upgrade3) addVehicleUpgrade(vehicle, playercar[1].Upgrade4) addVehicleUpgrade(vehicle, playercar[1].Upgrade5) addVehicleUpgrade(vehicle, playercar[1].Upgrade6) addVehicleUpgrade(vehicle, playercar[1].Upgrade7) addVehicleUpgrade(vehicle, playercar[1].Upgrade8) addVehicleUpgrade(vehicle, playercar[1].Upgrade9) addVehicleUpgrade(vehicle, playercar[1].Upgrade10) addVehicleUpgrade(vehicle, playercar[1].Upgrade11) addVehicleUpgrade(vehicle, playercar[1].Upgrade12) addVehicleUpgrade(vehicle, playercar[1].Upgrade13) addVehicleUpgrade(vehicle, playercar[1].Upgrade14) addVehicleUpgrade(vehicle, playercar[1].Upgrade15) addVehicleUpgrade(vehicle, playercar[1].Upgrade16) local col1 = gettok (playercar[1].Color, 1, string.byte(',') ) local col2 = gettok (playercar[1].Color, 2, string.byte(',') ) local col3 = gettok (playercar[1].Color, 3, string.byte(',') ) local col4 = gettok (playercar[1].Color, 4, string.byte(',') ) local col5 = gettok (playercar[1].Color, 5, string.byte(',') ) local col6 = gettok (playercar[1].Color, 6, string.byte(',') ) outputChatBox(col1) if col1 then setVehicleColor(vehicle, tonumber(col1), tonumber(col2), tonumber(col3), tonumber(col4), tonumber(col5), tonumber(col6)) end else outputChatBox("No has comprado un vehículo en esta ranura.",client) end end end else outputChatBox("Primero sal del coche",client) end else outputChatBox("¡Loguéate!",client) end end)
-
Still not working, for now, I have made this teamplayer = createTeam("Jugadores", 255, 255, 255) function jugadores(thePlayer) if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Anarquia")) or not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Alianza")) then setPlayerTeam(source, teamplayer) end end addEventHandler ( "onPlayerJoin", getRootElement(), jugadores)
-
teamplayers = createTeam (Jugadores, 255,255,255) function jugadores (thePlayer) if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Anarquia")) then if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Alianza")) then setPlayerTeam (thePlayer, Jugadores) end end) addEventHandler ( "onResourceStart", getRootElement(), jugadores ) What did I do wrong? My idea was to make a team for players that are not in Alianza nor Anarquia ACL groups, but it's not working.
-
addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 8 and getElementType ( source ) ~= "ped" then killPed(source,attacker,weapon) end end) I want to make slothman's zombies die when they get hit by a specific weapon, but I don't know how, I've tried googling and looking at the MTA Wiki but nothing works.
-
It works, but zombies don't die with it!
-
Hello, addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 8 then killPed(source,attacker,weapon) end end) How can I make this to kill only peds and not players?
-
Hello, how can I make peds with a specific skin be able to burn the player that the ped punches? I don't want players to be able to burn a person with the skin, only peds. Thanks.
-
Perfect, thanks!
-
Something like that, every 2 seconds he passes into the marker he will get 500$, so when 4 seconds had passed, he would have 1000$ more, and when 6 seconds had passed, 1500$, etc.
-
Hello, I'm creating a script that makes a player in a specific ACL group to constantly get money every 2 seconds when on marker until the player leaves it. Now, the player in the ACL gets 500$ but just every time he hits the marker, not when he is within the marker. This is what I've got: BaseAlianza = createMarker (2794,-2418,12.6,"cylinder",5,255,0,0,255) BaseAlianzaR = createColRectangle (2784,-2442, 50,50) BaseAlianzaRC = createRadarArea (2784,-2442, 50,50,100,100,100,255) function toqueMarkerA (hitElement) if isObjectInACLGroup("user."..getAccountName( getPlayerAccount(hitElement) ), aclGetGroup("Anarquia")) then givePlayerMoney (hitElement,500) end end function toqueRectA (hitElement) if isObjectInACLGroup("user."..getAccountName( getPlayerAccount(hitElement) ), aclGetGroup("Anarquia")) then outputChatBox ("¡UN ANARQUISTA HA ENTRADO!", getRootElement()) end end addEventHandler ("onMarkerHit", BaseAlianza, toqueMarkerA) addEventHandler ("onColShapeHit", BaseAlianzaR, toqueRectA)
-
Hello, I want to know how to make a script like this or if there is already a resource with this function: So, there are two already made teams (Red - Blue), and two markers, when players from Red team stay in a Blue team marker for 2 minutes, all the players of the team will get money, and the ones from the Blue team will lose some of their, when those 2 minutes have passed, the marker would dissapear and become inactive for 15 minutes. Also, make the markers inactive if one of the teams have no members. I don't need a complete script, just the instructions for making it or the download link for that resource. Thanks!
-
Yeah, that's good, but I don't want players without team to get killed by other teams, I just want to enable DMing only for two teams and to only be able to deal damage between those teams members, something like a constant team deathmatch without giving them the chance to kill or get killed by other team except a specific one. Sorry for my english, hope you understand what I'm telling you.
-
Hello, I have a good idea but also a big problem. The thing is that I've made two custom ACL groups for two custom teams, now I want those acl groups to be able to DM each other but not dming other acl groups than only one, also to be able to trigger the DM mode with a command (For example: I'm part of the cops and I don't want to damage crims or get damaged by them, so I type /dm and then I can play without getting damaged by crims but by npcs only. If I want to shoot and get shot by them I type /dm again). What should I do to make this possible?
-
I don't know how to make that work for a specific zone, could you give me an example?
-
Hi, I would like to know how can I set all the map zone to PvE so you can't get damaged by a player but by a zombie and also how to set a presonalizable part of the map to have PvP. There must be a resource out there but I keep googling it and I found nothing. Thanks