Quesiton :)
#1

[MP]Ditch;1820010']
Код:
}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 > 5)
			    {
			        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!");
	}
This command lets you start a robbery only if you're 6 members in the business, but I wanted it to be 4.
What have I done wrong? With 6 people it works perfectly but still sux I need it 4

Thanks!
Reply
#2

Why is my name in here?:L
Reply
#3

I didnt know how to make th code thing so I copyed from you post might be taken to much
Reply
#4

Will fix the command later brother. Will post it for sure
Reply
#5

I will fix it when I get home if Ballu doesn't do it.
Reply
#6

Haven't figured it out yet, sux.
Reply
#7

Quote:
Originally Posted by AdamCooper
Посмотреть сообщение
Haven't figured it out yet, sux.
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!");
    }
Reply
#8

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
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!");
    }
Thanks gonna try it now
Reply
#9

Alll good Oshri ! Thanks for the rep.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)