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