SA-MP Forums Archive
Help with system - 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: Help with system (/showthread.php?tid=558789)



Help with system - Karolukas123 - 19.01.2015

Hi, I did the fishing system, and do not really understand how to make the calculation .. let's say I have 30 fish, one fish 0.5Eur price. How to calculate how much money a player receives in total, as well as the amount he paid.


Re: Help with system - rockhopper - 19.01.2015

As you said o.5 Euro per fish right ? So you can think of 200$ Or More Per Fish
So make a variable like so
PHP код:
new fish;[The Amount of fishes player has
You can also make a enum if you wanna save it
Ok so to calculate the amount you can do something like this
PHP код:
CMD:fishsell(playerid,params[])
{
//Some Message to tell play that he sold his fishes 
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 200 fish); 
// This is give the player money 200 multiplied by how many fishes he has 

NOTE :- This is just a example for you to understand how can you make it


Re: Help with system - Karolukas123 - 19.01.2015

Oo thanks man, its very good example.. I do it on gui and fully automatic ))