TogglePlayerControllable(playerid, 1);
SetTimerEx("UnfreezeMe", "i", playerid);
//...
public UnfreezeMe(playerid)
{
TogglePlayerControllable(playerid, 0);
}
public LoadObjectsForPlayer( playerid )
{
if( IsPlayerConnected ( playerid ) )
{
TogglePlayerControllable( playerid, false ); // Freeze
if( GetPlayerPing ( playerid ) < 100 ) { SetTimerEx( "ObjectsLoaded", 3000, 0, "e", playerid ); }
else if( GetPlayerPing ( playerid ) > 100 ) { SetTimerEx( "ObjectsLoaded", 3000, 0, "e", playerid ); }
else if( GetPlayerPing ( playerid ) > 200 ) { SetTimerEx( "ObjectsLoaded", 3200, 0, "e", playerid ); }
else if( GetPlayerPing ( playerid ) > 300 ) { SetTimerEx( "ObjectsLoaded", 3700, 0, "e", playerid ); }
else if( GetPlayerPing ( playerid ) > 500 ) { SetTimerEx( "ObjectsLoaded", 4000, 0, "e", playerid ); }
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 );
}
LoadObjectsForPlayer( playerid );
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid, false); // Freeze the player
SetTimerEx("Unfreeze", 5000, false, "i", playerid); // Make a 5 second timer for that player to get unfrozen
return 1;
}
forward Unfreeze(playerid);
public Unfreeze(playerid)
{
TogglePlayerControllable(playerid, true); // Unfreeze the player after 5 seconds
return 1;
}
C:\Documents and Settings\Microsoft\Desktop\GMRP\gamemodes\GMRP.pwn(1825) : warning 235: public function lacks forward declaration (symbol "LoadObjectsForPlayer")
C:\Documents and Settings\Microsoft\Desktop\GMRP\gamemodes\GMRP.pwn(1841) : warning 235: public function lacks forward declaration (symbol "ObjectsLoaded")
Line 1825: public LoadObjectsForPlayer( playerid )
Line 1841: public ObjectsLoaded(playerid)
forward LoadObjectsForPlayer( playerid );
forward ObjectsLoaded( playerid );
Put this at the top of Script:
pawn Код:
|