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",pname, playerid, mrand);
SendClientMessageToAll(COLOR_RED, string2);
//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",pname, playerid, mrand);
SendClientMessageToAll(COLOR_RED, string2);
I'm quite sure this should works; Are you sure this code is being called?
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(playerid, COLOR_RED,"You must be in The Four Dragons in order to rob it.");
}
if(GetPlayerInterior(playerid) == 10 && !IsPlayerInRangeOfPoint(playerid, 3.0, 1927.29,1017.62,993.00))
{
SendClientMessage(playerid, COLOR_RED, "You must be in casino robbery checkpoint in order to rob the casino.");
}
if(GetPlayerInterior(playerid) == 10 && IsPlayerInRangeOfPoint(playerid, 3.0, 1927.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(playerid, COLOR_RED, "You've attempted to rob The Four Dragons in The Strip (LV), but failed.");
GetPlayerName(playerid, pname, sizeof(pname));
SetPlayerColor(playerid, COLOR_YELLOW);
SetPlayerWantedLevel(playerid, 3);
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has attempted to rob The Four Dragons in The Strip (LV).",pname, playerid);
SendCopMessage(COLOR_BLUE, string);
SendCIAMessage(COLOR_BLUE, string);
SendArmyMessage(COLOR_GREEN, string);
return 1;
}
if(WantedLevel ==3)
{
SendClientMessage(playerid, COLOR_RED, "You've attempted to rob The Four Dragons in The Strip (LV), but failed.");
GetPlayerName(playerid, pname, sizeof(pname));
SetPlayerColor(playerid, COLOR_RED);
SetPlayerWantedLevel(playerid, 6);
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has attempted to rob The Four Dragons in The Strip (LV).",pname, playerid);
SendCopMessage(COLOR_BLUE, string);
SendCIAMessage(COLOR_BLUE, string);
SendArmyMessage(COLOR_GREEN, string);
return 1;
}
}
GivePlayerMoney(playerid, mrand);
GetPlayerName(playerid, pname, sizeof(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_GREEN, string);
SetPlayerColor(playerid, COLOR_RED);
SetPlayerWantedLevel(playerid, 6);
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",pname, playerid, mrand);
SendClientMessageToAll(COLOR_RED, string);
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has robbed The Four Dragons in The Strip (LV), and got away with $%d",pname, playerid, mrand);
SendCopMessage(COLOR_BLUE, string);
SendCIAMessage(COLOR_BLUE, string);
SendArmyMessage(COLOR_GREEN, string);
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);
Max len of SendClientMessage text is 144 so check if your text is up of 144 chars