problems with getplayername
#1

nvmm
Reply
#2

new name[64];
new text[1042];
GetPlayerName(playerid, name, sizeof(name));
format(text, sizeof(text), "Welcome to Bogdan's Stunt server. \n\n{FBFF00}Name: %s{FFFFFF}\n\nPlease enter your password below in order to register: \n", name);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register an account", text, "Register", "Close");


that's 1 example
Reply
#3

Quote:
Originally Posted by sebacol
Посмотреть сообщение
new text[1042];
What the hell is that?
1042 cells for a format where 100 or 120 cells are more than enaugh?
You should really read this thread... Why you shouldn't make your strings 256 cells big
@bogdan.trial use his code but instead of this
pawn Код:
new name[64];
new text[1042];
Use this
pawn Код:
new
    name[24],
    text[120];
Reply
#4

d:\Games\ROCKST~1\GTASAN~2\Server\GAMEMO~1\Registe r.pwn(106) : warning 204: symbol is assigned a value that is never used: "Name"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


i got this warning
Reply
#5

Change the name variable to namez or something.

new
namez[24],
text[120];

Код:
GetPlayerName(playerid, namez, sizeof(namez));
format(text, sizeof(text), "Welcome to Bogdan's Stunt server. \n\n{FBFF00}Name: %s{FFFFFF}\n\nPlease enter your password below in order to register: \n", namez);
Edit: Info, that warrning says there is already a name varaible in your script
Reply
#6

nvmm
Reply
#7

Check this: https://sampwiki.blast.hk/wiki/GetPlayerName
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)