-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Yes, the whole acl.xml.
-
Post your ACL.xml code with the LUA tags.
-
Have you registered an account by joining the server and doing: /register Then: /login did you do that?
-
No es tan facil, vas a tener que crearte tu propio sistema de "nametags". O talvez puedas usar este recurso: https://community.multitheftauto.com/index.php?p= ... ls&id=3090 Que yo sepa crea textos en 3D.
-
Deberias usar la wiki, ahi te explica casi todo. https://wiki.multitheftauto.com/wiki/OnPlayerJoin
-
g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex ) if skinIndex then local class = classGroups[ categoryIndex ].classes[ classIndex ]; local skin = class.skinMngr.skins[ skinIndex ]; local spawn = true; local spawned; --[[if not classGroups[ cetegoryIndex ].owner then -- if there is NO owner of the clan/gang spawn player spawn = true; else -- if there IS owner of the clan/gang then check if he's member of the clan/gang end]] if spawn then if not class.team then class.team = createTeam( class.name, class.color.red, class.color.green, class.color.blue ); end local plrTeam = getPlayerTeam( client ); if ( ( isElement(plrTeam) ) and ( plrTeam == class.team ) and ( countPlayersInTeam( plrTeam ) == 1 ) ) then destroyElement( plrTeam ); end spawned = spawnPlayer( client, skin.spawnLoc.x, skin.spawnLoc.y, skin.spawnLoc.z, skin.spawnLoc.rot, skin.modelId, 0, 0, class.team ); end if spawned then setElementData( client, "team", class.name ) fadeCamera( client, true ); setCameraTarget( client, client ); setTimer( setCameraTarget, 200, 1, client, client ); triggerClientEvent( client, "spawn_SpawnedSuccessfully", client ); --setPlayerMoney( client, 500 ); for _, weapon in ipairs( class.weaponMngr.weapons ) do giveWeapon( client, weapon.id, weapon.ammo, false ); end createBlipAttachedTo( client, 0, 2, class.color.red, class.color.green, class.color.blue ) else triggerClientEvent( client, "spawn_FailedToSpawn", client ); if countPlayersInTeam( class.team ) == 0 then class.team = nil; end end end end ); addEventHandler( "onPlayerSpawn", g_root, function ( ) end ); addEventHandler( "onPlayerWasted", g_root, function( ) fadeCamera( source, false, 4 ); setTimer( requestMenu, 5000, 1, source ); deleteAllPlayerBlips( source ) end ); function requestMenu( player ) callClientFunc( player, "showSpawnMenu", true, true ); callClientFunc( player, "classSelected" ); end addCommandHandler( "kill", function( plr ) killPed( plr ); end ) function preloadClassesInfo( ) local groups = getElementsByType( "category" ); for _, group in ipairs( groups ) do table.insert( classGroups, Group:New( group ) ); end end addEventHandler( "onResourceStart", getResourceRootElement(), preloadClassesInfo ) function deleteAllPlayerBlips(player) if (not player) then return end local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (element and getElementType(element) == "blip") then destroyElement(element) end end end end addEventHandler( "onPlayerQuit", g_root, function() deleteAllPlayerBlips(source) end ); ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ function callClientFunc( player, funcName, ... ) if #{ ... } ~= 0 then triggerClientEvent( player, "_clientCallFunction", root, funcName, ... ) else triggerClientEvent( player, "_clientCallFunction", root, funcName ) end end addEvent( "_serverCallFunction", true ) addEventHandler( "_serverCallFunction", root, function( funcName, ... ) _G[ funcName ](...) end )
-
Read the server manual: https://wiki.multitheftauto.com/wiki/Ser ... our_server It explains how to add yourself as an Admin.
-
Compare your line 42 (in the post behind mine) with mine. Yours: if (playerMoney, playerSkin) then -- You can't use a comma, you must use "and". Mine: if (playerMoney and playerSkin) then
-
For me it said this: "*This map has a rate of 8!" That's the rate I set manually to the map in the sqlite table. P.S: I think to get the amount of players who rated it you must use: theMapRate.count
-
You've joined via your local IP? if so, the script can't get the country from it, because it's local. If it's hamachi, it's the same thing. Try joining from your GLOBAL IP, you can know it via: http://whatismyip.com
-
function joinHandler ( ) --spawnPlayer (source, -1969.2669677734, 137.71185302734, 30, 0, skin, 0) spawnPlayer (source, -1969.2669677734, 137.71185302734, 30, 0, 0, 0) fadeCamera (source, true) setCameraTarget ( source, source ) end addEventHandler ( "onPlayerJoin" , getRootElement ( ) , joinHandler ) function spawnWasted(player, skin) repeat until spawnPlayer ( player, -2655.02, 625.30, 14.45, 180, skin, 0) fadeCamera(player, true) setCameraTarget(player, player) end addEventHandler("onPlayerWasted", root, function() setTimer(spawnWasted, 1800, 1, source, getElementModel(source)) end ) function greetPlayer ( ) outputChatBox ( "Witaj na Polskim Serwerze Zabawy stworzonym przez Mefisto_PL !" , source, 0, 159, 255 ) end addEventHandler ( "onPlayerLogin", getRootElement(), greetPlayer ) function onPlayerQuit() local playerAccount = getPlayerAccount(source) if (playerAccount) and not isGuestAccount(playerAccount) then local playerMoney = getPlayerMoney(source) local playerSkin = getElementModel(source) setAccountData(playerAccount, "money", playerMoney) setAccountData(playerAccount, "skin", playerSkin) end end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit) function onPlayerLogin() local playerAccount = getPlayerAccount(source) if (playerAccount) then local playerMoney = tonumber(getAccountData(playerAccount, "money")) local playerSkin = tonumber(getAccountData(playerAccount, "skin")) if (playerMoney and playerSkin) then setPlayerMoney(source, playerMoney) setElementModel(source, playerSkin) end end end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin)
-
addEventHandler('onGamemodeMapStart', root, function( theMapStarts ) setTimer(function () local mapName = getMapName( ) if (mapName and mapName ~= "None") then local theMapRate = exports["mapratings"]:getMapRating( mapName ) outputChatBox ( "#CC0000*This map has a rate of ".. tostring(theMapRate.average) .."!", getRootElement(), 255,255,255, true ) -- The value returned by getMapRatings is a TABLE. else outputChatBox( "can't get map name" ) end end, 1000, 1) end )
-
addEventHandler("onPlayerJoin",root, local country = exports["admin"]:getPlayerCountry(source) setElementData(source,"Country",country) outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) end )
-
local spawnX, spawnY, spawnZ = -205.10800170898, 1119.1826171875, 19.7421875 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ, 0, 26) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("---------------------------", source) outputChatBox("---------Server Rol Play---", source) outputChatBox("--Dueño: Andres_Escudero---", source) outputChatBox("---------------------------", source) outputChatBox ( "#FF0000Recuerda Registrarte usando /register [Contraseña]", getRootElement(), 255, 255, 255, true ) outputChatBox(" #00FF00Recuerda Loguearte usando /login [Contraseña]", getRootElement(), 255, 255, 255, true ) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) addEventHandler( "onPlayerWasted", getRootElement( ), function() local skin = getElementModel(source) setTimer( spawnPlayer, 4000, 1, source, -316.30599975586, 1055.4377441406, 19.7421875, 0, skin ) outputChatBox(" #FF0000 Te has desmallado y te hemos traido al hospital de Ford Carson", source, 255, 255, 255, true ) outputChatBox(" #FF0000 Y te hemos cobrado #00FF00$100#FF0000 Por la atencion Medica", source, 255, 255, 255, true ) takePlayerMoney ( source, 100 ) end )
-
You mean the vehicle get's created but "race" destroys it just after?
-
You're welcome .
-
-- -------------------------------------------------------- -- [x] Author: Stanley Sathler -- [x] Function: Spawn vehicle on map -- [X] Group: |MS-13| Mara Salvatrucha -- -------------------------------------------------------- local playerVehicles = {} function SpawnTheVehicle(model) if isElement(playerVehicles[source]) then destroyElement(playerVehicles[source]) end playerVehicles[source] = createVehicle(tonumber(model), 1597, -1705, 5) setVehicleColor(playerVehicles[source], 0) warpPedIntoVehicle(source, playerVehicles[source]) end addEvent("SpawnVehicleOnMap", true) addEventHandler("SpawnVehicleOnMap", getRootElement(), SpawnTheVehicle)
-
You're showing everything but the needed, post your server-side script.
-
You're welcome . Good night then .
-
addEventHandler( "onResourceStart", resourceRoot, function( ) local key = dbConnect( "sqlite", "Storedinfo.db" ) dbFree ( dbQuery ( key, "CREATE TABLE IF NOT EXISTS teleports ( teleportID, aX, aY, aZ, aInterior, aDimension, bX, bY, bZ,bInterior, bDimension )")) local result = dbPoll(dbQuery(key, "SELECT * FROM teleports" ),-1) -- You forgot about dbPoll. for key, value in ipairs( result ) do dbQuery( value,"(teleportID, value.aX, value.aY, value.aZ, value.aInterior, value.aDimension, value.bX, value.bY, value.bZ, value.bInterior, value.bDimension)" ) -- What is this ? end end )
-
De nada. P.D: Intenta aprender del codigo .
-
addCommandHandler("estrellas", function (thePlayer, commandName, who, estrellas) if (who == nil or who == "") then return end -- Verificamos si introdujo el nombre del jugador, si no es asi cancelamos la funcion. local playerWho = getPlayerFromName(who) -- Buscamos el jugador por el nombre. if (not playerWho) then outputChatBox("Este jugador no existe.",thePlayer,255,0,0) return end -- Si el jugador no existe le enviamos un mensaje. if (not tonumber(estrellas)) then return end -- Verificamos si las "estrellas" que introdujo son un numero, si no es asi cancelamos la funcion. if (tonumber(estrellas) < 0 or tonumber(estrellas) > 6) then outputChatBox("Solo puedes dar estrellas de 0 a 6.",thePlayer,255,0,0) return end -- Si las estrellas que introdujo son mayores que 6 o menores que 0 cancelamos la funcion. setPlayerWantedLevel(playerWho, tonumber(estrellas)) -- Le damos las estrellas al jugador que introdujo. outputChatBox("Has cambiado el nivel de busqueda de ".. tostring(getPlayerName(playerWho)) .." a ".. tostring(estrellas) ..".",thePlayer,0,255,0) -- Le enviamos un mensaje al jugador. end) Es server-side.
-
Set it to 1 to constantly stream zombies.
-
In the meta.xml: <setting name="*StreamMethod" value="[1]" /> <!-- 1 to constantly stream zombies, 0 to only allow zombies to spawn via createZombie function, 2 to only
-
local fuelRoot = createElement( "fuelpoint" ) addEventHandler( "onResourceStart", resourceRoot, function( ) local server = dbConnect( "sqlite", "Storedinfo.db" ) dbExec ( server , "CREATE TABLE IF NOT EXISTS fuelpoints ( fuelpointID, posX, posY, posZ, name)") local result = dbPoll(dbQuery(server, "SELECT * FROM fuelpoints"),-1) if result and #result > 0 then for index, value in pairs( result ) do -- Missing "in". local colshape = createColSphere( value.posX, value.posY, value.posZ, 2 ) setElementParent( colshape, fuelRoot ) setElementData( colshape, "name", tonumber( value.name ) or value.name ) end end end )
