SA-MP Forums Archive
Command help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command help (/showthread.php?tid=226837)



Command help - Jimbo01 - 16.02.2011

Код:
	if(strcmp(cmd, "/bizfee", true) == 0)
	{
		new bouse = PlayerInfo[playerid][pPbiskey];
		if (bouse == -1)
		{
			SendClientMessage(playerid, COLOR_GRAD2, "   You don't own a business");
			return 1;
		}
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bizfee [EntranceFee]");
		}
		if(strval(tmp) < 0)
		{
			SendClientMessage(playerid, COLOR_WHITE, "Minimum entrance is $0");
			return 1;
		}
		if (bouse >= 100)
		{

			SBizzInfo[bouse-100][sbEntcost] = strval(tmp);
			format(string, sizeof(string), "Entrance fee set to $%d", SBizzInfo[bouse-100][sbEntcost]);
		}
		else
		{
			BizzInfo[bouse][bEntcost] = strval(tmp);
			format(string, sizeof(string), "Entrance fee set to $%d", BizzInfo[bouse][bEntcost]);
		}
		OnPropUpdate();
		SendClientMessage(playerid, COLOR_WHITE, string);
		return 1;
	}
its now that the min biz fee is 0 how can i make that the max fee is 5000 and min fee is 0 ?


Re: Command help - SmugglesJr - 16.02.2011

pawn Код:
if(strcmp(cmd, "/bizfee", true) == 0)
    {
        new bouse = PlayerInfo[playerid][pPbiskey];
        if (bouse == -1)
        {
            SendClientMessage(playerid, COLOR_GRAD2, "   You don't own a business");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bizfee [EntranceFee]");
        }
        if(strval(tmp) < 0)
        {
            SendClientMessage(playerid, COLOR_WHITE, "Minimum entrance is $0");
            return 1;
        }
                if(strval(tmp) < 5000)
        {
            SendClientMessage(playerid, COLOR_WHITE, "Maximum Entrance is $5000");
            return 1;
        }
        if (bouse >= 100)
        {

            SBizzInfo[bouse-100][sbEntcost] = strval(tmp);
            format(string, sizeof(string), "Entrance fee set to $%d", SBizzInfo[bouse-100][sbEntcost]);
        }
        else
        {
            BizzInfo[bouse][bEntcost] = strval(tmp);
            format(string, sizeof(string), "Entrance fee set to $%d", BizzInfo[bouse][bEntcost]);
        }
        OnPropUpdate();
        SendClientMessage(playerid, COLOR_WHITE, string);
        return 1;
    }
try that?


Re: Command help - Jimbo01 - 16.02.2011

works changed if(strval(tmp) < 5000) to >


Re: Command help - SmugglesJr - 16.02.2011

alright. forgot the >