script
#1

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
Reply
#2

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)