Jump to content

[SOLVED]: Register


Electro88

Recommended Posts

i want player register spawn this first code but not working i added onPlayerRegister

function wasted (player) 
        if not isElement(player) then return end 
        local x, y, z = 2192.42578125, -1781.095703125, 313.29595947266 
        local x2, y2, z2 = -1230.02612, 451.12631, 7.18750 
        local x3, y3, z3 = 2815.3291015625, -1461.5537109375, 32.126281738281 
  
        local lvl = tonumber(getElementData(player,"Level") ) 
        if (lvl >= 0) then 
        spawnPlayer (player, x, y, z ) 
        giveWeapon(player, 46) 
        giveWeapon(player, 22,90) 
        setElementModel(player, 0) 
        if (lvl >= 1) then 
        spawnPlayer (player, x2, y2, z2 ) 
        if (lvl >= 15) then 
        spawnPlayer (player, x3, y3, z3 ) 
        fadeCamera( player, true) 
        setCameraTarget( player, player) 
        end 
end 
end 
end 
  
addEventHandler ( "onPlayerWasted", root, function() 
     setTimer(wasted, 5000, 1, source) 
end) 
  
  
  
  
  
  
-- Event Handlers 
  
addEventHandler ( "onPlayerRegister", getRootElement(), wasted) 
  
  
  
  

Edited by Guest
Link to comment
i want player register spawn this first code but not working i added onPlayerRegister
function wasted (player) 
        if not isElement(player) then return end 
        local x, y, z = 2192.42578125, -1781.095703125, 313.29595947266 
        local x2, y2, z2 = -1230.02612, 451.12631, 7.18750 
        local x3, y3, z3 = 2815.3291015625, -1461.5537109375, 32.126281738281 
  
        local lvl = tonumber(getElementData(player,"Level") ) 
        if (lvl >= 0) then 
        spawnPlayer (player, x, y, z ) 
        giveWeapon(player, 46) 
        giveWeapon(player, 22,90) 
        setElementModel(player, 0) 
        if (lvl >= 1) then 
        spawnPlayer (player, x2, y2, z2 ) 
        if (lvl >= 15) then 
        spawnPlayer (player, x3, y3, z3 ) 
        fadeCamera( player, true) 
        setCameraTarget( player, player) 
        end 
end 
end 
end 
  
addEventHandler ( "onPlayerWasted", root, function() 
     setTimer(wasted, 5000, 1, source) 
end) 
  
  
  
  
  
  
-- Event Handlers 
  
addEventHandler ( "onPlayerRegister", getRootElement(), wasted) 
  
  
  
  

what is onPlayerRegister ?

Link to comment

onPlayerLogin*

    function wasted () 
            local player = source 
            if not isElement(player) then return end 
            local x, y, z = 2192.42578125, -1781.095703125, 313.29595947266 
            local x2, y2, z2 = -1230.02612, 451.12631, 7.18750 
            local x3, y3, z3 = 2815.3291015625, -1461.5537109375, 32.126281738281 
      
            local lvl = tonumber(getElementData(player,"Level") ) 
            if (lvl >= 0) then 
            spawnPlayer (player, x, y, z ) 
            giveWeapon(player, 46) 
            giveWeapon(player, 22,90) 
            setElementModel(player, 0) 
            elseif (lvl >= 1) then 
            spawnPlayer (player, x2, y2, z2 ) 
            elseif (lvl >= 15) then 
            spawnPlayer (player, x3, y3, z3 ) 
            fadeCamera( player, true) 
            setCameraTarget( player, player) 
    end 
    end 
    end 
      
    addEventHandler ( "onPlayerWasted", root, function() 
         setTimer(wasted, 5000, 1, source) 
    end) 
      
      
      
      
      
      
    -- Event Handlers 
      
    addEventHandler ( "onPlayerLogin", getRootElement(), wasted) 
  
      

Link to comment
function wasted () 
            local player = source 
            if not isElement(player) then return end 
            local x, y, z = 2192.42578125, -1781.095703125, 313.29595947266 
            local x2, y2, z2 = -1230.02612, 451.12631, 7.18750 
            local x3, y3, z3 = 2815.3291015625, -1461.5537109375, 32.126281738281 
      
            local lvl = tonumber(getElementData(player,"Level") ) 
            if (lvl >= 0) then 
            spawnPlayer (player, x, y, z ) 
            giveWeapon(player, 46) 
            giveWeapon(player, 22,90) 
            setElementModel(player, 0) 
            elseif (lvl >= 1) then 
            spawnPlayer (player, x2, y2, z2 ) 
            elseif (lvl >= 15) then 
            spawnPlayer (player, x3, y3, z3 ) 
            fadeCamera( player, true) 
            setCameraTarget( player, player) 
    end 
    end 
    end 
      
    addEventHandler ( "onPlayerWasted", root, function() 
         setTimer(wasted, 5000, 1, source) 
    end) 
      
      
      
      
      
      
    -- Event Handlers 
      
    addEventHandler ( "onPlayerLogin",root, function() 
  setTimer(wasted, 5000, 1, source) 
    end) 

Link to comment

Try this

