Jump to content

General Discussion


Recommended Posts

addEventHandler ( "onPlayerWasted", root, 
    function ( ) 
        local account = getPlayerAccount ( source ) 
        if ( account and not isGuestAccount ( account ) ) then 
            for slot = 1, 12 do 
                setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) 
                setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) 
            end 
        end 
    end 
) 
  
addEventHandler ( "onPlayerSpawn", root, 
    function ( ) 
        local account = getPlayerAccount ( source ) 
        if ( account and not isGuestAccount ( account ) ) then 
            for slot = 1, 12 do 
                local wep = getAccountData ( account, "save-wep".. slot ) 
                local ammo = getAccountData ( account, "save-ammo".. slot ) 
                giveWeapon ( source, wep, ammo ) 
            end 
        end 
    end 
) 

Zidha fel script mte3ek w na7i line 3+4+9

Link to comment
  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

sayé.

https://wiki.multitheftauto.com/wiki/OnPlayerSpawn

kifeh nesta3mel lparameters

fel exemple kol mjoueur yspawni ijih sout

function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) 
    -- play a frontend sound for him 
    playSoundFrontEnd ( source, 16 ) 
end 
-- add the player_Spawn function as a handler for onPlayerSpawn 
addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) 

eni n7ebha ken par ex ken ki yespawni lhné -2655.1,639.46,14.454

Link to comment
function playerSpawn (posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension) 
if (posX == -2655.1 and posY == 639.46 and posZ == 14.454) then 
playSoundFrontEnd ( source, 16 ) 
end 
addEventHandler("onPlayerSpawn", root, playerSpawn) 

Edited by Guest
Link to comment
  • 2 weeks later...
  • 4 weeks later...
  • 3 weeks later...

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