Sorry for the delay my bro. Here you go , Now you need to have more then 3 i.e. atleast 4 members around.
pawn Код:
if(strcmp(cmdtext,"/robbiz", true) ==0) //benedikt
{
new tmpid;
//new robmembers;
tmpid=IsPlayerInBiz(playerid);
new Float:pozx,Float:pozy,Float:pozz;
GetPlayerPos(playerid,pozx,pozy,pozz);
//vwor = GetPlayerVirtualWorld(playerid);
//robmembers = 1;
if(tmpid!=-1)
{
new bizfile[64],robb;
format(bizfile,sizeof(bizfile),"Businesses/%s.txt",biz[tmpid][bizname]);
robb=dini_Int(bizfile,"robbed");
if(robb == 1)
{
SendClientError(playerid,"This business has been already robbed this hour!");
return 1;
}
if(PlayerInfo[playerid][tier]<2 && MafiaMember(playerid))//>= 10
{
new handweap = GetPlayerWeapon(playerid);
if(handweap <21 || handweap > 38) return SendClientError(playerid,"You need a fire arm to start a robery!");
new rCount = 0,Float:rPos[4];
GetPlayerPos(playerid, rPos[0], rPos[1], rPos[2]);
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInRangeOfPoint(i, 20.0, rPos[0], rPos[1], rPos[2])) continue;
if(PlayerInfo[i][playerteam] != PlayerInfo[playerid][playerteam]) continue;
rCount++;
}
if(rCount > 3)
{
new xstra[MAX_STRING];
format(xstra,sizeof(xstra),"%s closed the businesses doors and started a robery !",PlayerName(playerid));
NearMessage(playerid,xstra,COLOR_ME);
dini_IntSet(bizfile,"robbed",1);
// dini_IntSet(bizfile,"closed",1);
loading[playerid]=180;
IsInRobery[playerid]=1;
RobbedBizBy[playerid]=1;
RobbedBiz[playerid]=tmpid;
for(new i; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][playerteam]==COPS || PlayerInfo[i][playerteam]==SASF || PlayerInfo[i][playerteam]==FBI)
{
new xstri[MAX_STRING];
if(!strlen(dini_Get(biz[tmpid][bizname],"name")))
{
format(xstri,sizeof(xstri),"[>]Emergency: %s is beeing robbed. Bussiness location was updated on GPS!",biz[tmpid][bizname]);
}
else
{
format(xstri,sizeof(xstri),"[>]Emergency: %s is beeing robbed. Bussiness location was updated on GPS!",dini_Get(biz[tmpid][bizname],"name"));
}
SendClientMessage(i,COLOR_ORANGE,xstri);
SetPlayerCheckpoint(i,biz[tmpid][bizenter_x],biz[tmpid][bizenter_y],biz[tmpid][bizenter_z],5);
}
}
return 1;
}
else return SendClientError(playerid, "You need atleast 4 people from your faction!");
}
else return SendClientError(playerid,"Your rank is too low !");
}
else return SendClientError(playerid,"You need to be inside a bussines to start a robery!");
}