Need help :)
#1

How can I detect if player has bought some stuff from a shop.
Example: If he has bought a Watch or maybe MP3 or drink from a 24/7 (example from Roleplay)

And then I need to know letґs say if he has bought a watch that he cant use it
if he didnt bought it.

Thanks for the help !
Reply
#2

have you created it so the player can buy something from the shop, because nobody wants to explian the entire proccess of scripting how to buy something from a shop, then detecting what was bought
Reply
#3

Quote:
Originally Posted by mrcoolballs
Посмотреть сообщение
have you created it so the player can buy something from the shop, because nobody wants to explian the entire proccess of scripting how to buy something from a shop, then detecting what was bought
I know how to create that player can buy something from a shop,
I just need to know how to detect is he has bought that and if he hasnt bought it.
Reply
#4

use variables.

you're welcome for the help!
Reply
#5

create a variable
pawn Код:
new BoughtItem[MAX_PLAYERS];
then when the player buys the item:
pawn Код:
BoughtItem[playerid] = 1;
and then when you want to check if the player has bought the item:
pawn Код:
if(BoughtItem[playerid] == 1)
{
    // do stuff
}
else
{
    //player hasn't bought the item
    return 1;
}
Reply
#6

Quote:
Originally Posted by mrcoolballs
Посмотреть сообщение
create a variable
pawn Код:
new BoughtItem[MAX_PLAYERS];
then when the player buys the item:
pawn Код:
BoughtItem[playerid] = 1;
and then when you want to check if the player has bought the item:
pawn Код:
if(BoughtItem[playerid] == 1)
{
    // do stuff
}
else
{
    //player hasn't bought the item
    return 1;
}
ok thanks I am going to try if it works !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)