Question? + rep - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question? + rep (
/showthread.php?tid=333344)
Question? + rep -
jaami - 11.04.2012
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
Re: Question? + rep -
jaami - 11.04.2012
Thanks, but it doesn't 'un-disable' it?
I tried doing UseCMD[playerid] = true; but doesn't work :S
Re: Question? + rep -
jaami - 13.04.2012
Bump, Anyone else?
Re: Question? + rep -
Unknownich - 13.04.2012
Put this under OnPlayerCommandText
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z)) return SendClientMessage(playerid, 0xffffffff,"SERVER: You cannot use commands here!!!");
Re: Question? + rep -
RollTi - 13.04.2012
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
Re: Question? + rep -
jaami - 14.04.2012
yes ^
Re: Question? + rep -
[HiC]TheKiller - 14.04.2012
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.
Re: Question? + rep -
jaami - 15.04.2012
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?
Re: Question? + rep -
RollTi - 15.04.2012
Yes you doing correct. OnPlayerCommandRecieved is only available with ZCMD or YCMD
and also the return 1; is correct