[Help] Block Player Text
#1

new BlockInfo[MAX_PLAYERS][MAX_PLAYERS];

Код:
public OnPlayerText(playerid,text[])
{	
	for (new i = 0; i < MAX_PLAYERS; i++)
	{
		if(new BlockInfo[playerid][i] == 1)
		{
		
    }
	}
	return 0;
}
	return 1;
}
Код:
	if(strcmp(cmd, "/BLOCKPLAYER", true)== 0) // Block / UnBlock some PLAYER!.
	{

    tmp = strtok(cmdtext, idx);
    new otherplayer = strval(tmp);
  	  new opname[MAX_PLAYER_NAME], string[256];
    GetPlayerName(otherplayer, opname, sizeof (opname));
	  if(!strlen(tmp)) return SendClientMessage(playerid, WHITEBLUE, "USE: /BlockPlayer [playerid]");
    BlockInfo[playerid][otherplayer] = 1;
	  format(string, sizeof(string), ".%s зсоъ аъ ддегтеъ щм дщзчп", opname);
	  SendClientMessage(playerid, WHITEBLUE, string);
		return 1;
	}
why is'nt this working?
the errors are:

Код:
E:\PROGRA~1\GTASAN~1\GAMEMO~1\Untitled.pwn(564) : error 029: invalid expression, assumed zero
E:\PROGRA~1\GTASAN~1\GAMEMO~1\Untitled.pwn(564) : warning 215: expression has no effect
E:\PROGRA~1\GTASAN~1\GAMEMO~1\Untitled.pwn(564) : error 001: expected token: ";", but found ")"
E:\PROGRA~1\GTASAN~1\GAMEMO~1\Untitled.pwn(564) : error 029: invalid expression, assumed zero
E:\PROGRA~1\GTASAN~1\GAMEMO~1\Untitled.pwn(564) : fatal error 107: too many error messages on one line
On the line:

Код:
		if(new BlockInfo[playerid][i] == 1)
Reply
#2

You can't use "new" in an if() thing. Try this:

pawn Код:
if(BlockInfo[playerid][i] == 1)
Reply
#3

Oo shit. xd thx willtry


edit:
it's compiling but doesn't work..
i still can see the blocked player messages
=[
Reply
#4

wait, why the heck would you use dual dimensional array for a value that would only be assigned to a single player?
MAX_PLAYERS*MAX_PLAERS = 65k or so... lots of memory
and that wouldn't prevent him fom sending a message to the blocked player or from it.. whatever... I think
Reply
#5

Do you want to block player's messages to everybody or to 1 player only?
Reply
#6

do u mean muting someone? (MUTE/UNMUTE) ??

If Yes, then i can help you,

Reply
#7

pawn Код:
public OnPlayerText(playerid,text[])
{
    for (new i = 0; i < GetMaxPlayers(); i++) {
        if(new BlockInfo[i] == 1) return 0;
    }
    return 1;
}
Reply
#8

I need to dual array to block some specific player to someone

if i do "/BlockPlayer 2", I'll Block this player messages, only to me..


Edit:

Quote:
Originally Posted by ۞●•λвнiиаv•●۞
do u mean muting someone? (MUTE/UNMUTE) ??

If Yes, then i can help you,

yes, but only to me, not to every body...
Reply
#9

try This

Код:
public OnPlayerText(playerid,text[])
{
   new i;
   for(i=0;i<=MAX_PLAYERS;i++){
     if(BlockInfo[i][playerid]) return 0;
   }
   return 1;
}
Might be working .. let me test it too ........ I just typed it right here, thats why i am not sure... =.=
Reply
#10

ehh doesnt work =[
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)