How to disable other commands in one commands?
#1

As in the title i want to know how to diable commands in 1 command what is /west it is a DM map teleport.... If i made this thread i ask here how to make a spawn place in a dm command to spawn there till he/she didnt use command like /qdm or something for leave the dm map... pls help me
In advance, i will rep the helper who have the correct answer and say him/her a big thanks.
Reply
#2

Like this?
pawn Код:
new bool:deathmath_db[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(deathmath_db[playerid])
        return SendClientMessage(playerid, -1, "You cannot use commands at Death Math area");
       
    if(!strcmp(cmdtext, "/dm", true))
    {
        SetPlayerPos(playerid, x, y, z...);
        return deathmath_db[playerid] = true;
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return deathmath_db[playerid] = false;
}
I didn't understand
Reply
#3

H:\GTA San Andreas\samp03e_svr_RC6_win32\pawno\include\dutils .inc(2 : warning 219: local variable "string" shadows a variable at a preceding level
H:\GTA San Andreas\samp03e_svr_RC6_win32\pawno\include\dutils .inc(132) : warning 219: local variable "string" shadows a variable at a preceding level
H:\GTA San Andreas\samp03e_svr_RC6_win32\pawno\include\dutils .inc(172) : warning 219: local variable "string" shadows a variable at a preceding level
H:\GTA San Andreas\samp03e_svr_RC6_win32\pawno\include\dutils .inc(280) : warning 219: local variable "string" shadows a variable at a preceding level
H:\GTA San Andreas\samp03e_svr_RC6_win32\pawno\include\dutils .inc(337) : warning 219: local variable "string" shadows a variable at a preceding level
H:\GTA San Andreas\samp03e_svr_RC6_win32\pawno\include\dutils .inc(379) : warning 219: local variable "string" shadows a variable at a preceding level
H:\GTA San Andreas\samp03e_svr_RC6_win32\pawno\include\dini.i nc(239) : warning 219: local variable "string" shadows a variable at a preceding level
H:\GTA San Andreas\samp03e_svr_RC6_win32\gamemodes\[LPG]server.pwn(1330) : error 017: undefined symbol "deathmath_db"
H:\GTA San Andreas\samp03e_svr_RC6_win32\gamemodes\[LPG]server.pwn(1330) : warning 215: expression has no effect
H:\GTA San Andreas\samp03e_svr_RC6_win32\gamemodes\[LPG]server.pwn(1330) : error 001: expected token: ";", but found "]"
H:\GTA San Andreas\samp03e_svr_RC6_win32\gamemodes\[LPG]server.pwn(1330) : error 029: invalid expression, assumed zero
H:\GTA San Andreas\samp03e_svr_RC6_win32\gamemodes\[LPG]server.pwn(1330) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

not working
Reply
#5

What's the problem?
Reply
#6

2 warnings and non working
Reply
#7

Try this...
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new bool:deathmath_db[MAX_PLAYERS];
    if(deathmath_db[playerid])
    {
        if(!strcmp(cmdtext,"/cdm", true))  // type /cdm to get out of the DM area boolean (false)
        {
            SendClientMessage(playerid, -1, "You can use commands now.");
            deathmath_db[playerid] = false;
            return 1;
        }
        else
        {
            SendClientMessage(playerid, -1, "You're in DM area...");
        }      
        return 1;
    }
    if(!strcmp(cmdtext, "/dm", true))
    {
        //SetPlayerPos(playerid, x, y, z); Coords x, y, z from DM local...
        deathmath_db[playerid] = true;
        return 1;  
    }

    //Others commands by GameMode...
    return 0;
}
Reply
#8

anyone can help me
Reply
#9

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Try this...
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new bool:deathmath_db[MAX_PLAYERS];
    if(deathmath_db[playerid])
    {
        if(!strcmp(cmdtext,"/cdm", true))  // type /cdm to get out of the DM area boolean (false)
        {
            SendClientMessage(playerid, -1, "You can use commands now.");
            deathmath_db[playerid] = false;
            return 1;
        }
        else
        {
            SendClientMessage(playerid, -1, "You're in DM area...");
        }      
        return 1;
    }
    if(!strcmp(cmdtext, "/dm", true))
    {
        //SetPlayerPos(playerid, x, y, z); Coords x, y, z from DM local...
        deathmath_db[playerid] = true;
        return 1;  
    }

    //Others commands by GameMode...
    return 0;
}
... Try this, type /dm to set boolean (true) and /cdm to set boolean (false)...
Reply
#10

thanks i will try it tomorrow REP u
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)