g_pPlayerID <- 255;
g_pEntered <- 0;
g_pTimer <- 0;
function onPlayerEnterSphere( pPlayer, sphere )
{
if(g_pEntered == 1){
MessagePlayer("Sorry, but another one person is ALREADY trying to get a Detonator !, Please wait 5 sec and re-enter to checkpoint", pPlayer ); }
if(g_pEntered == 0){
g_pPlayerID <- pPlayer.ID; g_pEntered <- 1;
g_pTimer <- NewTimer( "GetDetonator", 5000, 1, pPlayer);
Message( pPlayer.Name + " is trying to get a Detonator !"); }
return 1;
}
function onPlayerExitSphere( pPlayer, sphere )
{
if(g_pPlayerID == pPlayer.ID){
MessagePlayer( "Fine, run away, you coward!", pPlayer );
g_pEntered <- 0; g_pPlayerID <- 255; g_pTimer.Delete; }
return 1;
}
function GetDetonator ( pPlayer )
{
if(g_pEntered == 0){ return false; } //Player will get nothing because he came out from the Sphere
MessagePlayer( "=You got the Detonator, Kid! Get off the boat and blow this joint!=", pPlayer, Colour( 255, 0, 0 ));
Message( "="+ pPlayer + "'s got the Detonator!=", 255, 0, 0 );
pPlayer.SetWeapon( 12, 1 );
g_pPlayerID <- 255; g_pEntered <- 0;
}
function onServerStart() { print("Everything is OK"); }