DM[playerid] = 1;
#1

Solved!
Reply
#2

Put
Код:
if(DM[playerid] == 1) return SendClientMessage(playerid,-1,"You can't use this command since you are dm'ing!");
at your commands. Example:
Код:
CMD:heal(playerid,params[])
{
     if(DM[playerid] == 1) return SendClientMessage(playerid,-1,"You can't use this command since you are dm'ing!);
     SetPlayerHealth(playerid,100);
     return 1;
}
Reply
#3

solved but wihtour your help newbien noob :P because with your idee i need muccch time, because i have 100+ commands!
Reply
#4

If you want only one command to work, you could check out this:

Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(DM[playerid] == 1 && strfind(cmdtext,"exitdm",true) == -1) //That will make only "/exitdm" to work, and none of the other commands.
    {
        SendClientMessage(playerid,-1,EMBED_RED"[ERROR]: "EMBED_WHITE"You can not use commands inside of a DM, please use "EMBED_RED"/exitdm"EMBED_WHITE".");
        return 0;
    }
	return 1;
}
only an Example
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)