02.04.2014, 08:45
My freeze time looks a bit difrent, maybe that will help with spawn time
Quote:
forward Unfreeze(playerid); public OnPlayerSpawn(playerid) { LoadObjectsForPlayer( playerid ); TogglePlayerControllable(playerid, false); // Zamra?a gracza SetTimerEx("Unfreeze", 5000, false, "i", playerid); // Robi odmro?enie gracza po 5 sekudnach! return 1; } public Unfreeze(playerid) { TogglePlayerControllable(playerid, true); // Odmra?a gracza po 5 sekudnach! return 1; } public LoadObjectsForPlayer( playerid ) { if( IsPlayerConnected ( playerid ) ) { TogglePlayerControllable( playerid, false ); // Freeze if( GetPlayerPing ( playerid ) < 100 ) { SetTimerEx( "ObjectsLoaded", 3000, 0, "e", playerid ); } // jesli ping gracza mniejszy niz 100 zamraza na 3sekundy else if( GetPlayerPing ( playerid ) > 100 ) { SetTimerEx( "ObjectsLoaded", 3000, 0, "e", playerid ); } // jesli ping gracza wiekszy niz 100 zamraza na 3sekundy else if( GetPlayerPing ( playerid ) > 200 ) { SetTimerEx( "ObjectsLoaded", 3200, 0, "e", playerid ); } //jesli ping gracza wiekszy niz 200 zamraza na 3sekundy else if( GetPlayerPing ( playerid ) > 300 ) { SetTimerEx( "ObjectsLoaded", 3700, 0, "e", playerid ); } //jesli ping gracza wiekszy niz 300 zamraza na 3.7sekundy else if( GetPlayerPing ( playerid ) > 500 ) { SetTimerEx( "ObjectsLoaded", 4000, 0, "e", playerid ); } //jesli ping gracza wiekszy niz 500 zamraza na 4sekundy else { SetTimerEx( "ObjectsLoaded", 5000, 0, "e", playerid ); } } return ( 1 ); } public ObjectsLoaded(playerid) { if( IsPlayerConnected ( playerid ) ) return TogglePlayerControllable( playerid, true ), PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 ); return ( 1 ); } |