SA-MP Forums Archive
Join Message not reading? - 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: Join Message not reading? (/showthread.php?tid=510262)



Join Message not reading? - DerickClark - 30.04.2014

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]);



Re: Join Message not reading? - Dignity - 30.04.2014

Can you show me the part of the code where

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


Re: Join Message not reading? - DerickClark - 30.04.2014

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)


Re: Join Message not reading? - DerickClark - 30.04.2014

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


Re: Join Message not reading? - Dignity - 30.04.2014

What's in the command?


Re: Join Message not reading? - DerickClark - 30.04.2014

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.


Re: Join Message not reading? - DerickClark - 01.05.2014

From command, Don't read the message?