SA-MP Forums Archive
[HELP] help me with string - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] help me with string (/showthread.php?tid=294016)



[HELP] help me with string - Dirkon - 30.10.2011

Hey,
I'm kinda sleepy right now and I can't figure this out:

How can I do this:
pawn Код:
PlayerInfo[playerid][Nation] = "american";
?


Re: [HELP] help me with string - Stigg - 30.10.2011

Quote:
Originally Posted by Dirkon
Посмотреть сообщение
Hey,
I'm kinda sleepy right now and I can't figure this out:

How can I do this:
pawn Код:
PlayerInfo[playerid][Nation] = "american";
?
Try:

pawn Код:
format(PlayerInfo[playerid][Nation],25,"american");
See if that helps.


Re: [HELP] help me with string - sleepysnowflake - 30.10.2011

you gotta do in your emun

enum SumEnum
{
blabla,
nation[25] // This means it is a string.
}

Then use it as you did.


Re: [HELP] help me with string - i514x - 30.10.2011

Fastest way is to use strcpy. Its in the YSI 3.0, if you don't want to use it then just at the top of ur gamemode add:
pawn Код:
#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)
and then:
pawn Код:
strcpy(PlayerInfo[playerid][Nation], "American", 9);
@down:


Re: [HELP] help me with string - KoczkaHUN - 30.10.2011

Add this to the top of your script:
pawn Код:
#define strcopy(%0,%1) strcat((%0[0] = 0, %0), %1)
Then copy strings like this:
pawn Код:
strcopy(PlayerInfo[playerid][Nation], "american");
Edit: damn, I am beaten. ._.