SetPlayerName only works once per user?
#3

Quote:
Originally Posted by backwardsman97
I don't think you can make an enumeration like that.

pawn Код:
enum PlayerInfo
{
  name[24];
}

new pInfo[MAX_PLAYERS][PlayerInfo];
I assume you have something like that. I think that is invalid. You could store the player's name in a file in response to their id. I can help with that if that's what you want.
No, actually it stores the name perfectly,

Код:
if(samp_mysql_num_rows() == 0)
{
format(str, 128, "{SERVER} The name '%s' is not registered, if you want to register it use /REGISTER <PASSWORD>", pInfo[playerid][name]);
} else {
format(str, 128, "{SERVER} The name '%s' is registered, if you want to login use /LOGIN <PASSWORD>", pInfo[playerid][name]);
samp_mysql_fetch_row(mysqlid);
pInfo[playerid][mysql]         	= strval(mysqlid);
}
Shows the name flawlessly


And my pInfo is set up like this

// Enumerating variables
enum PLAYER_DATA_ARRAY{
mysql,
name,
loggedin
}
new pInfo[MAX_PLAYERS][PLAYER_DATA_ARRAY];



ADDON:
Ran a blank gamemode with this change

Код:
public OnPlayerConnect(playerid)
{
	SetPlayerName(playerid, "Test1");
	SetPlayerName(playerid, "Test2");
	return 1;
}
The name was Test2, so something must be wrong with the script. Either that or a name can only be changed when it's OnPlayerConnect

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)