Disable command while in deathmatch
#1

Hi I have duel system and at the same time deathmatch command.

I want to disable the command /duel command while im in deathmatch. And if im in duel I want to disable the deathmatch command.

Please any idea how?
Reply
#2

it can be like

pawn Код:
if(PlayerInfo[playerid][pDeathmatch]  > 1 // if in deathmatch
{
       if(strcmp(cmd, "/duel", true) == 0)
       {
             SendClientMessage(playerid, "You can't use this while in deathmatch!");
               return 1;
}
Reply
#3

pawn Код:
#include <a_samp>

new pDeathmatch[MAX_PLAYERS];
new pDuel[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    pDeathmatch[playerid] = 0;
    pDuel[playerid] = 0;
    return 1;
}

// Under your deathmatch command

if(pDuel[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You're in a deathmatch, so you can't duel with anyone.");

// Under your duel command

if(pDeathmatch[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You're in a duel, so you can't deathmatch at the moment.");

// Where your deathmatch command is successfull

pDeathmatch[playerid] = 1;

// Where your duel command is successfull

pDuel[playerid] = 1;

// Where the leave duel or the duel finishes

pDuel[playerid] = 0;

// Where the leave deathmatch or the deathmatch finishes

pDeathmatch[playerid] = 0;
Reply
#4

oops...i thought something wrong :P
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)