Help on blocking player to use a command on himself - 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: Help on blocking player to use a command on himself (
/showthread.php?tid=594918)
Help on blocking player to use a command on himself -
Dragonic - 25.11.2015
Ok, so I have a /Race [Player you want to challange ID] command, but the thing is that you can challange yourself, and when you do such, you go alone, leaving an infinite car there that was supposed to belong to the other player until I restart the server. How can I make something that when you use it on yourself you get a message like "You can't challange yourself!"?
Thanks
Re: Help on blocking player to use a command on himself -
iKarim - 25.11.2015
PHP код:
if(targetid == playerid) return SendClientMessage(playerid, -1, "You can't challange yourself!");
Edit it to meet your command ofc.
Re: Help on blocking player to use a command on himself -
Dragonic - 25.11.2015
Thanks! It worked like a charm...