PM error
#2

PHP Code:
if(!strcmp(cmd"/pm"))
    {
      if(
IsPlayerConnected(playerid))
        {
        new 
player;
        new 
message;
        if(
sscanf(params"ds"playermessage)) return SendClientMessage(playerid,COLOR_WHITE,"  {FF0000}/PM {FFFF00}: Usage: {FF4040}/pm [player id] [message]{FFFF00}.");
        if(
IsPlayerConnected(player)==0) return SendClientMessage(playerid,COLOR_WHITE,"  {FF0000}/PM {FFFF00}: That player isn't connected.");
        if(
player == playerid) return SendClientMessage(playerid,COLOR_WHITE,"  {FF0000}/PM {FFFF00}: You can't PM yourself.");
        else
        {
            new 
sendername[MAX_PLAYER_NAME];
            
GetPlayerName(playerid,sendername,sizeof(sendername));
            new 
name[MAX_PLAYER_NAME];
            
GetPlayerName(playerid,name,sizeof(name));
            new 
string[128];
            
format(string,sizeof(string),"  {FF0000}/PM {FFFF00}: PM from {FF4040}%s{FFFF00}: {FFFFFF}%d",sendername,message);
            
SendClientMessage(player,COLOR_WHITE,string);
            
format(string,sizeof(string),"  {FF0000}/PM {FFFF00}: You've sent a PM to {FF4040}%s{FFFF00}: {FFFFFF}%d",name,message);
            
SendClientMessage(player,COLOR_WHITE,string);
            return 
1;
        }
    } 
Reply


Messages In This Thread
PM error - by Superthijs - 10.09.2011, 10:38
Re: PM error - by =WoR=G4M3Ov3r - 10.09.2011, 10:42
Re: PM error - by Vince - 10.09.2011, 10:44
Re: PM error - by FireCat - 10.09.2011, 10:48
Re: PM error - by Davz*|*Criss - 10.09.2011, 12:17

Forum Jump:


Users browsing this thread: 2 Guest(s)