//-------------------------[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;
}
|
Originally Posted by cessil
in the PM command have
if(blocked[targetid] == -1) return SendClientMessage(playerid,COLOR_RED,"target id has their PM blocked"); |
#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;
}
|
Originally Posted by Thrarod
It doesn't check if(blocked[targetid... thingie
![]() |