Raised This Month: $ Target: $400
 0% 

Join a array of strings into one string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FullThrottle
Member
Join Date: Oct 2004
Old 10-12-2004 , 12:37   Join a array of strings into one string
Reply With Quote #1

I would like to take a array of rules I have and join them together to display them on the screen as a hud message. What would be the best way to do this. Here is an example.

amxx.cfg

Code:
amx_addrule "Respect the Admins"
amx_addrule "No Team Killing"
Displayed to the user upon team select in a tsay type message in the top left of the screen.

Code:
Server Rules
1. Respect the Admins
2. No Team Killing
I tried looping through with each line as a new hud message and on a different channel but I think there must be a better way.

I have everything working except the joining of the strings and displaying on the screen part.

Thanks for your help.
FullThrottle is offline
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 10-12-2004 , 22:50  
Reply With Quote #2

Code:
#define ArraySize 10 new MyString[65] new MyArray[ArraySize+1][32] for(new i=0;i<=ArraySize;i++) format(MyString,64,"%s %s",MyString,MyArray[i])

This is how i normaly do it
EKS is offline
FullThrottle
Member
Join Date: Oct 2004
Old 10-13-2004 , 00:07  
Reply With Quote #3

This is how I ended up doing it in my plugin

Code:
	for (new i=0; i<num_rules; ++i){
		add(str_rules,len,rulelist[i])
	}
FullThrottle is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode