30.07.2012, 19:47
(
Последний раз редактировалось Roko_foko; 30.07.2012 в 20:42.
)
pawn Код:
new PmSender[MAX_PLAYERS]=-1;//<---- add this on top of the script
if(strcmp(cmd, "/pm",true) == 0)
{
new tmp[256];
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientUsage(playerid,cmd,"[PartOfName/ID] [message]");
TargetUser(tmp,playerid)
if(PlayerTemp[giveplayerid][pmlock]) return SendClientError(playerid,"This player has locked his incomming PM");
tmp=strrest(cmdtext,idx);
if(!strlen(tmp)) return SendClientUsage(playerid,cmd,"[PartOfName/ID] [message]");
if(FindIP(tmp))
{
KickReas("[SERVER]",playerid,"Atempting to advertise IP's!");
return 1;
}
new stringa[MAX_STRING];
format(stringa,sizeof(stringa),"[PM Sent to %s[%i]: %s]",PlayerName(giveplayerid),giveplayerid,tmp);
SendClientMessage(playerid,COLOR_PLAYER_LIGHTBLUE,stringa);
format(stringa,sizeof(stringa),"[PM From %s[%i]: %s]",PlayerName(playerid),playerid,tmp);
new floriansxazuttfzbuikz[600];
format(floriansxazuttfzbuikz, sizeof(floriansxazuttfzbuikz), "7,6[ PM ] %s[%d] to %s[%d]: %s",NameEx(playerid),playerid,NameEx(giveplayerid),giveplayerid,tmp);
IRC_GroupSay(gGroupID, IRC_CHANNEL,floriansxazuttfzbuikz);
PmSender[giveplayerid]=playerid;//<--- add this- this stores the last pm sender
SendClientMessage(giveplayerid,COLOR_PLAYER_LIGHTBLUE,stringa);
return 1;
}
if(strcmp(cmd, "/reply")==0)
{
if(PmSender[playerid]==-1)return SendClientMessage(playerid,0xFFFFFFFF,"None has sent you pm.");//ADDED AFTER FIRST reply
if(!IsPlayerConnected(PmSender[playerid]))return SendClientMessage(playerid,0xFFFFFFFF,"Player has just logged off");
new tmp[256];
tmp=strrest(cmdtext,idx);
SendClientMessage(PmSender[playerid],COLOR_PLAYER_LIGHTBLUE,tmp);
PmSender[PmSender[playerid]]=playerid;
return 1;
}