08.08.2009, 20:31
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:
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:
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.
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];
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)
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.