Storing a vaule
#1

Hey guys, this might be a nooby question, but I can't figure this out, might just be how tired I am.

I want to store a value of "baddress" basically, I want it to start at 1000, so I had first did:

pawn Код:
new baddress = 1000;
But now, on /bcreate which is my business create command, I did

pawn Код:
baddress ++;
therefore making the address 1001. But, Now i do it again, and it comes out at 1001 again, so how could I store the 1001, therefore making 1002, then 1003..etc. Thank you advance! I use mysql, if thats important to know.
Reply
#2

Quote:
Originally Posted by Abreezy
Посмотреть сообщение
Hey guys, this might be a nooby question, but I can't figure this out, might just be how tired I am.

I want to store a value of "baddress" basically, I want it to start at 1000, so I had first did:

pawn Код:
new baddress = 1000;
But now, on /bcreate which is my business create command, I did

pawn Код:
baddress ++;
therefore making the address 1001. But, Now i do it again, and it comes out at 1001 again, so how could I store the 1001, therefore making 1002, then 1003..etc. Thank you advance! I use mysql, if thats important to know.
Hello friend,

Hmm, so you are making a command called "/bcreate" and want to start the value from 1000, so it increases a digit on each time when type the command /bcreate.

Well then actually in my opinion it's correct to use "baddress++;" as it increase 1 digit on each time the command is used (The value will not be saved in the MySQL database unless you run a mysql_query, this is just a temporary value it will be turned back to 1000 when the server restarts).

If this is what you meant then i guess i've helped you if not then please try to explain even more better.

-FalconX
Reply
#3

The baddress value show be global !
So it can store its value.
Reply
#4

Yeah, I found quick fix to my issue, I place new baddress = 1000; in the loading of business, with a baddresss++; so now when I load business, it loads the last digit i was at in the 1000s therefore placing the next one with /bcreate.

Thank you both for your responses though.
Reply
#5

Quote:
Originally Posted by Abreezy
Посмотреть сообщение
Yeah, I found quick fix to my issue, I place new baddress = 1000; in the loading of business, with a baddresss++; so now when I load business, it loads the last digit i was at in the 1000s therefore placing the next one with /bcreate.

Thank you both for your responses though.
No problem mate.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)