Jump to content

Help me in sample script


E-mail

Recommended Posts

Hi all i want if player Spawn give him weapons after 10 seconde

10 seconde and get the weapons see the script

ServerSide----

function giveWeaponsOnSpawn ( theSpawnpont, theTeam ) 
    giveWeapon ( source, 24, 200 ) 
    giveWeapon ( source, 34, 250 ) 
    setTimer ( giveWeaponsOnSpawn, 1000,)---give The Player the weapons after 10 seconed 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) 

:wink:

Link to comment
  
function giveWeaponsOnSpawn2 ( player ) 
    giveWeapon ( player, 24, 200 ) 
    giveWeapon ( player, 34, 250 ) 
end 
  
function giveWeaponsOnSpawn ( theSpawnpont, theTeam ) 
    setTimer ( giveWeaponsOnSpawn2, 10000, 1, source) ---give The Player the weapons after 10 seconed 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) 
  

Link to comment

what if multiple players spawn at close intervals?

function giveWeaponsOnSpawn2 ( player ) 
    giveWeapon ( player, 24, 200 ) 
    giveWeapon ( player, 34, 250 ) 
end 
 playerTimers = {} 
function giveWeaponsOnSpawn ( theSpawnpont, theTeam ) 
    playerTimers[source] = setTimer ( giveWeaponsOnSpawn2, 10000, 1, source) ---give The Player the weapons after 10 seconed 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) 

Link to comment
what if multiple players spawn at close intervals?
function giveWeaponsOnSpawn2 ( player ) 
    giveWeapon ( player, 24, 200 ) 
    giveWeapon ( player, 34, 250 ) 
end 
 playerTimers = {} 
function giveWeaponsOnSpawn ( theSpawnpont, theTeam ) 
    playerTimers[source] = setTimer ( giveWeaponsOnSpawn2, 10000, 1, source) ---give The Player the weapons after 10 seconed 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) 

its handled, if you look at it...

timer has a player argument.

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