SA-MP Forums Archive
Bug problem need 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)
+--- Thread: Bug problem need help (/showthread.php?tid=600504)



Bug problem need help - Mijata - 09.02.2016

Player can't get +5 score when have fish



Код:
CMD:sellfish(playerid,params[])
{
    if(!IsPlayerInRangeOfPoint(playerid,5.0,2332.2595,564.6697,7.9927))
	    return SendClientMessage(playerid,-1,"{00FF00}[SERVER]:{FFFFFF} You are not near the Fishing Pier Shop");

	new string[128], pay;
	pay = FishWeigh[playerid]*Fish_Price;
	format(string,sizeof(string),"{00FF00}[SERVER]:{FFFFFF} You have earned %i$ by selling your %i kilograms     of fish and got +5 score ",pay,FishWeigh[playerid]);
	SendClientMessage(playerid,-1,string);
	FishWeigh[playerid] = 0;
        FishOnPlayer[playerid] = 0;
	GivePlayerMoney(playerid,pay);
	if(FishWeigh[playerid] == 0) return SendClientMessage(playerid,-1,"You don't have any fish");
	else if(FishWeigh[playerid] == 1)
	SetPlayerScore(playerid, GetPlayerScore(playerid) +5);
	return 1;
}



Re: Bug problem need help - Mijata - 09.02.2016

bump


Re: Bug problem need help - ikey07 - 09.02.2016

FishWeigh[playerid] = 0;
FishOnPlayer[playerid] = 0;
GivePlayerMoney(playerid,pay);
if(FishWeigh[playerid] == 0) return SendClientMessage(playerid,-1,"You don't have any fish");
else if(FishWeigh[playerid] == 1)


It will never be 1, as you already reset it to 0