Help with a PM command (ZCMD)
#5

PHP код:
#define COLOR_YELLOW 0xEAEA15C8
#define NO_PARAMS 0xBEBCD3FF
CMD:pm(playeridparams[])
{
    new 
string[256], text[128], targetid;
    if(
sscanf(params"rs[128]"targetidtext)) return SendClientMessage(playeridNO_PARAMS"USAGE: /pm [Id or name] [text]");//If no enough params
    
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playeridERROR"ERROR: Invalid player ID or Name");//If player wants to PM him self or a not connected player
    
if(targetid == playerid)  return SendClientMessage(playeridERROR"ERROR: You cannot PM yourself");
    
format(stringsizeof(string), "PM from: %s |Text: %s"Name(playerid), text);//The format of the string
    
SendClientMessage(targetidCOLOR_YELLOWstring);//sending the message to the targetid
    
format(stringsizeof(string), "PM to: %s| Text: %s"Name(targetid), text);
    
SendClientMessage(playeridCOLOR_YELLOWstring);
    return 
1;

Reply


Messages In This Thread
Help with a PM command (ZCMD) - by Nick_Phelps - 14.01.2013, 20:15
Re: Help with a PM command (ZCMD) - by Infinity90 - 14.01.2013, 20:16
Re: Help with a PM command (ZCMD) - by LeGGGeNNdA - 14.01.2013, 20:17
Re: Help with a PM command (ZCMD) - by Alex Magaсa - 14.01.2013, 20:20
Re: Help with a PM command (ZCMD) - by ThePhenix - 14.01.2013, 20:49

Forum Jump:


Users browsing this thread: 1 Guest(s)