Try to make it yourself, it's good for your experience.
pawn Код:
// Put this anywhere in your script, just not in a callback. These are public variables.
new
g_dmplayers = 0
,g_playerindm[ MAX_PLAYERS ]
;
//OnPlayerCommandText
public OnPlayerCommandText( playerid, cmdtext[ ] ) {
if( !strcmp( cmdtext, "/dm", true ) ) {
if( g_dmplayers > 1 )
return SendClientMessage( playerid, -1, "There are 2 players in DM. Wait for somebody to leave. " );
SetPlayerPos( playerid, Float:DM_X, Float:DM_Y, Float:DM_Z ); // Replace the X, Y and Z position.
g_dmplayers ++;
g_playerindm[ playerid ] = 1;
}
if( !strcmp( cmdtext, "/leave", true ) ) {
if( g_playerindm[ playerid ] == 0 )
return SendClientMessage( playerid, -1, "You are not in DM. " );
g_dmplayers --;
g_playerindm[ playerid ] = 0;
SpawnPlayer( playerid );
}
return 0;
}
// OnPlayerSpawn
public OnPlayerSpawn( playerid ) {
if( g_playerindm[ playerid ] == 1 )
SetPlayerPos( playerid, Float:DM_X, Float:DM_Y, Float:DM_Z ); // Replace the X, Y and Z position.
return 1;
}
//OnPlayerDisconnect
public OnPlayerDisconnect( playerid, reason ) {
if( g_playerindm[ playerid ] == 1 ) {
g_dmplayers --;
g_playerindm[ playerid ] = 0;
}
return 1;
}