Posts: 528
Threads: 70
Joined: Nov 2014
Reputation:
0
as the title says, i am going to make a skin buying system using y_ini and zcmd. Probably, if the skin is already bought, then if other player tries to buy that skin, he must not be able to buy it. How can i make a restriction in this case? Thank you in advance.
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
By saving some data, isn't it obvious? I think you already know that since you put "Scripting for money, I can script anything except MySQL" or something like that on your signature one time.
But yeah, create a file for each skin and put 0 in it if the skin isn't bought and 1 if it is.
Posts: 528
Threads: 70
Joined: Nov 2014
Reputation:
0
Yes buddy, but i was confuse with 1 thing, Like if i buy skin id 299, and save it in player's account. Now if someone try to buy that same skin, he must be restricted. And as you said i must save each skin in 1 file, if i do so, in buying skin cmd, i must write 20-25lines for each skin. So, there there no possible way for loop?
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
You can save all the skins that can be bought with its owned state by it in a file, and read the file, save the values in an array and use the array for all your needs.
Posts: 1,349
Threads: 194
Joined: Jan 2014
Reputation:
0
Just run a loop for all the skins; create a file with that loop taken skins = 1 non taken = 0 check if it's taken on PlayerRequestClass return 0;..