Variable Initialiser
#1

Hi! I must initialise a variable with an Integer number value. I tried this:

new Integer:SavedInterior[MAX_PLAYER]

But isn't the thing I need. Via command, players can load saved interior, but interior values are integer numbers, not floating point numbers (new Float:blabla[MAX_PLAYERS]).

How I can initialise a variable with Integer number value?
Reply
#2

Don't you use int instead of Interger? I'm sure codes work like that
Reply
#3

pawn Код:
new SavedInterior[MAX_PLAYERS];
Or do you need to pad it with 0?
Because int is standard actually.
Reply
#4

DeathOnaStick thank you!! ^_^
I forgot that!!! Now my code works!
Reply
#5

Once you initialize a variable. It default becomes an integer number as long as you don't save text characters inside.

For Example
pawn Код:
new szValue = 5 ; // 5 was saved in variable szValue as integer
Reply
#6

Quote:
Originally Posted by BlackAtom
Посмотреть сообщение
DeathOnaStick thank you!! ^_^
I forgot that!!! Now my code works!
Np, happens to me quite as often when I switch from Java to Pawn.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)