SA-MP Forums Archive
writing string into enum - 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)
+--- Thread: writing string into enum (/showthread.php?tid=596546)



writing string into enum - Supermaxultraswag - 19.12.2015

Код:
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]


Re: writing string into enum - Jefff - 19.12.2015

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


Re: writing string into enum - Supermaxultraswag - 19.12.2015

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