How can i fix this?
#3

Code:
	if(strcmp(cmd, "/buygun", true) == 0) // Trunk system
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid, 100.0, 286.0414,-38.7380,1001.5156))
            {
	            new x_nr[64];
	            x_nr = strtok(cmdtext, idx);
	            if(!strlen(x_nr))
	            {
	                SendClientMessage(playerid, COLOR_WHITE, "HINT: /buygun [name]");
	                SendClientMessage(playerid, COLOR_WHITE, "Available guns: Deagle($15,000) | MP5($5,000) | M4($75,000) | AK47($70,000)");
	                return 1;
	            }
	            if(strcmp(x_nr,"deagle",true) == 0)
	            {
	                if(PlayerInfo[playerid][pInBiz] == 255)
	                {
	                    SendClientMessage(playerid, COLOR_GREY, "  You need to be in a ammu nation business to buy this gun!");
	                    return 1;
	                }
	                if(PlayerInfo[playerid][pCash] < 15000)
	                {
	                    SendClientMessage(playerid, COLOR_GREY, "ERROR: You cannot afford this !");
	                    return 1;
	                }
	                new bizid = PlayerInfo[playerid][pInBiz];
	                PlayerInfo[bizid][bTill] += 7500;
	                PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-15000;
	                GivePlayerMoney(playerid, -15000);
	                SendClientMessage(playerid, COLOR_GREY, " You bought a Desert Eagle for ($15,000)!");
	                GivePlayerGun(playerid, 24);
	                return 1;
	            }
	            if(strcmp(x_nr,"m4",true) == 0)
	            {
                    if(PlayerInfo[playerid][pInBiz] == 255)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  You need to be in a ammu nation business to buy this gun!");
                        return 1;
                    }
                    if(PlayerInfo[playerid][pCash] < 75000)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "ERROR: You cannot afford this !");
                        return 1;
                    }
                    new bizid = PlayerInfo[playerid][pInBiz];
                    PlayerInfo[bizid][bTill] += 37500;
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-75000;
                    GivePlayerMoney(playerid, -75000);
                    SendClientMessage(playerid, COLOR_GREY, " You bought a M4 for ($75,000)!");
                    GivePlayerGun(playerid, 31);
                    return 1;
	            }
	            if(strcmp(x_nr,"ak47",true) == 0)
	            {
                    if(PlayerInfo[playerid][pInBiz] == 255)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  You need to be in a ammu nation business to buy this gun!");
                        return 1;
                    }
                    if(PlayerInfo[playerid][pCash] < 70000)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "ERROR: You cannot afford this !");
                        return 1;
                    }
                    new bizid = PlayerInfo[playerid][pInBiz];
                    PlayerInfo[bizid][bTill] += 35000;
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-70000;
                    GivePlayerMoney(playerid, -70000);
                    SendClientMessage(playerid, COLOR_GREY, " You bought a AK47 for ($70,000)!");
                    GivePlayerGun(playerid, 30);
                    return 1;
	            }
	            if(strcmp(x_nr,"mp5",true) == 0)
	            {
                    if(PlayerInfo[playerid][pInBiz] == 255)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  You need to be in a ammu nation business to buy this gun!");
                        return 1;
                    }
                    if(PlayerInfo[playerid][pCash] < 5000)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "ERROR: You cannot afford this !");
                        return 1;
                    }
                    new bizid = PlayerInfo[playerid][pInBiz];
                    PlayerInfo[bizid][bTill] += 2500;
                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-5000;
                    GivePlayerMoney(playerid, -5000);
                    SendClientMessage(playerid, COLOR_GREY, " You bought a MP5 for ($5,000)!");
                    GivePlayerGun(playerid, 29);
                    return 1;
	            }
	            else
	            {
	                SendClientMessage(playerid, COLOR_WHITE, "HINT: /buygun [name]");
	                SendClientMessage(playerid, COLOR_WHITE, "Available guns: Deagle($15,000) | MP5($5,000) | M4($75,000) | AK47($70,000)");
	                return 1;
	            }
            }
        }
        return 1;
    }
/Spoonfed.
Reply


Messages In This Thread
How can i fix this? - by $$Money$$ - 19.12.2011, 23:07
Re: How can i fix this? - by -Rebel Son- - 19.12.2011, 23:47
Re: How can i fix this? - by coole210 - 20.12.2011, 01:24

Forum Jump:


Users browsing this thread: 3 Guest(s)