function wasted () 
    local player = source 
    if not isElement(player) then return end 
    local x, y, z = 2192.42578125, -1781.095703125, 313.29595947266 
    local x2, y2, z2 = -1230.02612, 451.12631, 7.18750 
    local x3, y3, z3 = 2815.3291015625, -1461.5537109375, 32.126281738281 
    local lvl = tonumber(getElementData(player,"Level")) or 0 
    if (lvl >= 0) then 
        spawnPlayer (player, x, y, z ) 
        giveWeapon(player, 46) 
        giveWeapon(player, 22,90) 
        setElementModel(player, 0) 
    elseif (lvl >= 1) then 
        spawnPlayer (player, x2, y2, z2 ) 
    elseif (lvl >= 15) then 
        spawnPlayer (player, x3, y3, z3 ) 
        fadeCamera( player, true) 
        setCameraTarget( player, player) 
    end 
end 
  
addEventHandler ( "onPlayerWasted", root, function() 
    setTimer(wasted, 5000, 1, source) 
end) 
  
addEventHandler ( "onPlayerLogin", getRootElement(), 
function() 
    wasted() 
end) 

Link to comment
function wasted () 
    local player = source 
    if not isElement(player) then return end 
    local x, y, z = 2192.42578125, -1781.095703125, 313.29595947266 
    local x2, y2, z2 = -1230.02612, 451.12631, 7.18750 
    local x3, y3, z3 = 2815.3291015625, -1461.5537109375, 32.126281738281 
    local lvl = tonumber(getElementData(player,"Level")) or 0 
    if (lvl >= 0) then 
        spawnPlayer (player, x, y, z ) 
        giveWeapon(player, 46) 
        giveWeapon(player, 22,90) 
        setElementModel(player, 0) 
        fadeCamera( player, true) 
        setCameraTarget( player, player) 
    elseif (lvl >= 1) then 
        spawnPlayer (player, x2, y2, z2 ) 
        fadeCamera( player, true) 
        setCameraTarget( player, player) 
    elseif (lvl >= 15) then 
        spawnPlayer (player, x3, y3, z3 ) 
        fadeCamera( player, true) 
        setCameraTarget( player, player) 
    end 
end 
  
addEventHandler ( "onPlayerWasted", root, function() 
    setTimer(wasted, 5000, 1, source) 
end) 
  
addEventHandler ( "onPlayerLogin", getRootElement(), 
function() 
    wasted() 
end) 

Link to comment
function wasted (player) 
            local x, y, z = 2192.42578125, -1781.095703125, 313.29595947266 
            local x2, y2, z2 = -1230.02612, 451.12631, 7.18750 
            local x3, y3, z3 = 2815.3291015625, -1461.5537109375, 32.126281738281 
      
            local lvl = tonumber(getElementData(player,"Level") ) 
            if (lvl >= 0) then 
            spawnPlayer (player, x, y, z ) 
            giveWeapon(player, 46) 
            giveWeapon(player, 22,90) 
            setElementModel(player, 0) 
            elseif (lvl >= 1) then 
            spawnPlayer (player, x2, y2, z2 ) 
            elseif (lvl >= 15) then 
            spawnPlayer (player, x3, y3, z3 ) 
            fadeCamera( player, true) 
            setCameraTarget( player, player) 
    end 
    end 
     
      
   function d () 
         setTimer(wasted, 5000, 1, source) 
    end 
         addEventHandler ( "onPlayerWasted", root, d) 
  
 function login () 
  setTimer(wasted, 5000, 1, source) 
    end 
     addEventHandler ( "onPlayerLogin",root, login) 

Link to comment
i fix it other level spawns but i registered new account i dont spawn i see just screen not spawning how to fix it ah..
  
#Client 
  
addEventHandler("onClientGUIClick",root, function() 
  
if source == Button.register  then 
  
  
triggerServerEvent("spn",localPlayer) 
  
end 
  
end 
  
) 
  
#Server 
  
  
function playerspawn () 
  
spawnPlayer(2815.3291015625, -1461.5537109375, 32.126281738281) 
  
setPlayerSkin(source,46) 
  
end 
  
  
  
addEvent("spn",true) 
  
addEventHandler("spn",root,playerspawn) 
  
  
  
  

Link to comment

Lol... i fix it i need just add fadeCamera and SetCameraTarget :/ thanks all for trying

function wasted (player) 
        if not isElement(player) then return end 
        local x, y, z = 2192.42578125, -1781.095703125, 313.29595947266 
        local x2, y2, z2 = -1230.02612, 451.12631, 7.18750 
        local x3, y3, z3 = 2815.3291015625, -1461.5537109375, 32.126281738281 
  
        local lvl = tonumber(getElementData(player,"Level") ) 
        if (lvl >= 0) then 
        spawnPlayer (player, x, y, z ) 
        fadeCamera( player, true) 
        setCameraTarget( player, player) 
        giveWeapon(player, 46) 
        giveWeapon(player, 22,90) 
        setElementModel(player, 0) 
        if (lvl >= 1) then 
        spawnPlayer (player, x2, y2, z2 ) 
        if (lvl >= 15) then 
        spawnPlayer (player, x3, y3, z3 ) 
        fadeCamera( player, true) 
        setCameraTarget( player, player) 
        end 
end 
end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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