minigun war
#4

That's not hard. When someone enter it, set an integer (eg. 'MiniGunDM[playerid] = 1' / '= true') and when yuo stop it, loop through all the players and when it's '1' or 'true' (if you use a boolean), teleport the player.
I will make an example (I'll edit this post). I will use ZCMD

pawn Код:
#include <a_samp>
#include <zcmd>

new bool:MinigunDM[ MAX_PLAYERS ],
       bool:MinigunDMEnabled

public OnPlayerConnect( playerid )
    MinigunDM[ playerid ] = false;

public OnPlayerDisconnect( playerid )
    MinigunDM[ playerid ] = false;

CMD:togminigundm( playerid, params[] )
{
    if( MinigunDMEnabled ) {
        MinigunDMEnabled = false;
        SendClientMessage( playerid, 0xFF0000AA, "Minigun DM disabled!" );
        for( new i = 0; i < MAX_PLAYERS; i++ ){
            if( MinigunDM[i] ){
                MinigunDM[i] = false;
                SendClientMessage( i, 0xFF0000AA, "The minigun DM has been ended" );
                //Set player pos
            }
        }
    }
    else {
        MinigunDMEnabled = true;
        SendClientMessage( playerid, 0x00FF00AA, "Minigun DM enabled!" );
    }
    return 1;
}

CMD:minigundm( playerid, params[] )
{
    if( MinigunDMEnabled && !MinigunDM[ playerid ] ) {
        SendClientMessage( playerid, 0x00FF00AA, "You have entered the Minigun DM" );
        MinigunDM[ playerid ] = true;
        // set pos
    }
    else
        return SendClientMessage( playerid, 0xFF0000AA, "Or the minigun DM is disabled, or you've already entered it" );
    return 1;
}

CMD:stopminigundm( playerid, params[] )
{
    if( MinigunDM[ playerid ] ) {
        MinigunDM[ playerid ] = true;
        SendClientMessage( playerid, 0x00FF00AA, "You have stopped the minigun DM" );
        // set pos
    }
    else
        return SendClientMessage( playerid, 0xFF0000AA, "You didn't enter the minigun DM yet" );
    return 1;
}
This should be okay. Maybe a typo, but I guess you can fix that
Reply


Messages In This Thread
minigun war - by omer5198 - 11.03.2011, 18:30
Re: minigun war - by xir - 11.03.2011, 18:37
Re: minigun war - by omer5198 - 11.03.2011, 18:56
Re: minigun war - by Kwarde - 11.03.2011, 18:57
Re: minigun war - by omer5198 - 11.03.2011, 19:01
Re: minigun war - by Kwarde - 11.03.2011, 19:06
Re: minigun war - by omer5198 - 11.03.2011, 19:07
Re: minigun war - by Kwarde - 11.03.2011, 19:12
Re: minigun war - by omer5198 - 11.03.2011, 19:17
Re: minigun war - by Kwarde - 11.03.2011, 19:19

Forum Jump:


Users browsing this thread: 1 Guest(s)