How to disable other commands in one commands? -
varga - 20.04.2012
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.
Re: How to disable other commands in one commands? -
WLSF - 20.04.2012
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
Re: How to disable other commands in one commands? -
varga - 20.04.2012
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.
Re: How to disable other commands in one commands? -
varga - 20.04.2012
not working
Re: How to disable other commands in one commands? -
WLSF - 20.04.2012
What's the problem?
Re: How to disable other commands in one commands? -
varga - 20.04.2012
2 warnings and non working
Re: How to disable other commands in one commands? -
WLSF - 20.04.2012
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;
}
Re: How to disable other commands in one commands? -
varga - 20.04.2012
anyone can help me
Re: How to disable other commands in one commands? -
WLSF - 20.04.2012
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)...
Re: How to disable other commands in one commands? -
varga - 20.04.2012
thanks i will try it tomorrow REP u