AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   String (https://forums.alliedmods.net/showthread.php?t=134041)

polodu94 07-31-2010 06:03

String
 
Hi all,

I'm very bad with string manipulation so i tell you my problem :

I have one variable por example : name[ 24 ]

I want to put one string in one case of the tab, por example :

name[ 0 ] = "Hello"
name[ 1 ] = "Ok"

But i want to put some different string not a string list por example i don't want :

string = " hello ok"

name[ 0 ] = "hello"
name[ 1 ] = "ok"

I don't want that.

I want to put some string in the tab, how i want.

Can you help me ?

I have tested :

name[ 24 ][ 32 ]

format( name[ 1 ], 31, "ok" );

But that don't done.

PS : Sorry for my english

Arkshine 07-31-2010 06:48

Re: String
 
Use copy() instead of format().

polodu94 07-31-2010 06:59

Re: String
 
I do that :

new name[ 24 ][ 33 ];

// In a function

copy( name[ num ], 32, flag );

// and in a function i show

client_print( id, print_chat, "%L", id, "SHOW_NAME", name[ num ] );

But that don't work can you help me

polodu94 07-31-2010 07:15

Re: String
 
But i use copy instead of format in my code it's copy witch i use

Arkshine 07-31-2010 07:17

Re: String
 
I know the forum was lagging.

Show the content of SHOW_NAME.

Bugsy 07-31-2010 07:18

Re: String
 
?

PHP Code:

new name][] = 
{
    
"hello",
    
"ok"
}

or

copyname] , charsmaxname[] ) , "hello" );
copyname] , charsmaxname[] ) , "ok" ); 


polodu94 07-31-2010 07:23

Re: String
 
SHOW_NAME = The name is %s

and flag contain "hello" or "ok" or everything it's a function and they are multi tell of function so :

1 tell of function name[ num ] = "hello"
seconde tell of function name[ num++ ] = "ok" or everything

polodu94 07-31-2010 07:28

Re: String
 
Sorry all it's not my problem with string it's a stupid mystek, that work with format and copy I've just forgot the number of tha tab ^^

It's 33 instead of 24 sorry and ty


All times are GMT -4. The time now is 00:16.

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