SA-MP Forums Archive
Is it possible? String by count .. - 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: Is it possible? String by count .. (/showthread.php?tid=343599)



Is it possible? String by count .. - tal_peretz - 18.05.2012

That what I did -

PHP код:
new Count;
for(new 
0MAX_PLAYERSi++)
if(
IsPlayerConnected(i) && != playerid && !battle[i][InBattle] && GetPlayerMoneyEX(i) >= battle[playerid][MoneyBattle])
Count++;
new 
stringBig[Count*80]; 
Erros -

PHP код:
error 008must be a constant expressionassumed zero
error 009
invalid array size (negativezero or out of bounds)
error 036: empty statement
fatal error 107
too many error messages on one line 
On line -
PHP код:
new stringBig[Count*80]; 
Thanks


Re: Is it possible? String by count .. - Niko_boy - 18.05.2012

No thats not possible.


Re: Is it possible? String by count .. - tal_peretz - 18.05.2012

Quote:
Originally Posted by Niko_boy
Посмотреть сообщение
No thats not possible.
So.. how can I know how sizeof to set ? Can you know other way to do it ?


Re: Is it possible? String by count .. - Vince - 18.05.2012

It is not possible. Sizes of arrays must be known at compile time. Even if it would work, you could end up with a 40,000 cell string which would probably crash the server.