~~> Help with blocking The Personal Messages < ~~
#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


Messages In This Thread
~~> Help with blocking The Personal Messages < ~~ - by johnnyc - 13.04.2010, 19:48
Re: Help with blocking PM's - by johnnyc - 14.04.2010, 04:23
Re: Help with blocking PM's - by cessil - 14.04.2010, 04:32
Re: Help with blocking PM's - by johnnyc - 14.04.2010, 04:42
Re: Help with blocking PM's - by VirSpectorX - 14.04.2010, 07:10
Re: Help with blocking PM's - by RichyB - 14.04.2010, 08:00
Re: Help with blocking PM's - by johnnyc - 14.04.2010, 09:47
Re: Help with blocking PM's - by Thrarod - 14.04.2010, 09:54
Re: Help with blocking PM's - by johnnyc - 14.04.2010, 10:04
Re: Help with blocking PM's - by johnnyc - 14.04.2010, 11:05

Forum Jump:


Users browsing this thread: 4 Guest(s)