Jump to content

Ayuda con un Spawn


AlvareZ_

Recommended Posts

Posted

Bueno lo siguiente es que quiere realisar un spawn al hacer la windown deveria de ponerle las funciones para q spawnee alguien me podria dar un efemplo o como ponerlo porfa bueno miren es asi:

function spawnPlayer () 
    spawnPlayer (thePlayer, 0, 0, 5, 0, 29, 0, 0, spawnTeam) 
    fadeCamera (source, true) 
    setCameraTarget (source, source) 
end 
addEventHandler ( "onClientGUIClick", boton, spawnPlayer, false ) 

Seria asi o como? Ayuda porfavor, Apenas ando aprendiendo

bandera_de_Venezuela.png

Posted

Primero: Nunca llames una funcion como una que ya existe, a menos que la quieras remplazar.

Segundo: spawnPlayer es una funcion solo server side, no existe client side.

Tercero: Para hacer esto vas a tener que usar triggerServerEvent y spawnearlo server side.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
    function hola () 
        spawnPlayer (thePlayer, 0, 0, 5, 0, 29, 0, 0, spawnTeam) 
        fadeCamera (source, true) 
        setCameraTarget (source, source) 
    end 
    addEventHandler ( "onPlayerSpawn", getRootElement(), hola ) 
    addEventHandler( "onPlayerSpawn", getRootElement(), hola ) 

asi como va?

bandera_de_Venezuela.png

Posted
function hola ( ) 
    spawnPlayer ( source, 0, 0, 5, 0, 29, 0, 0 ) 
    fadeCamera ( source, true ) 
    setCameraTarget ( source, source ) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), hola ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Lo mismo que habias hecho al principio, pero usando triggerServerEvent para spawnearlo server side.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (edited)
     function hola ( ) 
        spawnPlayer ( source, 0, 0, 5, 0, 29, 0, 0 ) 
        fadeCamera ( source, true ) 
        setCameraTarget ( source, source ) 
    end 
    addEventHandler ( "onPlayerSpawn", getRootElement(), hola ) 
    triggerServerEvent ( "onPlayerClick", getRootElement(), "Police")  

Edited by Guest

bandera_de_Venezuela.png

Posted

Lo cree pero hay algo malo q pasa?

GUIEditor = { 
  
    button = {}, 
  
    window = {}, 
  
} 
  
  
GUIEditor.window[1] = guiCreateWindow(721, 115, 487, 460, "Spawn Windown", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
  
  
GUIEditor.button[1] = guiCreateButton(24, 60, 113, 67, "Police", false, GUIEditor.window[1]) 
  
  
function hola ( ) 
    spawnPlayer ( source, 2294.6958007813, 2451.6042480469, 10.8203125, 0, 29, 0, 0 ) 
    fadeCamera ( source, true ) 
    setCameraTarget ( source, source ) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), hola ) 
triggerServerEvent ( "onPlayerClick", getRootElement(), GUIEditor.button[1])  

bandera_de_Venezuela.png

Posted

Prueba esto:

Client:

GUIEditor = { 
    button = {}, 
    window = {}, 
 } 
  
function panel() 
  
    GUIEditor.window[1] = guiCreateWindow(721, 115, 487, 460, "Spawn Windown", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
  
    GUIEditor.button[1] = guiCreateButton(24, 60, 113, 67, "Police", false, GUIEditor.window[1]) 
end 
addEvent("onClick",true) 
addEventHandler("onClick",getRootElement(),panel) 
  
function toggleVisible (  ) 
    guiSetVisible ( GUIEditor.window[1] , not guiGetVisible(GUIEditor.window[1]) ) 
end 
bindKey( "F2", "down", toggleVisible) 

Server:

function hola(source) 
    spawnPlayer ( source, 2294.6958007813, 2451.6042480469, 10.8203125, 0, 29, 0, 0 ) 
    fadeCamera ( source, true ) 
    setCameraTarget ( source, source ) 
    if source then 
        triggerClientEvent("onClick",getRootElement(),hola) 
    end 
end 

430x73.png

430x73.png

Posted

No te ofendas, pero no tiene sentido eso, Xperia.

-- client side:

GUIEditor = { 
    button = {}, 
    window = {}, 
 } 
  
GUIEditor.window[1] = guiCreateWindow(721, 115, 487, 460, "Spawn Windown", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible ( GUIEditor.window[1], false ) 
GUIEditor.button[1] = guiCreateButton(24, 60, 113, 67, "Police", false, GUIEditor.window[1]) 
  
function panel ( ) 
    if ( source == GUIEditor.button[1] ) then 
        triggerServerEvent ( "spawnPolice", localPlayer ) 
    end 
end 
addEventHandler("onClientGUIClick",guiRoot,panel) 
  
function toggleVisible (  ) 
    guiSetVisible ( GUIEditor.window[1] , not guiGetVisible(GUIEditor.window[1]) ) 
end 
bindKey( "F2", "down", toggleVisible) 

-- server side.

function hola ( ) 
    spawnPlayer ( source, 2294.6958007813, 2451.6042480469, 10.8203125, 0, 29, 0, 0 ) 
    fadeCamera ( source, true ) 
    setCameraTarget ( source, source ) 
end 
addEvent ( "spawnPolice", true ) 
addEventHandler ( "spawnPolice", root, hola ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Muchas gracias a los dos por ayudarme, Bueno solo me faltaria el cursor y la camara y q sea a el entrar el player pero de eso me encargo yo, si tengo otra duda posteo aca o nuevo post

Gracias por ayudarme

bandera_de_Venezuela.png

  • 1 year later...
Posted

Jajajajaja

haha el soy sincero eso lo coji de un script q se me guardo de colombia gangs xq? xD si hay algun problema busco otro metodo

AlvareZ puto xD The Gang Colombia Wars era mi server :P

PD: lo de puto es en juego.

|El Sabio no tiene intereses propios, hace suyos los intereses del pueblo|

(scripting= -20%)

n-560x95_2B9E08_0AFA4E_000000_030000.png

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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