when in /dm how to disable all cmds in a FS and gamemode
#1

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?
Reply
#2

soo, does any one know? sorry for repost btw
Reply
#3

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;
}
Reply
#4

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;
}
Reply
#5

nice but what will i do to the /goto in luxadmin FS because thats in a diffrent script format, zcmd i think..
Reply
#6

It's better to merge the Filter Script into the Game Mode, I'd say.
Reply
#7

I Agree
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)