A little problems with strings
#1

look i'm trying to insert a name of a player which was inserted inside a dialog into a string.
this is the string:
PHP код:
new plname[MAX_PLAYERS][MAX_PLAYER_NAME]; 
and than i did a dialog of the input style, and the player need to write a name inside the dialog.
than i'm checking if the name is valid and it is registered, this works!
but than i tried inserting this name into a string(plname), but damn this doesn't work!.
can you help me? i hope i explained it well enough.
Reply
#2

pawn Код:
new plname[MAX_PLAYERS][MAX_PLAYER_NAME];
??
It should be

pawn Код:
new plname[MAX_PLAYER_NAME];
pawn Код:
GetPlayerName(playerid, plname, sizeof plname);
format(string, sizeof string,"Example: %s", plname);
ShowPlayerDialog(.., string, ...);
Reply
#3

no, no you didn't understand.
Look: i already got the name, and i tried doing it this way:
PHP код:
strins(plname[playerid],inputtext,24); 
but it doesn't work.
Reply
#4

pawn Код:
new string[MAX_PLAYER_NAME];

format(string,sizeof string,"%s",plname[playerid]);

//Use the "string" as you want
Reply
#5

I know all this stuff, well probably no one understood.
forget about it, you may lock this thread i'll try on my own..
Reply
#6

Do debug, use printf to see what have in the string, maybe any thing was reseted him.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)