Jump to content

No sirvio/Arma exclusivo para team


Soren

Recommended Posts

hola a todos quiero hacer que un arma sea exclusivamente para un team aqui tengo el script que practicamente Solidsnake14 me hiso xD

Server:

local teams = { 
    {getTeamFromName("Aliens"), {13, 22, 23}, {0, 0, 5}}, -- 0, 0, 0 = la posicion. 
    {getTeamFromName("Humans"), {1, 2, 3}, {0, 0, 5}}, 
} 
  
addEventHandler("onPlayerLogin",root, 
function () 
    local team, skins, position = unpack(teams[math.random(#teams)]) 
    if (team and skins and position) then 
        setPlayerTeam(source, team) 
        setElementModel(source, skins[math.random(#skins)]) 
        spawnPlayer(source, unpack(position)) 
    end 
end) 

Client:

    local skinTXD = engineLoadTXD ( "skins/13.txd" ) --Alien by iSoRen 
    engineImportTXD ( skinTXD , 13 ) 
    local skinDFF = engineLoadDFF("skins/13.dff", 0 ) 
    engineReplaceModel(skinDFF , 13) 
    local skin2TXD = engineLoadTXD ( "skins/22.txd" ) -- Alien Boss by iSoRen 
    engineImportTXD ( skin2TXD , 22 ) 
    local skinDFF = engineLoadDFF("skins/22.dff", 0 ) 
    engineReplaceModel(skinDFF , 22) 
    local skin2TXD = engineLoadTXD ( "skins/23.txd" ) -- Chewbacka 
    engineImportTXD ( skin2TXD , 23 ) 
    local skin2DFF = engineLoadDFF("skins/23.dff", 0 ) 
    engineReplaceModel(skin2DFF , 23) 
    local skinTXD = engineLoadTXD ( "skins/1.txd" ) --Stormtrooper 
    engineImportTXD ( skinTXD , 1 ) 
    local skinDFF = engineLoadDFF("skins/1.dff", 0 ) 
    engineReplaceModel(skinDFF , 1) 
    local skin2TXD = engineLoadTXD ( "skins/2.txd" ) --Darth Vader 
    engineImportTXD ( skin2TXD , 2 ) 
    local skin2DFF = engineLoadDFF("skins/2.dff", 0 ) 
    engineReplaceModel(skin2DFF , 2) 
    local skin2TXD = engineLoadTXD ( "skins/3.txd" ) -- Red Stormtroper 
    engineImportTXD ( skin2TXD , 3 ) 
    local skinDFF = engineLoadDFF("skins/3.dff", 0 ) 
    engineReplaceModel(skinDFF , 3) 
end 

Meta:

<meta> 
    <info author="iSoRen" description="Random and replace skin" type="script" /> 
    <script src="Random.lua" /> 
    <script src="Skins.lua" type="client" /> 
    <file src="Skins/1.txd" /> 
    <file src="Skins/1.dff" /> 
    <file src="Skins/2.txd" /> 
    <file src="Skins/2.dff" /> 
    <file src="Skins/3.txd" /> 
    <file src="Skins/3.dff" /> 
    <file src="Skins/22.txd" /> 
    <file src="Skins/22.dff" /> 
    <file src="Skins/13.txd" /> 
    <file src="Skins/13.dff" /> 
    <file src="Skins/23.txd" /> 
    <file src="Skins/23.dff" /> 
</meta> 

Cuando me logee no me dio team random tmb no remplazo los script pero la consola no me dijo nada me lo acepto bien

Que tiene mal el script?

Link to comment

@pekio: Ese script es SERVER SIDE, si lo pone como client side no va a funcionar.

@Soren: El script client side esta mal.

-- client side:

addEventHandler("onClientResourceStart",resourceRoot, 
function () 
   local skinTXD = engineLoadTXD ( "skins/13.txd" ) --Alien by iSoRen 
    engineImportTXD ( skinTXD , 13 ) 
    local skinDFF = engineLoadDFF("skins/13.dff", 0 ) 
    engineReplaceModel(skinDFF , 13) 
    local skin2TXD = engineLoadTXD ( "skins/22.txd" ) -- Alien Boss by iSoRen 
    engineImportTXD ( skin2TXD , 22 ) 
    local skinDFF = engineLoadDFF("skins/22.dff", 0 ) 
    engineReplaceModel(skinDFF , 22) 
    local skin2TXD = engineLoadTXD ( "skins/23.txd" ) -- Chewbacka 
    engineImportTXD ( skin2TXD , 23 ) 
    local skin2DFF = engineLoadDFF("skins/23.dff", 0 ) 
    engineReplaceModel(skin2DFF , 23) 
    local skinTXD = engineLoadTXD ( "skins/1.txd" ) --Stormtrooper 
    engineImportTXD ( skinTXD , 1 ) 
    local skinDFF = engineLoadDFF("skins/1.dff", 0 ) 
    engineReplaceModel(skinDFF , 1) 
    local skin2TXD = engineLoadTXD ( "skins/2.txd" ) --Darth Vader 
    engineImportTXD ( skin2TXD , 2 ) 
    local skin2DFF = engineLoadDFF("skins/2.dff", 0 ) 
    engineReplaceModel(skin2DFF , 2) 
    local skin2TXD = engineLoadTXD ( "skins/3.txd" ) -- Red Stormtroper 
    engineImportTXD ( skin2TXD , 3 ) 
    local skinDFF = engineLoadDFF("skins/3.dff", 0 ) 
    engineReplaceModel(skinDFF , 3) 
end) 

Link to comment
@pekio: Ese script es SERVER SIDE, si lo pone como client side no va a funcionar.

@Soren: El script client side esta mal.

-- client side:

addEventHandler("onClientResourceStart",resourceRoot, 
function () 
   local skinTXD = engineLoadTXD ( "skins/13.txd" ) --Alien by iSoRen 
    engineImportTXD ( skinTXD , 13 ) 
    local skinDFF = engineLoadDFF("skins/13.dff", 0 ) 
    engineReplaceModel(skinDFF , 13) 
    local skin2TXD = engineLoadTXD ( "skins/22.txd" ) -- Alien Boss by iSoRen 
    engineImportTXD ( skin2TXD , 22 ) 
    local skinDFF = engineLoadDFF("skins/22.dff", 0 ) 
    engineReplaceModel(skinDFF , 22) 
    local skin2TXD = engineLoadTXD ( "skins/23.txd" ) -- Chewbacka 
    engineImportTXD ( skin2TXD , 23 ) 
    local skin2DFF = engineLoadDFF("skins/23.dff", 0 ) 
    engineReplaceModel(skin2DFF , 23) 
    local skinTXD = engineLoadTXD ( "skins/1.txd" ) --Stormtrooper 
    engineImportTXD ( skinTXD , 1 ) 
    local skinDFF = engineLoadDFF("skins/1.dff", 0 ) 
    engineReplaceModel(skinDFF , 1) 
    local skin2TXD = engineLoadTXD ( "skins/2.txd" ) --Darth Vader 
    engineImportTXD ( skin2TXD , 2 ) 
    local skin2DFF = engineLoadDFF("skins/2.dff", 0 ) 
    engineReplaceModel(skin2DFF , 2) 
    local skin2TXD = engineLoadTXD ( "skins/3.txd" ) -- Red Stormtroper 
    engineImportTXD ( skin2TXD , 3 ) 
    local skinDFF = engineLoadDFF("skins/3.dff", 0 ) 
    engineReplaceModel(skinDFF , 3) 
end) 

Pero que me dices del Random.lua ( el que practicamente me hisiste tu) y como podria poner armas exlclusivas para cada team

Link to comment
local teams = { 
    {getTeamFromName("Aliens"), {13, 22, 23}, {0, 0, 5}, {[31] = 500, [24] = 200}}, -- 0, 0, 0 = la posicion. 
    {getTeamFromName("Humans"), {1, 2, 3}, {0, 0, 5}, {[30] = 700, [25] = 300}}, 
} 
  
addEventHandler("onPlayerLogin",root, 
function () 
    local team, skins, position, weapons = unpack(teams[math.random(#teams)]) 
    if (team and skins and position and weapons) then 
        setPlayerTeam(source, team) 
        setElementModel(source, skins[math.random(#skins)]) 
        spawnPlayer(source, unpack(position)) 
        for weapon, ammo in pairs(weapons) do 
            giveWeapon(source, weapon, ammo, true) 
        end 
    end 
end) 

Link to comment
local teams = { 
    {getTeamFromName("Aliens"), {13, 22, 23}, {0, 0, 5}, {[31] = 500, [24] = 200}}, -- 0, 0, 0 = la posicion. 
    {getTeamFromName("Humans"), {1, 2, 3}, {0, 0, 5}, {[30] = 700, [25] = 300}}, 
} 
  
addEventHandler("onPlayerLogin",root, 
function () 
    local team, skins, position, weapons = unpack(teams[math.random(#teams)]) 
    if (team and skins and position and weapons) then 
        setPlayerTeam(source, team) 
        setElementModel(source, skins[math.random(#skins)]) 
        spawnPlayer(source, unpack(position)) 
        for weapon, ammo in pairs(weapons) do 
            giveWeapon(source, weapon, ammo, true) 
        end 
    end 
end) 

Script ERROR: Random_Teams\Random.lua:15: 'end' expected near '

Link to comment
No es de ese script, lo probe y funciona perfectamente.

No sera que en el script tengo que crear tmb los teams?

local newTeam = { 
        createTeam ( "Aliens" ) 
    createTeam ( "Humans" ) 
} 
  
local teams = { 
    {getTeamFromName("Aliens"), {13, 22, 23}, {0, 0, 5}, {[31] = 500, [24] = 200}}, -- 0, 0, 0 = la posicion. 
    {getTeamFromName("Humans"), {1, 2, 3}, {0, 0, 5}, {[30] = 700, [25] = 300}}, 
} 
  
addEventHandler("onPlayerLogin",root, 
function () 
    local team, skins, position, weapons = unpack(teams[math.random(#teams)]) 
    if (team and skins and position and weapons) then 
        setPlayerTeam(source, team) 
        setElementModel(source, skins[math.random(#skins)]) 
        spawnPlayer(source, unpack(position)) 
        for weapon, ammo in pairs(weapons) do 
            giveWeapon(source, weapon, ammo, true) 
        end 
    end 

Link to comment
local teams = { 
    {createTeam("Aliens"), {13, 22, 23}, {0, 0, 5}, {[31] = 500, [24] = 200}}, -- 0, 0, 0 = la posicion. 
    {createTeam("Humans"), {1, 2, 3}, {0, 0, 5}, {[30] = 700, [25] = 300}}, 
} 
  
addEventHandler("onPlayerLogin",root, 
function () 
    local team, skins, position, weapons = unpack(teams[math.random(#teams)]) 
    if (team and skins and position and weapons) then 
        setPlayerTeam(source, team) 
        setElementModel(source, skins[math.random(#skins)]) 
        spawnPlayer(source, unpack(position)) 
        for weapon, ammo in pairs(weapons) do 
            giveWeapon(source, weapon, ammo, true) 
        end 
    end 
end) 

Link to comment
local teams = { 
    {createTeam("Aliens"), {13, 22, 23}, {0, 0, 5}, {[31] = 500, [24] = 200}}, -- 0, 0, 0 = la posicion. 
    {createTeam("Humans"), {1, 2, 3}, {0, 0, 5}, {[30] = 700, [25] = 300}}, 
} 
  
addEventHandler("onPlayerLogin",root, 
function () 
    local team, skins, position, weapons = unpack(teams[math.random(#teams)]) 
    if (team and skins and position and weapons) then 
        setPlayerTeam(source, team) 
        setElementModel(source, skins[math.random(#skins)]) 
        spawnPlayer(source, unpack(position)) 
        for weapon, ammo in pairs(weapons) do 
            giveWeapon(source, weapon, ammo, true) 
        end 
    end 
end) 

La consola me dice esto

Script ERROR: Random_Teams\Random.lua:16: 'end' expected <to close 'function' at line 7> near <eof> 
WARNING: Loading script failed: Random_Teams\Random.lua:16: 'end' expected <to close 'function' at line 7> near <eof> 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...