SA-MP Forums Archive
Just need an idea - 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: Just need an idea (/showthread.php?tid=656826)



Just need an idea - Ahmadd - 24.07.2018

I'm working on a PM messaging CMD. i want to make /pmblock <playerid> cmd. Just need an idea how can i make such a cmd? i have /dnd which block all players pms, but I want to make it for a specific player. Any ideas will be appreciated!


Re: Just need an idea - Florin48 - 24.07.2018

you can make a variable to be set on someone, and when he tries to use that command and the variable will be on 1, a message will appear instead of executing commands.
I hope you understand what I meant.


Re: Just need an idea - JasonRiggs - 24.07.2018

PHP код:
new Playerblock[MAX_PLAYER][MAX_PLAYER
When someone performs the /block [id], set it like..

PHP код:
PlayerBlock[playerid][target] = 1
Then do a check when someone does /pm if the variable between THE TARGET first then him equal to 1 then don't send the message..

Example:

PHP код:
cmd:pm(playeridparams[])
{   
     new 
target;
     if(
sscanf(params"u"target)) return SendClientMessage(playerid, -1"/pm [target]");
     if(
Playerblock[target][playerid]) return SendClientMessage(playerid, -1"The player is blocking you");




Re: Just need an idea - Ahmadd - 25.07.2018

Quote:
Originally Posted by Florin48
Посмотреть сообщение
you can make a variable to be set on someone, and when he tries to use that command and the variable will be on 1, a message will appear instead of executing commands.
I hope you understand what I meant.
Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
PHP код:
new Playerblock[MAX_PLAYER][MAX_PLAYER
When someone performs the /block [id], set it like..

PHP код:
PlayerBlock[playerid][target] = 1
Then do a check when someone does /pm if the variable between THE TARGET first then him equal to 1 then don't send the message..

Example:

PHP код:
cmd:pm(playeridparams[])
{   
     new 
target;
     if(
sscanf(params"u"target)) return SendClientMessage(playerid, -1"/pm [target]");
     if(
Playerblock[target][playerid]) return SendClientMessage(playerid, -1"The player is blocking you");

Thanks!