Question? + rep
#1

Hi,

How can i make a script where when they teleport to a place, they can't use any commands.
I'm using dcmd.

Thanks
Reply
#2

Thanks, but it doesn't 'un-disable' it?

I tried doing UseCMD[playerid] = true; but doesn't work :S
Reply
#3

Bump, Anyone else?
Reply
#4

Put this under OnPlayerCommandText

pawn Код:
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z)) return SendClientMessage(playerid, 0xffffffff,"SERVER: You cannot use commands here!!!");
Reply
#5

Quote:
Originally Posted by Unknownich
Посмотреть сообщение
Put this under OnPlayerCommandText

pawn Код:
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z)) return SendClientMessage(playerid, 0xffffffff,"SERVER: You cannot use commands here!!!");
He meant when player use a command like /driftdirt all commands will be disable
Reply
#6

yes ^
Reply
#7

If you're using ZCMD, just set a variable on a command and then use OnPlayerCommandReceived to check if the variable is set and then deny the command. Here is an example:

pawn Код:
new notele[MAX_PLAYERS char];
CMD:dmarea(playerid, params[])
{
    //.......
    notele{playerid} = 1;
    return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(notele{playerid} == 1)
    {
        SendClientMessage(playerid, -1, "You cannot teleport because you're in a DM");
        return 0;
    }
    return 1;
}
Then just set notele to 0 once they leave the DM.
Reply
#8

Thanks for that. I understand. But since I'm using DCMD I used OnPlayerCommandText instead of OnPlayerCommandReceived and set it to return 1.

Thats okay right?
Reply
#9

Yes you doing correct. OnPlayerCommandRecieved is only available with ZCMD or YCMD

and also the return 1; is correct
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)