HOW TO DISABLE COMMANDS FROM FS AND GM WHILE IN A DM ZONE -
[EDT]AmanSingh123 - 22.08.2011
hey,
i dont know how to disable all commands... like if i do /dm and then i do something like /drift1 or /lv it will give me a error messege to do /leave to be able to do all cmds and also i want to disable the cmds in the filterscripts aswell... any help?
Re: when in /dm how to disable all cmds in a FS and gamemode -
[EDT]AmanSingh123 - 22.08.2011
soo, does any one know? sorry for repost btw
Re: when in /dm how to disable all cmds in a FS and gamemode -
Adil - 22.08.2011
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(string, "/dm", true) == 0)
{
//Do stuff here
IsInDM[playerid] = 1;
}
if(strcmp(string, "/leave", true) == 0)
{
//Do stuff here
IsInDM[playerid] = 0;
}
if(strcmp(string, "/hi", true) ==0)
{
//Put this in every command that you want to get disabled
if(IsInDM[playerid])
{
SendClientMessage(playerid, COLOR_RED, "You must /leave before you can use any command");
return 1;
}
}
return 1;
}
Re: when in /dm how to disable all cmds in a FS and gamemode -
[WoF]Sonny - 22.08.2011
Try this code
new DM[MAX_PLAYERS] = 1;
Public OnPlayerDisconnect(playerid)
{
DM[playerid] = 0;
return 1;
}
Public OnPlayerDeath(playerid, killerid, reason)
{
DM[playerid] = 0;
return 1;
}
if(strcmp(cmdtext, "/dm", true) == 0)
{
if(DM[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Server: you are already in dm");
DMZone[playerid] = 1;
return 1;
}
if(strcmp(cmdtext, "/drift", true) == 0)
{
if(DM[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Server: Type /leave to leave dm");
/////
return 1;
}
if(strcmp(cmdtext, "/leave", true) == 0)
{
if(DM[playerid] >= 1)
{
SetPlayerArmour(playerid,0);
DM[playerid] = 0;
SpawnPlayer(playerid);
SetCameraBehindPlayer(playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Server: You are not in dm");
}
return 1;
}
Re: when in /dm how to disable all cmds in a FS and gamemode -
[EDT]AmanSingh123 - 22.08.2011
nice
but what will i do to the /goto in luxadmin FS because thats in a diffrent script format, zcmd i think..
Re: when in /dm how to disable all cmds in a FS and gamemode -
Adil - 22.08.2011
It's better to merge the Filter Script into the Game Mode, I'd say.
Re: when in /dm how to disable all cmds in a FS and gamemode -
[WoF]Sonny - 22.08.2011
I Agree