Spawn in DM
#1

Well the player when he die he spawn out side the Dm so he need to join it again with a command
How to make him spawn in dm when he die ?
I got alot of dm commands and i use all random spawns in them
How to make them ?
Thx.
Reply
#2

Make a variable like:
pawn Код:
new IsPlayerDMing[MAX_PLAYERS];
Assign it true when the player started using DM. Then under OnPlayerDeath check if the variable is true or not. If you want to disable it just make it false under the command for the player to stop DM.

EDIT:
pawn Код:
new IsPlayerDMing[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerDMing[playerid] == 1)
    {
        //set the players position to the DM area
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/dm", cmdtext, true) == 0)
    {
        if(IsPlayerDMing[playerid] == 0)
        {
            IsPlayerDMing[playerid] == 1;
            //ur code for the DM
        }
        else
        {
            IsPlayerDMing[playerid] == 0;
        }
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)