Variable
#1

can someone tell me how to save a variable? e.g new clan[MAX_PLAYERS];
Reply
#2

You could use dINI/dUDB for that.
Reply
#3

yeah i know can you give me an example?
Reply
#4

There are enough examples in this topic.
Reply
#5

Quote:
Originally Posted by tour15
can someone tell me how to save a variable? e.g new clan[MAX_PLAYERS];
pawn Код:
new clan[MAX_PLAYERS]; // Ontop of your script

// And when you wanna set the player to that, either with command or with a public function w/e;

clan[playerid] = 1; // Wherever you want to set the player to this

// And If you wanna check that, wherever, use this;

if((clan[playerid]==1)){
// do w/e
}else{
// do w/e if he's not
return 1;
}
Reply
#6

Quote:
Originally Posted by mavtias
Quote:
Originally Posted by tour15
can someone tell me how to save a variable? e.g new clan[MAX_PLAYERS];
pawn Код:
/* code */
He was not asking how to set or check a variable, he was asking how to save it.
Reply
#7

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by mavtias
Quote:
Originally Posted by tour15
can someone tell me how to save a variable? e.g new clan[MAX_PLAYERS];
pawn Код:
/* code */
He was not asking how to set or check a variable, he was asking how to save it.
Well, my code does save It the way he asked for, not the way you suggested.
It's saved until he disconnects, in the variable without scriptfiles....
Reply
#8

Quote:
Originally Posted by mavtias
Well, my code does save It the way he asked for, not the way you suggested.
It's saved until he disconnects, in the variable without scriptfiles....
No, your way does not save it, he was asking how to save it permanent, not temporary.
Reply
#9

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by mavtias
Well, my code does save It the way he asked for, not the way you suggested.
It's saved until he disconnects, in the variable without scriptfiles....
No, your way does not save it, he was asking how to save it permanent, not temporary.
Where does It say permament?
He showed us the way he'd like to use It, and I made an example how he can do It the way he asked for.
Reply
#10

Quote:
Originally Posted by mavtias
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by mavtias
Well, my code does save It the way he asked for, not the way you suggested.
It's saved until he disconnects, in the variable without scriptfiles....
No, your way does not save it, he was asking how to save it permanent, not temporary.
Where does It say permament?
He showed us the way he'd like to use It, and I made an example how he can do It the way he asked for.
He says "save" not "store", you save data in files, you store values in variables which are destroyed at gmx.
Reply
#11

Well, you don't save It in scriptfiles the way he showed us. Maybe he meant "store" temporarily, because I was just finishing his example, how to use it.
Reply
#12

Quote:
Originally Posted by mavtias
Well, you don't save It in scriptfiles the way he showed us. Maybe he meant "store" temporarily, because I was just finishing his example, how to use it.
Indeed you don't, you are correct if he meant how to store a value in a variable but if he meant to save the variables value at gmx then you would require file IO like has been said.
Reply
#13

Quote:
Originally Posted by Donny
Quote:
Originally Posted by mavtias
Well, you don't save It in scriptfiles the way he showed us. Maybe he meant "store" temporarily, because I was just finishing his example, how to use it.
Indeed you don't, you are correct if he meant how to store a value in a variable but if he meant to save the variables value at gmx then you would require file IO like has been said.
Yeah.
Reply
#14

hey guys the thing i meant is that i want to temporary save it... how can i make when a player disconect save the variable?
Reply
#15

Quote:
Originally Posted by tour15
hey guys the thing i meant is that i want to temporary save it... how can i make when a player disconect save the variable?
Temporary Is used when you don't wanna save It on disconnect.
Permament Is when you save It forever, well, until you decide to change it.

Temporary; as my example
Permament;
dini/dubd
Reply
#16

i want to use this forever sorry for my bad english
Reply
#17

Quote:
Originally Posted by tour15
i want to use this forever sorry for my bad english
I already told you, use dINI/dUDB.
Reply
#18

I saw the tutorials but that made me more confused...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)