AlliedModders

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

abhishek_deshkar 07-13-2013 11:12

Simple Help !
 
Hello pro ppl,

I need a little help. So, for example I have two integer numbers or two strings and if I want to combine both strings to one string or number then how it can be done in AMX ?


Thanks

YamiKaitou 07-13-2013 11:36

Re: Simple Help !
 
format(ex)

abhishek_deshkar 07-13-2013 12:08

Re: Simple Help !
 
Okay ! Another thing is if I have an array of my name and I want to combine array data and store it into a string variable ?

abhishek_deshkar 07-13-2013 12:18

Re: Simple Help !
 
Quote:

Originally Posted by YamiKaitou (Post 1990074)
format(ex)

One example will be fine !

akcaliberg 07-13-2013 14:55

Re: Simple Help !
 
new szBuffer[64];
formatex( szBuffer, charsmax(szBuffer), "%s %s", szFirstText, szSecondText)

YamiKaitou 07-13-2013 15:27

Re: Simple Help !
 
Quote:

Originally Posted by abhishek_deshkar (Post 1990101)
One example will be fine !

Your examples are found when you search

abhishek_deshkar 07-13-2013 15:44

Re: Simple Help !
 
Quote:

Originally Posted by akcaliberg (Post 1990182)
new szBuffer[64];
formatex( szBuffer, charsmax(szBuffer), "%s %s", szFirstText, szSecondText)

I mean, for example I have an array of name[2] and array contains "GOD" word.

so each index will have 1 word. Now I want to convert array data to a string variable so when I call string variable "GOD" should be printed !

YamiKaitou 07-13-2013 15:55

Re: Simple Help !
 
Not possible as "GOD" is 3 characters and can only fit in an array of 4 or larger.

A string is an array of characters. So what are you trying to do?

abhishek_deshkar 07-13-2013 15:59

Re: Simple Help !
 
I just want to convert Array data to String. Actually I want to store whole array data into the string variable !

YamiKaitou 07-13-2013 16:13

Re: Simple Help !
 
A string is already an array. Show us what you are working with and then maybe we can help you


All times are GMT -4. The time now is 06:23.

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