~~> Help with blocking The Personal Messages < ~~
#1

I Have command to block all the pm's and it was working but now its not and i dont know why and i cant see anything wrong

Код:
//-------------------------[BlockAll]----------------------------------------------
if(strcmp(cmd,"/blockall",true)==0)
{
tmp = strtok(cmdtext,idx);
if(PlayerInfo[playerid][pDonation] < 1)
{
SendClientMessage(playerid,COLOR_RED,"ERROR: Donators only (/donationhelp)");
return 1;
}
blocked[playerid] = -1;
SendClientMessage(playerid,COLOR_GREY, "All Player's Blocked, /unblockall to unblock");
return 1;
}
Reply
#2

-Bump-
Reply
#3

in the PM command have
if(blocked[targetid] == -1) return SendClientMessage(playerid,COLOR_RED,"target id has their PM blocked");
Reply
#4

Quote:
Originally Posted by cessil
in the PM command have
if(blocked[targetid] == -1) return SendClientMessage(playerid,COLOR_RED,"target id has their PM blocked");
Where i put this ? replace it with what ?
Reply
#5

Can i see your PM Codes and the Variables?
Reply
#6

Look for the PM Command.
I am not a Pro Scripter, So if this does not work, then I would ask someone else.

Now Below this part of the PM command
if(strcmp(cmd,"/pm",true)==0)
{

Place
if(blocked[targetid] == -1)
{
SendClientMessage(playerid,COLOR_RED,"Player has blocked all Private Messages!");
return 1;
}

Try that and it may work.
Reply
#7

Yea okay now i know the problme , i dont have the PM on my script, i have it as Filescripts, and here it is


Код:
#include <a_samp>
#include "gl_common"

#define COLOR_ONE 0xFF444499
#define COLOR_TWO 0xFFFF00FF
#define COLOR_THREE 0xFF0000FF

//------------------------------------------------

public OnFilterScriptInit()
{
	print("Personal Message System Loaded!");
	return 1;
}
//------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256];
	new	tmp[256];
	new Message[256];
	new gMessage[256];
	new pName[MAX_PLAYER_NAME+1];
	new iName[MAX_PLAYER_NAME+1];
	new	idx;

	cmd = strtok(cmdtext, idx);

	if(strcmp("/pm", cmd, true) == 0)
	{
		tmp = strtok(cmdtext,idx);

		if(!strlen(tmp) || strlen(tmp) > 5) {
			SendClientMessage(playerid,COLOR_ONE,"USAGE: /pm [id] [message]");
			return 1;
		}

		new id = strval(tmp);
    gMessage = strrest(cmdtext,idx);

		if(!strlen(gMessage)) {
			SendClientMessage(playerid,COLOR_ONE,"USAGE: /pm [id] [message]");
			return 1;
		}

		if(!IsPlayerConnected(id)) {
			SendClientMessage(playerid,COLOR_THREE,"ERROR: Player ID not found.");
			return 1;
		}
		if(playerid != id) {
		GetPlayerName(id,iName,sizeof(iName));
		GetPlayerName(playerid,pName,sizeof(pName));
		format(Message,sizeof(Message),"PM Sent to %s(%d): %s",iName,id,gMessage);
		SendClientMessage(playerid,COLOR_TWO,Message);
		format(Message,sizeof(Message),"PM From %s(%d): %s",pName,playerid,gMessage);
		SendClientMessage(id,COLOR_TWO,Message);
		PlayerPlaySound(id,1085,0.0,0.0,0.0);

		printf("PM Logger: %s (ID:%s) (Name: %s)",Message, playerid, pName);

		}
		else {
			SendClientMessage(playerid,COLOR_THREE," You cannot PM yourself!");
		}
		return 1;
	}
	return 0;
	}
Reply
#8

It doesn't check if(blocked[targetid... thingie
Reply
#9

Quote:
Originally Posted by Thrarod
It doesn't check if(blocked[targetid... thingie
i know and i tried to add it but gives me Pawn not responing w/e , help please.
Reply
#10

What -.-" Man i really understand nothing !
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)