String not sending client message to all
#1

Dunno why under /rob4d
PHP код:
 GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
      
format(string,sizeof(string), "[ROBBERY] {FFFFFF}%s(%d) {F81414}has robbed{FFFFFF} The Four Dragons{F81414} in {FFFFFF}The Stip (LV),{F81414} and got away with{FFFFFF} $%d",pnameplayeridmrand);
      
SendClientMessageToAll(COLOR_REDstring); 
and some other businesses..


PHP код:
  GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
                  
format(string2,sizeof(string2), "[ROBBERY] {FFFFFF}%s(%d) {F81414}has robbed{FFFFFF} the 24/7{F81414} in {FFFFFF}Old Venturas Stip (LV),{F81414} and got away with{FFFFFF} $%d",pnameplayeridmrand);
                  
SendClientMessageToAll(COLOR_REDstring2);
//and
                  
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
                  
format(string2,sizeof(string2), "[ROBBERY] {FFFFFF}%s(%d) {F81414}has robbed{FFFFFF} Ammu-nation{F81414} in {FFFFFF}Old Venturas Stip (LV),{F81414} and got away with{FFFFFF} $%d",pnameplayeridmrand);
                  
SendClientMessageToAll(COLOR_REDstring2); 
Reply
#2

I'm quite sure this should works; Are you sure this code is being called?
Reply
#3

Can you show us the whole command?
Reply
#4

sure
PHP код:

//============================================================================//
dcmd_robfourdragons(playerid,params[])
{
    
#pragma unused params
    
new pname[MAX_PLAYER_NAME];
    new 
string[254];
    new 
WantedLevel GetPlayerWantedLevel(playerid);
    if(
GetPlayerInterior(playerid) != 10)
    {
      
SendClientMessage(playeridCOLOR_RED,"You must be in The Four Dragons in order to rob it.");
    }
    if(
GetPlayerInterior(playerid) == 10 && !IsPlayerInRangeOfPoint(playerid3.01927.29,1017.62,993.00))
    {
      
SendClientMessage(playeridCOLOR_RED"You must be in casino robbery checkpoint in order to rob the casino.");
    }
    if(
GetPlayerInterior(playerid) == 10 && IsPlayerInRangeOfPoint(playerid3.01927.29,1017.62,994.50))
    {
      new 
frand =random(10);
      new 
mrand =random(100000);
      if(
gTeam[playerid] != TEAM_CIVIL)
      {
        
SendClientMessage(playerid,COLOR_RED,"Law enforcement officers cannot rob anything.");
        return 
1;
      }
      if(
frand <= 2)
      {
        if(
WantedLevel ==0)
        {
           
SendClientMessage(playeridCOLOR_RED"You've attempted to rob The Four Dragons in The Strip (LV), but failed.");
           
GetPlayerName(playeridpnamesizeof(pname));
           
SetPlayerColor(playeridCOLOR_YELLOW);
           
SetPlayerWantedLevel(playerid3);
           
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has attempted to rob The Four Dragons in The Strip (LV).",pnameplayerid);
           
SendCopMessage(COLOR_BLUEstring);
           
SendCIAMessage(COLOR_BLUEstring);
           
SendArmyMessage(COLOR_GREENstring);
           return 
1;
        }
        if(
WantedLevel ==3)
        {
          
SendClientMessage(playeridCOLOR_RED"You've attempted to rob The Four Dragons in The Strip (LV), but failed.");
          
GetPlayerName(playeridpnamesizeof(pname));
          
SetPlayerColor(playeridCOLOR_RED);
          
SetPlayerWantedLevel(playerid6);
          
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has attempted to rob The Four Dragons in The Strip (LV).",pnameplayerid);
          
SendCopMessage(COLOR_BLUEstring);
          
SendCIAMessage(COLOR_BLUEstring);
          
SendArmyMessage(COLOR_GREENstring);
          return 
1;
        }
      }
      
GivePlayerMoney(playeridmrand);
      
GetPlayerName(playeridpnamesizeof(pname));
      
format(string,sizeof(string), "You've successfully robbed the The Four Dragons in The Strip (LV), and got away with $%d",mrand);
      
SendClientMessage(playerid,COLOR_GREENstring);
      
SetPlayerColor(playeridCOLOR_RED);
      
SetPlayerWantedLevel(playerid6);
      
PlayerInfo[playerid][pRobberies] = PlayerInfo[playerid][pRobberies]+1;
      
IncreasePlayerScore(playerid,1);
      
HasRobbedRecently[playerid] =180;

      
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
      
format(string,sizeof(string), "[ROBBERY] {FFFFFF}%s(%d) {F81414}has robbed{FFFFFF} The Four Dragons{F81414} in {FFFFFF}The Stip (LV),{F81414} and got away with{FFFFFF} $%d",pnameplayeridmrand);
      
SendClientMessageToAll(COLOR_REDstring);

      
GetPlayerName(playeridpnamesizeof(pname));
      
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has robbed The Four Dragons in The Strip (LV), and got away with $%d",pnameplayeridmrand);
      
SendCopMessage(COLOR_BLUEstring);
      
SendCIAMessage(COLOR_BLUEstring);
      
SendArmyMessage(COLOR_GREENstring);

      
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
         
format(string,sizeof(string),"[ROBBERY] %s(%d) has robbed The Four Dragonsw in The Strip (LV), and got away with $%d",pname,playerid,mrand);
         
IRC_GroupSay(groupID,ADMIN_CHANNEL,string);
         
IRC_GroupSay(groupID,IRC_CHANNEL,string);
       }
       return 
1;
}

dcmd_rob4d(playerid,params[])    return dcmd_robfourdragons(playerid,params); 
[/php]
Reply
#5

Max len of SendClientMessage text is 144 so check if your text is up of 144 chars
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)