How to writing string into enum?
#1

Hi guys.
I wanna writing string into enum.
It`s right?;
Код:
enum pInfo
{
pChengHao[24]
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
PlayerInfo[playerid][pChengHao]=strlen(inputtext);
I don`t know why.They give me to save some strange code
Reply
#2

Hi

where you save this enum (.ini, .sav, or only in vairable or where)
Reply
#3

Quote:
Originally Posted by TadePoleMG
Посмотреть сообщение
Hi

where you save this enum (.ini, .sav, or only in vairable or where)
I just want to writing string into enum

And save to users .ini:
Код:
INI_WriteString(File,"ChengHao",PlayerInfo[playerid][pChengHao]);
(Saving is no problem,string enum have some bug)

Sorry my bad English
Reply
#4

Can you tried
that

PHP код:
// PlayerInfo[playerid][pChengHao]=strlen(inputtext); 
Is it returns error.
Reply
#5

Here you go :-

PHP код:
 // Use memcpy
// Example
new destination[64] = "Hi";
new 
source[] = "String";
memcpy(destinationsourcestrlen(destination) * 4sizeof source 4sizeof destination); 
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=265433 ; Use strcpy or format.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)