[HELP] help me with string
#1

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

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

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.
Reply
#3

you gotta do in your emun

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

Then use it as you did.
Reply
#4

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:
Reply
#5

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. ._.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)