Error with displaying name on OnPlayerConnect
#1

When a player connects, it only shows the last pieces of the name, not the whole entire name..


pawn Код:
new IP[16], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new amessage[256];
format(amessage, sizeof(amessage), "%s has connected to the server! ID: %d IP: %s", name[playerid], playerid, IP);
SendMessageToAdmins(amessage, COLOR_LIGHTRED);
Reply
#2

Код:
new IP[16], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new amessage[256];
format(amessage, sizeof(amessage), "%s has connected to the server! ID: %d IP: %s", name, playerid, IP);
SendMessageToAdmins(amessage, COLOR_LIGHTRED);
Reply
#3

You are mis-using the cells. You just want to use "name" not "name[playerid]". Strings are made of cells; and you are trying to access a part of the string; therefore not the entire string.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)