Posts: 153
Threads: 53
Joined: Oct 2010
Reputation:
0
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?
Posts: 153
Threads: 53
Joined: Oct 2010
Reputation:
0
soo, does any one know? sorry for repost btw
Posts: 127
Threads: 7
Joined: Aug 2011
Reputation:
0
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;
}
Posts: 860
Threads: 10
Joined: Aug 2008
Reputation:
0
It's better to merge the Filter Script into the Game Mode, I'd say.