[HELP]How to make the cmd disable?
#1

I made something like /dm , when player die , he spawn at the place where he typed the cmd /dm , And if he is in /dm then he cannot type anyother cmd except /leave ..
This is what i made ^^

Error

When player dies , he spawn at the place but he can't join /dm , it shows type /leave

can anyone suggest me what to do?

after he is dead , /leave disables...? Can anyone say me?
Reply
#2

I am using zcmd..
Reply
#3

pawn Код:
new bool:pDMEvent[MAX_PLAYERS] = false,
Float:pLastPos[MAX_PLAYERS][3];

CMD:dm(playerid, params[])
{
    new Float:pos[3];
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    for(new i = 0; i < 3; i ++) pLastPos[playerid][i] = pos[i];

    pDMEvent[playerid] = true;
    return 1;
}

CMD:leave(playerid, params[])
{
    SetPlayerPos(playerid, pLastPos[0], pLastPos[1], pLastPo[2]);
    for(new i = 0; i < 3; i ++) pLastPos[playerid][i] = 0.0;

    pDMEvent[playerid] = false;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(pDMEvent[playerid])
    {
        SetPlayerPos(playerid, pLastPos[0], pLastPos[1], pLastPo[2]);
        for(new i = 0; i < 3; i ++) pLastPos[playerid][i] = 0.0;

        pDMEvent[playerid] = false;
    }
    return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(pDMEvent[playerid])
    {
        if(strcmp("/leave", cmdtext))
        {
            SendClientMessage(playerid, -1, "You can't use command in a dm event, use /leave first.");
            return 0;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)