18.07.2011, 15:51
Okay, I have tried some stuff but can't get it working. I need a /pm id text command for zcmd :/. I also have the sscanf2 so that can be used if it's easier to do it with it.
CMD:pm(playerid, params[]) { new id,str[80],txt[80],name[20]; GetPlayerName(playerid, name, 20); if(sscanf(params,"us[80]",id,txt)) return SendClientMessage(playerid,-1,"Use: /pm [id] [txt]"); format(str,80,"PM,Sender: %s: Txt: %s",name,txt); SendClientMessage(id,-1,str); return true; }
// PM Command.
CMD:pm( playerid, params[ ] )
{
new pID, Message[129], string[128];
if(sscanf(params, "us[129]", pID, Message)) return SendClientMessage(playerid, -1, "/pm <id> [message]");
else
{
if(pID == (0xFFFF)) return SendClientMessage(playerid, -1,"Player not connected!");
if(pID == playerid ) return SendClientMessage(playerid, -1,"You cannot PM yourself!");
format(string,sizeof(string),"PM Sent To %s (%d): %s", pName(pID), pID, Message);
SendClientMessage(playerid, -1, string);
format(string,sizeof(string),"PM From %s (%d): %s", pName(playerid), playerid, Message);
SendClientMessage(pID, -1, string);
}
return 1;
}
// On Bottom of your script.
stock pName(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}
Or don't........ Ad clicks are for retards.
Just take my advice. If you really are stuck, PM me and I will help you make one. |