Variable Initialiser - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Variable Initialiser (
/showthread.php?tid=364779)
Variable Initialiser -
BlackAtom - 31.07.2012
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

?
Re: Variable Initialiser -
MaDK1LLA - 31.07.2012
Don't you use int instead of Interger? I'm sure codes work like that
Re: Variable Initialiser -
DeathOnaStick - 31.07.2012
pawn Код:
new SavedInterior[MAX_PLAYERS];
Or do you need to pad it with 0?
Because int is standard actually.
Re: Variable Initialiser -
BlackAtom - 31.07.2012
DeathOnaStick thank you!! ^_^
I forgot that!!! Now my code works!
Re: Variable Initialiser -
iFizzy - 31.07.2012
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
Re: Variable Initialiser -
DeathOnaStick - 31.07.2012
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.