22.02.2009, 10:31
Is a good idea, but I have a few suggestions which would make changing the script in future that little bit easier.
1.) You could use DEFINE's at the top of your script which set how much each gun costs. (You could also define which weapons are available but I wont go into that)
Example:
2.) Someone else pointed out that your money goes into the negative, so if you try to buy a gun which you do not have the money for you end up with -$00005
This is fairly easy to stop, it just requires something like:
The script is fully functional, but these are just some suggestions to make modifying it simpler!
1.) You could use DEFINE's at the top of your script which set how much each gun costs. (You could also define which weapons are available but I wont go into that)
Example:
pawn Код:
#define DEAGPRICE 300
GivePlayerMoney(playerid, - DEAGPRICE);
This is fairly easy to stop, it just requires something like:
pawn Код:
if(GetPlayerMoney(playerid) >= DEAGPRICE)
{
GivePlayerMoney(playerid, - DEAGPRICE);
}
else
{
GameTextForPlayer(playerid, "You can't afford this!", 5000, 3);
}

