SA-MP Forums Archive
A little problems with strings - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A little problems with strings (/showthread.php?tid=172567)



A little problems with strings - [IL]HeHu - 30.08.2010

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.


Re: A little problems with strings - Claude - 30.08.2010

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, ...);



Re: A little problems with strings - [IL]HeHu - 30.08.2010

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.


Re: A little problems with strings - CyNiC - 30.08.2010

pawn Код:
new string[MAX_PLAYER_NAME];

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

//Use the "string" as you want



Re: A little problems with strings - [IL]HeHu - 30.08.2010

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


Re: A little problems with strings - CyNiC - 30.08.2010

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