[HELP] Fix buycomponent
#1

Код:
CMD:buycomponent(playerid, params[])
{
    if(!IsAtComponent(playerid))
    {// Component
		SendClientMessageEx(playerid, COLOR_GREY, "Kamu tidak sedang ada di toko komponen (Ocean Docks).");
		return 1;
    }
    if(PlayerInfo[playerid][pJob] != 7 && PlayerInfo[playerid][pJob2] != 7)
	{
		SendClientMessageEx(playerid, COLOR_GREY, "Kamu bukan mechanic.");
		return 1;
	}
    new component, string[128];
	if(sscanf(params, "d", component))
	    return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /buycomponent [jumlah]");
    if(component < 1)
        return SendClientMessageEx(playerid, COLOR_WHITE, "Error: Invalid amount of component!");

	if (GetPlayerCash(playerid) >= component*10)
	{
		PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
		PlayerInfo[playerid][pComponent] += component;
		GivePlayerCash(playerid, -(component*10));
		SaveAccountsUpdate();
		format(string, sizeof(string), "Kamu telah membeli %d component seharga $%d", component, component*10);
		SendClientMessageEx(playerid, COLOR_GREEN, string);
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
    }
	return 1;
}
how to fix /buycomponent on my script?
i use /buycomponent -250000000 and -2500000000 , directly get the money 99999999

how to fix that /buycomponent -250000000 and -2500000000 no more bugs?


#sorry for bad my english
Reply


Messages In This Thread
[HELP] Fix buycomponent - by Elanggg - 05.04.2014, 11:55
Re: [HELP] Fix buycomponent - by LocMax - 05.04.2014, 12:10
Re: [HELP] Fix buycomponent - by CutX - 05.04.2014, 13:11
Re: [HELP] Fix buycomponent - by Elanggg - 06.04.2014, 06:08

Forum Jump:


Users browsing this thread: 1 Guest(s)