ID on a variable
#1

I've been experiencing troubles on getting the ID and putting it on a variable, I could not use CallLocalFunction because I will use a public for it. I will show you an example on how it will work:

- Activate it using a command(with the ID)
- Saving the ID on the variable
- Set the variable into a public(e.g. OnPlayerKeyStateChange)
- Ta-da! Thaz it. Hao du I du it.
Reply
#2

For example.

Okay, so make global variable (which can be used in any functions).
Q."How can I make it ?"
Ans. At the top of your gamemode insert "new var;"(you can name it on your own)

Under your command ,save the ID in this global variable named as "var".

Then,apply/set the variable under OnPlayerKeyStateChange.
Reply
#3

Already tried that and it didn't work.
Reply
#4

If you can PM or post your code ,it would be better ..
Reply
#5

I don't understand of what you're trying to create.

For what I did for adding IDs is by MySQL (using mysql_insert_id), and insert it into the var.
pawn Код:
new id = mysql_insert_id();
format(msg, 5, "ID is %i", id);
So it would produce an auto-increment ID starting from 1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)