onPlayerRequestClass is triggered when a player scrolls through skins in the spawn screen. This means, that he is obviously not spawned. The position and weapon settings you did inside that event will not work. You need to do it AFTER the player has spawned. So, either do it onPlayerSpawn or after the player.Spawn() statement.
I guess you want a 3 second delay when players respawn on death. An easier approach is to change the Wasted Screen settings. The default wasted screen displays for 4 seconds. By setting it to 7 seconds, you can effectively add 3 seconds without needing any timers.
So, your autospawn is now:
I guess you want a 3 second delay when players respawn on death. An easier approach is to change the Wasted Screen settings. The default wasted screen displays for 4 seconds. By setting it to 7 seconds, you can effectively add 3 seconds without needing any timers.
Code Select
SetWastedSettings( 7000, 7000, 1, 2, RGB(0,0,0), 1000, 200 );
So, your autospawn is now:
Code Select
function onPlayerRequestClass( player, classID, team, skin )
{
player.Spawn(); //Force the player to spawn.
//After the player is spawned, now set his position and weapon.
player.Pos = ggpos[ random( 0, ggpos.len() ) ];
player.Disarm();
local wep = lastwep[ player.ID ];
player.SetWeapon( wep, 500 );
}