SA-MP Forums Archive
script - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: script (/showthread.php?tid=296437)



script - viosteaua98 - 11.11.2011

i need a script of dm
teleport command i want
special i want max 2 player there if someone try to go there will die


Re: script - viosteaua98 - 11.11.2011

man
i want place where just 2 people can go if 3rd people try to go will die


Re: script - Kostas' - 11.11.2011

Try to make it yourself, it's good for your experience.
If else Script Request Thread


Re: script - Mean - 11.11.2011

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;
}
Untested, but should be working.