Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 13,040 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
STRING* arrays #178712
01/19/08 11:51
01/19/08 11:51
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline OP
Senior Expert
Quad  Offline OP
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
i want to declare a string array to use with half-life console-like thingy.

STRING* console_strs[20] = {"#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60"};

didnt work.

any ideas?


3333333333
Re: STRING* arrays [Re: Quad] #178713
01/20/08 00:16
01/20/08 00:16
Joined: Dec 2006
Posts: 78
Nevada, USA
Futurulus Offline
Junior Member
Futurulus  Offline
Junior Member

Joined: Dec 2006
Posts: 78
Nevada, USA
You could make a loop in a startup function that fills your array.
Code:
STRING* console_strs[20];
function fillstrs_startup()
{
var s;
for(s = 0; s < 20; s++)
console_strs[s] = str_create("#60");
}

You wouldn't be able to use console_strs in other startup functions, though.

How, exactly, didn't it work? Did you get an error, or did the strings show up empty somewhere in the script?

Re: STRING* arrays [Re: Futurulus] #178714
01/21/08 23:21
01/21/08 23:21
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline OP
Senior Expert
Quad  Offline OP
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quote:

You could make a loop in a startup function that fills your array.
Code:
STRING* console_strs[20];
function fillstrs_startup()
{
var s;
for(s = 0; s < 20; s++)
console_strs[s] = str_create("#60");
}

You wouldn't be able to use console_strs in other startup functions, though.

How, exactly, didn't it work? Did you get an error, or did the strings show up empty somewhere in the script?




Actually i use only one STRING* for console strings and appending it after actions but thank you for your reply.

I dont remember exactly but it was like a syntax error or something. I mean it doesnt even start, it throws an error.


3333333333

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1