SA-MP Forums Archive
Skin once owned can't be bought buy someone else - 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: Skin once owned can't be bought buy someone else (/showthread.php?tid=611010)



Skin once owned can't be bought buy someone else - fuckingcruse - 01.07.2016

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.


Re: Skin once owned can't be bought buy someone else - SickAttack - 01.07.2016

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.


Re: Skin once owned can't be bought buy someone else - fuckingcruse - 01.07.2016

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?


Re: Skin once owned can't be bought buy someone else - SickAttack - 01.07.2016

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.


Re: Skin once owned can't be bought buy someone else - AroseKhanNiazi - 02.07.2016

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;..