Little Help
#1

Hello.Today I created my Material Shop.It`s working perfect.But when zombies come there they need to sell materials.But if I check how many materials have that zombie.And example that zombie have 3 materials.And he want to sell them all.And one material costs 500$ example.How can I check how many materials have if he have 3 just to sell them for some 1500 dollars how can I make it!(OMG Sorry I am bad with explaining!)
Reply
#2

When they buy materials, where do you store it? In a variable?
Then use the same variable to check how many materials they have...
Reply
#3

Quote:
Originally Posted by Siralos
Посмотреть сообщение
When they buy materials, where do you store it? In a variable?
Then use the same variable to check how many materials they have...
I am using mySQL so but i am storing it to "UserStats[playerid][Exp]"(variable).
Reply
#4

Then, if a zombie buys a material, you do UserStats[playerid][Exp]++
So, when selling, you should do:
new price = UserStats[playerid][Exp] * 500
So, if the zombie has bought 3 materials, in price you will have '1500'
Reply
#5

Quote:
Originally Posted by Siralos
Посмотреть сообщение
Then, if a zombie buys a material, you do UserStats[playerid][Exp]++
So, when selling, you should do:
new price = UserStats[playerid][Exp] * 500
So, if the zombie has bought 3 materials, in price you will have '1500'
but why variable when you are not using it?
Reply
#6

You are not using the variable? Then you are storing the materials directly into MySQL?
Reply
#7

Quote:
Originally Posted by Siralos
Посмотреть сообщение
You are not using the variable? Then you are storing the materials directly into MySQL?
Lol no..My question was means why you using variable "price".When you don`t using in script!
Reply
#8

Well, then you can directly do:

GivePlayerMoney(playerid, UserStats[playerid][Exp] * 500);
UserStats[playerid][Exp] = 0;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)