Help with /reply command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with /reply command (
/showthread.php?tid=364455)
Help with /reply command -
MadafakaPro - 30.07.2012
Can someone show me how to make a fast /reply command which will reply to latest message without typing the ID ?
pawn Код:
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);
SendClientMessage(giveplayerid,COLOR_PLAYER_LIGHTBLUE,stringa);
return 1;
}
Re: Help with /reply command -
Roko_foko - 30.07.2012
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;
}
Re: Help with /reply command -
MadafakaPro - 30.07.2012
How to make if player didnt receive message it will show up an Error Noone sent you PM?
Re: Help with /reply command -
Roko_foko - 30.07.2012
edited first post