Create Blocking System [PM]
#6

Quote:
Originally Posted by PoniStar
Посмотреть сообщение
i mean can i block 2 players at the same time ?
Yes, of course!
So , lets edit the code I wrote up a lil bit:
PHP код:
#include <sscanf2> 
#include <zcmd> 
#define MAX_BLOCKED_USERS 2
new pBlockedID[MAX_PLAYERS][2]; 
public 
OnPlayerConnect(playerid)
{
     
pBlockedID[playerid][0] = -1// Reset the variables when player connect to the server
     
pBlockedID[playerid][1] = -1;
     return 
1;
}
CMD:blockplayer(playeridparams[]) 

      new 
id
      if(
sscanf(params"u"id) return SendClientMessage(playerid, -1"Syntax: /blockplayer <id/playername>");
      if(
pBlockedID[playerid][0] == -1)
      {
            
pBlockedID[playerid][0] = id
      }
      else if(
pBlockedID[playerid][1] == -1)
      {
            
pBlockedID[playerid][0] = id
      }
      else return 
SCM(playerid, -1"You used all slots for blocked players.");
      
SendClientMessage(playerid, -1"You blocked successfully the player!"); 

public 
OnPlayerText(playeridtext[]) 

     foreach(new 
iPlayer
     { 
           if(
i==pBlockedID[playerid][0] || pBlockedID[playerid][1])// checks if the player who send message is blocked 
           

               return 
1
           } 
           else 
SendClientMessage(iCOLORtext); 
     } 
     return 
0

Reply


Messages In This Thread
Create Blocking System [PM] - by PoniStar - 24.12.2018, 15:36
Re: Create Blocking System [PM] - by StRaphael - 24.12.2018, 17:07
Re: Create Blocking System [PM] - by PoniStar - 24.12.2018, 17:51
Re: Create Blocking System [PM] - by StRaphael - 24.12.2018, 18:23
Re: Create Blocking System [PM] - by PoniStar - 24.12.2018, 18:34
Re: Create Blocking System [PM] - by StRaphael - 24.12.2018, 21:45
Re: Create Blocking System [PM] - by PoniStar - 25.12.2018, 01:29

Forum Jump:


Users browsing this thread: 1 Guest(s)