Help with a PM command (ZCMD) - 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 a PM command (ZCMD) (
/showthread.php?tid=407676)
Help with a PM command (ZCMD) -
Nick_Phelps - 14.01.2013
Hey im needing a little help with a PM system could I get a basic code please

it would be appriciated
Re: Help with a PM command (ZCMD) -
Infinity90 - 14.01.2013
Use the search button next time.
https://sampforum.blast.hk/showthread.php?tid=291063
https://sampforum.blast.hk/showthread.php?tid=395318
Re: Help with a PM command (ZCMD) -
LeGGGeNNdA - 14.01.2013
CLICK
Here you go
Re: Help with a PM command (ZCMD) -
Alex Magaсa - 14.01.2013
pawn Код:
CMD:pm(playerid, params[])
{
new playerb, string[128], text[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 0) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
if(sscanf(params, "us[128]", playerb, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pm [playerid] [text]");
if(AntiAdv(playerid, params)) return 1;
if(!strlen(text)) return SendClientMessage(playerid, COLOR_GREY, "You haven't entered any text to PM.");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
format(string, sizeof(string), "PM to %s: %s", RPN(playerb), text);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "PM from %s: %s", RPN(playerid), text);
SendClientMessage(playerb, COLOR_YELLOW, string);
format(string, sizeof(string), "PM from %s to %s: %s", RPN(playerid), RPN(playerb), text);
Log("logs/pm.log", string);
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] >= 6 && PMs[i] && i != playerid && i != playerb)
{
format(string, sizeof(string), "[PM] %s to %s: %s", RPN(playerid), RPN(playerb), text);
SendClientMessage(i, COLOR_YELLOW, string);
}
}
return 1;
}
Re: Help with a PM command (ZCMD) -
ThePhenix - 14.01.2013
PHP код:
#define COLOR_YELLOW 0xEAEA15C8
#define NO_PARAMS 0xBEBCD3FF
CMD:pm(playerid, params[])
{
new string[256], text[128], targetid;
if(sscanf(params, "rs[128]", targetid, text)) return SendClientMessage(playerid, NO_PARAMS, "USAGE: /pm [Id or name] [text]");//If no enough params
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, ERROR, "ERROR: Invalid player ID or Name");//If player wants to PM him self or a not connected player
if(targetid == playerid) return SendClientMessage(playerid, ERROR, "ERROR: You cannot PM yourself");
format(string, sizeof(string), "PM from: %s |Text: %s", Name(playerid), text);//The format of the string
SendClientMessage(targetid, COLOR_YELLOW, string);//sending the message to the targetid
format(string, sizeof(string), "PM to: %s| Text: %s", Name(targetid), text);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}