Buying help
#2

Ok, so basically in order to make a item like your laptop, you have to define a variable and use that variable as if it was the laptop.

I'm not sure if you save player stats, because saving the variable will differ, depending on the way you save your stats.

But basically, you define a variable for each player, or if you have stat saving, you define one variable per stat set.

Without Stat Saving:
Код:
new HasLaptop[MAX_PLAYERS];
With Stat Saving:
If your stat system uses an enum, you have to add the HasLaptop variable to that enum. Along with that, you also need to add it to the save/load functions.

When you have the variable created, whenever the player uses the laptop command, so lets say /laptop, you check if the variable is 1, if it is, then the command will succeed.

Without Stat Saving:
Код:
if(HasLaptop[playerid] == 1)
Also, when the player buys the laptop, you should set the variable to 1.

I hope this helps. It is mainly concept, since you didn't mention how you save stats, etc. But it should give you an idea.
Reply


Messages In This Thread
Buying help - by XtremeChio - 08.08.2009, 20:21
Re: Buying help - by XPlatform - 08.08.2009, 20:31
Re: Buying help - by XtremeChio - 08.08.2009, 20:47
Re: Buying help - by XPlatform - 08.08.2009, 21:03

Forum Jump:


Users browsing this thread: 1 Guest(s)