PM Block
#1

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

if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,COLOR_YELLOW,"Usage: /pm (id) (message)");
return 1;
}

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

if(!strlen(gMessage)) {
SendClientMessage(playerid,COLOR_YELLOW,"Usage: /pm (id) (message)");
return 1;
}

if(!IsPlayerConnected(id)) {
SendClientMessage(playerid,COLOR_YELLOW,"ERROR: Wrong player ID!");
return 1;
}
if(blocked[giveplayerid] > -1)
{
SendClientMessage(playerid, COLOR_GREY, "  That player is blocking PMs from everyone !");
return 1;
}
if(blocked[giveplayerid] > 1)
{
SendClientMessage(playerid, COLOR_GREY, "  That player has blocked you from PMing him/her !");
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_YELLOW,Message);
format(Message,sizeof(Message),"PM From %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,COLOR_YELLOW,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);

printf("PM: %s",Message);

}
else {
SendClientMessage(playerid,COLOR_YELLOW,"You cannot PM yourselfq");
}
return 1;
}
Won't let people send PM's at all. ideas?
Reply


Messages In This Thread
PM Block - by iLcke - 04.04.2010, 15:22
Re: PM Block - by Beaver07 - 04.04.2010, 15:36
Re: PM Block - by AdrianX9 - 04.04.2010, 15:46
Re: PM Block - by Beaver07 - 04.04.2010, 15:50
Re: PM Block - by AdrianX9 - 04.04.2010, 15:57
Re: PM Block - by AdrianX9 - 04.04.2010, 16:10
Re: PM Block - by iLcke - 04.04.2010, 16:23
Re: PM Block - by iLcke - 04.04.2010, 17:06
Re: PM Block - by AdrianX9 - 04.04.2010, 17:07

Forum Jump:


Users browsing this thread: 4 Guest(s)