08.04.2013, 23:38
(
Last edited by Morten_Guado; 09/04/2013 at 12:37 AM.
)
Hi, I'm trying to disable all comands except one from a filterscript.
Basicly, when a player enters to a DM, his commands are disabled, except /pm.
I'm using pVars because the DM is in the gamemode, but the /pm command is in a FS.
So, this is my code:
I use previous code because I don't want to put in all other commands:
It works fine. Disables all commands except /pm, but here is the problem:
If I type /pm, it shows a message with pm parameters, but if I type let's say "/pm 1" it doesn't work.
It's because the code only allows to type "/pm" not "/pm id".
My question is:
How can I disable all commands except /pm with its parameter, which is playerid?
Hope I've been clear.
Any help would be appreciated.
Thanks in advance.
Basicly, when a player enters to a DM, his commands are disabled, except /pm.
I'm using pVars because the DM is in the gamemode, but the /pm command is in a FS.
So, this is my code:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(GetPVarInt(playerid,"InDM") ==1 && strcmp(cmdtext,"/pm") !=0)
{
return 1;
}
return 0;
}
pawn Code:
if(GetPVarInt(playerid,"InDM") ==1)
{
return 0;
}
If I type /pm, it shows a message with pm parameters, but if I type let's say "/pm 1" it doesn't work.
It's because the code only allows to type "/pm" not "/pm id".
My question is:
How can I disable all commands except /pm with its parameter, which is playerid?
Hope I've been clear.
Any help would be appreciated.
Thanks in advance.