Join Message not reading?
#1

Topic says it.
pawn Код:
INI_String("JoinMessage",PlayerInfo[playerid][JoinMessage], 28);
pawn Код:
COMMAND:joinmessage(playerid, params[])
{
    new string[128], pName[MAX_PLAYER_NAME], locfile[32];
    if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: {FFFFFF}/joinmessage [message]");
    format(string, sizeof(string), "You have set your Join Message to: %s", params);
    SendClientMessage(playerid, -1, string);
    GetPlayerName(playerid, pName, sizeof(pName));
    format(locfile, sizeof(locfile), "accounts/%s.ini", pName);
    new INI:file = INI_Open(locfile);
    INI_WriteString(file, "JoinMessage", params);
    INI_Close(file);
    return 1;
}
pawn Код:
format(Message, sizeof(Message), "(%s) join message", PlayerInfo[playerid][JoinMessage]);
Reply
#2

Can you show me the part of the code where

pawn Код:
format(Message, sizeof(Message), "(%s) join message", PlayerInfo[playerid][JoinMessage]);
actually gets used?
Reply
#3

OnPlayerDisconnect:
pawn Код:
if(fexist(UserPath(playerid)))
    {
        if(PlayerLogged[playerid] == 1)
        {
            new INI:file = INI_Open(UserPath(playerid));
            INI_SetTag(file,"data");
            INI_WriteInt(file,"Admin",PlayerInfo[playerid][pAdmin]);
            INI_WriteInt(file,"WantedLevel",GetPlayerWantedLevel(playerid));
            INI_WriteInt(file,"Score",GetPlayerScore(playerid));
            INI_WriteInt(file,"Cash",GetPlayerMoney(playerid));
            INI_WriteInt(file,"TruckerJob",PlayerInfo[playerid][TruckerJob]);
            INI_WriteString(file,"JoinMessage", PlayerInfo[playerid][JoinMessage]);
            PlayerInfo[playerid][Score] = GetPlayerScore(playerid);
            INI_Close(file);
        }
        return 1;
    }
Function:
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Score",PlayerInfo[playerid][Score]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("WantedLevel",PlayerInfo[playerid][Wanted]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Vip",PlayerInfo[playerid][pVip]);
    INI_Int("TruckerJob",PlayerInfo[playerid][TruckerJob]);
    INI_String("JoinMessage",PlayerInfo[playerid][JoinMessage], 28);
    INI_Int("Banned", PlayerInfo[playerid][pBanned]);
    return 1;
}
At first I saw 0. Then I use /joinmessage only show () not (Test)
Reply
#4

Still not reading. When creating player account, Set the message to 0, When I did /joinmessage test. Test don't show.
Reply
#5

What's in the command?
Reply
#6

Quote:
Originally Posted by Mionee
Посмотреть сообщение
What's in the command?
pawn Код:
format(locfile, sizeof(locfile), "accounts/%s.ini", pName);    
new INI:file = INI_Open(locfile);    
INI_WriteString(file, "JoinMessage", params);    
INI_Close(file);
From the file, I make it say test it works. Not by the command.
Reply
#7

From command, Don't read the message?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)