E-mail Posted September 30, 2011 Share Posted September 30, 2011 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 ) Link to comment
Cadu12 Posted September 30, 2011 Share Posted September 30, 2011 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
BinSlayer1 Posted September 30, 2011 Share Posted September 30, 2011 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
karlis Posted September 30, 2011 Share Posted September 30, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now