Jump to content

Spawn


Recommended Posts

function loadAccounts () 
    local serial = getPlayerSerial ( source ) 
    local result = mysql_query ( database ,"SELECT * FROM `accounts` WHERE `serial` = '"..serial.."'") 
    if result then 
        while true do 
            local row = mysql_fetch_assoc(result) 
            if not row then break end 
            spawnPlayer( source, row.x, row.y, row.z) 
            setElementInterior ( source, row.intterior ) 
            setElementDimension ( source, row.demension ) 
            setPedSkin ( source, row.skin ) 
            setPlayerMoney ( source, row.money ) 
            setElementHealth ( source, row.health) 
            setPedArmor ( source, row.armor ) 
            setPlayerWantedLevel ( source, row.wanted ) 
            outputChatBox ('You were warped at latest position',source,255,255,255,true) 
            break 
        end 
    end 
end 
addEventHandler ( "onPlayerLogin", getRootElement(), loadAccounts ) 

Hi. I don't own this scripts so all rights to author. Why when it spawn me i'm frozen ?

Link to comment
function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) 
    setElementData( source, "Protection", true ) 
    setElementAlpha( source, 125 ) 
        setTimer(  
        function() 
        setElementData( source, "Protection", false ) 
        setElementAlpha( source, 255 ) 
        end 
        , 1000, 1) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) 

why is source nil ?

Link to comment
function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) 
    setElementData( source, "Protection", true ) 
    setElementAlpha( source, 125 ) 
    setTimer ( 
        function ( player ) 
            if ( player ) then 
                setElementData ( player, "Protection", false ) 
                setElementAlpha ( player, 255 ) 
            end 
        end 
        ,1000, 1, source 
    ) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) 

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...