Jump to content

Spawn


Recommended Posts

Posted
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 ?

Posted

Must be another script which freezes the player on spawn.

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

Posted
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 ) 

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

You're welcome.

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

What do you mean by query handlers? you mean MySQL functions? if so, then here's Ryden's module functions:

https://wiki.multitheftauto.com/wiki/Mysql

And this ones are the MTA built-on MySQL functions:

dbConnect 
dbExec 
dbQuery 
dbPoll 
dbFree 

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.

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