Save a string in a variable?
#1

I am sending a string from my gamemode to a public in my.
How to save that string in a variable so i can use it in another public?

like:
pawn Код:
public cowvshorse(text[])
{
text = variabletosavestringin;
{

//when this public gets called
public fishvscat()
{
printf("%s", variablethatsavedstring);
I hope you understand me and would be able to help!
Reply
#2

Make it global, put it at the top of your script
Reply
#3

pawn Код:
new youtext;

public cowvshorse(text[])
{
   youtext=text;
{

//when this public gets called
public fishvscat()
{
printf("%s", youtext);
Reply
#4

Jesus Christ...

pawn Код:
new Variable[ 32 ]; // Greater than number of characters + 1

public cowvshorse()
{
     format( Variable, sizeof( Variable ), "variabletosavestringin" );
}

public fishvscat()
{
     print( Variable );
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)