-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Si te fijas bien en el codigo del recurso "spawn", te vas a dar cuenta de que 50p ( el creador del mismo ) creo un objeto y le cambia el alpha para que sea invisible, asi que no esta "flotando", esta parado ensima de ese objeto.
-
I doubt there's a forum where you can simple request scripts and someone makes them for free.
-
-- Infopoints Script By haws1290 For Use On Fort Carson Roleplay © -- Help From: -- Alpha -- Soildsnake14 -- blazy -- Draken mysql = exports.mysql local pInfo = createPickup ( -204.19921875, 1116.7587890625, 19.7421875, 3, 1239 ); -- create marker addEventHandler ( "onResourceStart", resourceRoot, function ( ) addEventHandler ( "onPickupHit", pInfo, fnShow ); -- add handler of event 'onPickupHit' to fn 'fnShow' addCommandHandler ( "createinfo", fnCreateInfo ); -- add command 'createinfo' to fn 'fnCreateInfo' end ) function fnShow ( pPlayer ) outputChatBox ( "Welcome to Fort Carson Roleplay Server!", pPlayer ); -- output on chat some text outputChatBox ( "Our Forums Address Is mtafcrp.freeforums.org", pPlayer ); cancelEvent(); end function fnCreateInfo ( pPlayer, chCommand, ... ) if ( ... ) then if ( exports['global']:isPlayerAdmin ( pPlayer ) ) then local nX, nY, nZ = getElementPosition ( pPlayer ); local chText = table.concat ( { ... }, " " ); pInfoPickup = createPickup ( nX, nY, nZ, 3, 1239, 0.1 ); setElementData ( pInfoPickup, "Message", chText ); setElementData ( pInfoPickup, "PosX", nX ); setElementData ( pInfoPickup, "PosY", nY ); setElementData ( pInfoPickup, "PosZ", nZ ); addEventHandler ( "onPickupHit", pInfoPickup, infohit ); local id = mysql:query_insert_free ( "INSERT INTO infopoints SET posx='" .. mysql:escape_string(nX) .. "', posy='" .. mysql:escape_string(nY) .. "', posz='" .. mysql:escape_string(nZ) .. "', message='" .. mysql:escape_string(chText) .. "'" ); exports['anticheat-system']:changeProtectedElementDataEx(pInfoPickup, "dbid", id, false) outputChatBox("You Have Created A Infopoint With The ID ".. id ..".",pPlayer, 255, 194, 14) --fnSaveInfo(); end else outputChatBox ( "SYNTAX: /" .. chCommand .. " [iNFO]", pPlayer, 255, 194, 14 ); end end --[[function fnSaveInfo ( ) local message = getElementData ( pInfoPickup, "Message" ); local posx = getElementData ( pInfoPickup, "PosX" ); local posy = getElementData ( pInfoPickup, "PosY" ); local posz = getElementData ( pInfoPickup, "PosZ" ); end]] --[[function infohit(thePlayer) local message = getElementData( pInfoPickup,"Message") outputChatBox("" .. message .."",thePlayer) end]] mysql = exports.mysql --[[function createInfoPoints( ) local result = mysql:mysql_query(host,"SELECT * FROM infopoints") if #result ~= 0 then for index, pInfoPickup in ipairs(result ) do fnCreateInfo(pInfoPickup ["posx"], pInfoPickup ["posy"], pInfoPickup["posz"], pInfoPickup["message"]) end end end addEventHandler("onResourceStart",resourceRoot, createInfoPoints)]] function loadAllInfopoints(res) -- Load current ones local result = mysql:query("SELECT * FROM infopoints") local count = 0 local highest = 0 if (result) then local run = true while run do local row = exports.mysql:fetch_assoc(result) if not (row) then break end local id = tonumber(row["id"]) local x = tonumber(row["posx"]) local y = tonumber(row["posy"]) local z = tonumber(row["posz"]) local infomessage = row["message"] local pickup = createPickup( x, y, z, 3, 1239, 0.1) exports.pool:allocateElement(pickup) setElementData ( pickup, "Message", infomessage ) exports['anticheat-system']:changeProtectedElementDataEx(pickup, "dbid", id, false) outputChatBox("".. infomessage .."", source) count = count + 1 if id > highest then highest = id end end mysql:query_free("ALTER TABLE `infopoints` AUTO_INCREMENT = " .. mysql:escape_string((highest + 1))) end mysql:free_result(result) end addEventHandler("onResourceStart", getResourceRootElement(), loadAllInfopoints)
-
We don't accept requests here.
-
Well, I would say that the module isn't loaded.
-
You have to install the MySQL module: https://wiki.multitheftauto.com/wiki/Mysql
-
https://wiki.multitheftauto.com/wiki/ExecuteSQLQuery There are examples.
-
I can't see where you defined "id".
-
1: Remove "lp" from the function name @ server side. 2: Replace "lp" with "source" @ server side.
-
function chatbox(text, msgtype) local root = getRootElement() local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) if (msgtype == 0) then if isObjectInACLGroup("user." .. account, aclGetGroup("Nick en Mitchel")) then cancelEvent(true) outputChatBox("#FF0000[Owner] #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: [Owner] " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) and name ~= "damian" then cancelEvent(true) outputChatBox("#855863[ADMIN] #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: [ADMIN] " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then cancelEvent(true) outputChatBox("#855863[sMOD] #FFFFFF" .. name ..":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: [sMOD] " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then cancelEvent(true) outputChatBox("#855863[MOD] #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: [MOD] " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then cancelEvent(true) outputChatBox(name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: " .. name .. ": " .. text) end elseif (msgtype == 2) then end end addEventHandler("onPlayerChat", root, chatbox) function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end You have to use: "~=".
-
What exactly do you want to do?
-
What is "=!" ? I don't understand what are you trying to do.
-
X-SHADOW: I don't want to sound rude, but 'source' is just a name, his player argument is "killer", his only problem is that he's using "attacker" instead of "killer".
-
Your player element is: "killer" but you're using "attacker" there.
-
With what event are you running this? Btw, I think it's "Zombie kills" with lower case "kills".
-
https://wiki.multitheftauto.com/wiki/Shader_examples In that page you'll find many shader examples.
-
Ok, I'll lock the topic as requested.
-
Podrias usar las funciones de DirectX: dxDrawRectangle dxDrawText
-
Ese script es mi "exp_system" pero una version muy vieja y con errores seguro, descarga la ultima version que es mucho mejor: https://community.multitheftauto.com/ind ... ls&id=1253
-
Copialo de nuevo, ya arregle el error. Para lo del extrahealth, te dije que no iva a funcionar, algo no funciona en ese recurso.
-
--[[ /************************************************************** * * Script: Spot Management System * File: manager_server.lua * Version: 1.0.0 R3 * Date: 2012-05-26 * ***************************************************************/ --]] if not getResourceFromName("zombies") then return end local RADIUS = 10 local COUNT = 0 local SPOT = { } local ZOMBIESINSPOT = { } function setRadius ( source, command, radius ) if ( command == "setradius" ) then if ( not radius ) then return false end RADIUS = tonumber ( radius ) outputChatBox ( "You have set spot radius to " .. RADIUS, source ) playSoundFrontEnd ( source, 41 ) end end addCommandHandler ( "setradius", setRadius ) function setCSPOT ( source, command, spot ) if ( command == "setcurrentspot" ) then if ( not spot ) then return false end currentSpot = tonumber ( spot ) outputChatBox ( "You have set current spot to spot[" .. spot .. "]", source ) playSoundFrontEnd ( source, 41 ) end end addCommandHandler ( "setcurrentspot", setCSPOT ) function addZombieToSpot ( source, command, spot, rot, skin, interior, dimension, level, maxhealth, boss ) if ( command == "addzombie" ) then if ( not spot ) then return false end if ( not rot ) then local rot = math.random ( 1, 359 ) end if ( not skin ) then skin = 0 end if ( not interior ) then interior = 0 end if ( not dimension ) then dimension = 0 end if ( not level ) then level = 1 end if ( not maxhealth ) then maxhealth = 100 end if ( not boss ) then boss = false end local currentSpot = tonumber ( spot ) local sx, sy, sz = getElementPosition ( SPOT [ currentSpot ] ) local sortZombies = ( RADIUS / 1.2 ) local zom = exports.zombies:createZombie ( sx + math.random ( -sortZombies, sortZombies ), sy + math.random ( -sortZombies, sortZombies ), sz + 10, rot, skin, interior, dimension, level, maxhealth, boss ) if ( zom ) then table.insert ( ZOMBIESINSPOT, zom ) setElementData ( zom, "zombieSpot", SPOT [ currentSpot ] ) outputChatBox ( "You have added '" .. getElementData ( zom, "name" ) .. "' to spot[" .. spot .. "]", source ) playSoundFrontEnd ( source, 41 ) else outputChatBox ( "Failed to create spot!", source ) end end end addCommandHandler ( "addzombie", addZombieToSpot ) -- ADD ZOMBIE GUI addEvent ( "addz", true ) function addZgui ( isboss, skin, interior, dimension, level, maxhp, name ) if ( skin and interior and dimension and level and maxhp ) then local rot = math.random ( 1, 359 ) local sx,sy,sz = getElementPosition ( SPOT [ currentSpot ] ) local sortZombies = ( RADIUS / 1.2 ) local zom = exports.zombies:createZombie ( sx + math.random ( -sortZombies, sortZombies ),sy + math.random ( -sortZombies, sortZombies ), sz + 10, rot, skin, interior, dimension, level, maxhp, isboss ) if ( zom ) then table.insert ( ZOMBIESINSPOT, zom ) setElementData ( zom, "zombieSpot", SPOT [ currentSpot ] ) if ( name == "" ) then outputChatBox ( "You have added '" .. getElementData ( zom, "name" ) .. "' to spot[" .. currentSpot .. "]", source ) else outputChatBox ( "You have added '" .. name .. "' to spot[" .. currentSpot .. "]", source ) setElementData ( zom, "name", name ) end else outputChatBox ( "Failed to create spot!", source ) end end end addEventHandler( "addz", root, addZgui ) function destroySpot ( source, command, spotToDestroy ) if ( command == "destroyspot" ) then if ( currentSpot ) then if ( not spotToDestroy ) then spotToDestroy = currentSpot currentSpotElem = SPOT [ currentSpot ] end local currentSpotElem = SPOT [ tonumber ( spotToDestroy ) ] if ( currentSpotElem and spotToDestroy ) then destroyElement ( currentSpotElem ) table.remove ( SPOT, spotToDestroy ) COUNT = ( COUNT - 1 ) outputChatBox ( "You have destroyed SPOT[" .. spotToDestroy .. "]", source ) playSoundFrontEnd ( source, 41 ) else outputChatBox ( "SPOT[" .. spotToDestroy .. "] doesnt exist.", source ) playSoundFrontEnd ( source, 41 ) end end end end addCommandHandler ( "destroyspot", destroySpot ) function outputClick ( mouseButton, buttonState, clickedElement, worldPosX, worldPosY, worldPosZ, screenPosX, screenPosY ) if ( mouseButton == "right" and buttonState == "down" ) then local file = fileOpen ( "spots.lua", false ) fileSetPos ( file, fileGetSize ( file ) ) COUNT = ( COUNT + 1 ) local written = fileWrite ( file, '\n\r\nspot[' .. COUNT .. '] = createZombieSpot(' .. worldPosX .. ", " .. worldPosY .. ", " .. worldPosZ .. ", " .. RADIUS .. " )\r\n" ) if ( written ) then outputChatBox ( "You have created SPOT[" .. COUNT .. "]", source ) playSoundFrontEnd ( source, 41 ) end --SPOT [ COUNT ] = createColSphere ( worldPosX, worldPosY, worldPosZ, RADIUS ) SPOT [ COUNT ], radius = exports.zombies:createZombieSpot ( worldPosX, worldPosY, worldPosZ, RADIUS ) setElementData ( SPOT [ COUNT ], "radius", radius ) --setElementData ( SPOT [ COUNT ], "count", COUNT ) currentSpot = COUNT fileFlush ( file ) end end addEventHandler ( "onPlayerClick", getRootElement(), outputClick ) function markSpot ( ) local spot = SPOT local currentspot = currentSpot local zombiesinspot = ZOMBIESINSPOT triggerClientEvent ( "markSpotC", root, spot, currentspot, zombiesinspot ) end setTimer ( markSpot, 50, 0 ) --DESTROYS CREATED ZOMBIES BY SPOT MANAGER function Zomb_delete ( ped ) if isElement ( ped ) then if ( getElementData ( ped, "zombie") == true ) then for theKey, thePed in ipairs ( ZOMBIESINSPOT ) do if ( ped == thePed ) then table.remove ( ZOMBIESINSPOT, theKey ) break end end destroyElement ( ped ) end end end addEventHandler ( "onResourceStop", resourceRoot, function ( ) for k,zombie in ipairs ( ZOMBIESINSPOT ) do --table.remove( ZOMBIESINSPOT, k ) Zomb_delete ( zombie ) end end ) Le agregue unos "if" para saber si el zombie fue creado o no.
-
Podrias crear una tabla con los vehiculos y luego checkeas si ese vehiculo tiene X element data.
-
local randomSpawnTable = { { 1086.6645507813, 1076.1888427734, 10.838157653809,}, { -2086.9196777344, 173.74137878418, 35.0546875 }, { -2667.5134277344, 734.33197021484, 27.953125 }, { -2497.6953125, -697.30908203125, 139.3203125 }, { -2333.6032714844, -1621.1364746094, 483.71069335938 }, { 1862.423828125, 2624.6528320313, 13.8719085693 } } function Bot ( ) local random = math.random ( #randomSpawnTable ) local x, y, z = unpack ( randomSpawnTable [ random ] ) slothbot = exports [ "slothbot" ]:spawnBot ( x, y, z, 90, math.random ( 300, 303 ), 0, 0, Boss, 38, hunting, true ) exports.extrahealth:setElementExtraHealth ( slothbot, 5000 ) end addEventHandler ( "onResourceStart", resourceRoot, Bot )
-
Parecer estarlo, lo unico, no creo que la vida extra te funcione, ese recurso tiene algun tipo de problema.