writing string into enum
#1

Код:
enum hInfo
{
hOwner[MAX_PLAYER_NAME]
};
new HouseInfo[MAX_HOUSES][hInfo];

new pName[MAX_PLAYER_NAME]; 
GetPlayerName(playerid, pName, MAX_PLAYER_NAME); 
strcat(HouseInfo[playerid][hOwner], pName);

new string[64];
format(string, 64, "%s", pName);
SendClientMessage(playerid, -1, string);
format(string, 64, "%s", HouseInfo[playerid][hOwner]);
SendClientMessage(playerid, -1, string);
I get pName message(player name) but second message is empty (that means player name is empty). How do I write what is in pName into HouseInfo[i][hOwner]
Reply
#2

In HouseInfo must be houseid not playerid and at the end strcat you need set size
pName, MAX_PLAYER_NAME);
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
In HouseInfo must be houseid not playerid and at the end strcat you need set size
pName, MAX_PLAYER_NAME);
thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)