Its not doing nothing
#9

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
It's not doing nothing, in the player file, all it do is Message: 0, how I fix message ? like
Message: Hello

pawn Код:
Password: ^
Admin: 0
Jailed: 0
Wanted: 0
Bans: 0
BanTime: 0
TruckerLicense: 0
BusLicense: 0
StatsMetersDriven: 0.000000
StatsTruckerJobs: 0
StatsConvoyJobs: 0
StatsBusDriverJobs: 0
StatsPilotJobs: 0
StatsPoliceFined: 0
StatsPoliceJailed: 0
Message: 0
Money: 0
Score: 0

pawn Код:
format(LineForFile, 100, "Message: %s\r\n", APlayerData[playerid][JoinMessage]);
fwrite(PFile, LineForFile); // And save it to the file
pawn Код:
if (strcmp(ParameterName, "Message:", false) == 0) // If the parametername is correct ("JoinMessage")
                APlayerData[playerid][JoinMessage] = strval(ParameterValue); // Store the JoinMessage
This don't show when the player set their message
pawn Код:
COMMAND:setmessage(playerid, params[])
{
    new string[128], pName[MAX_PLAYER_NAME];
    if(sscanf(params, "s[128]", APlayerData[playerid][JoinMessage])) return SendClientMessage(playerid, -1, "Usage: /setmessage [message]");
    GetPlayerName(playerid, pName, sizeof(pName));
    new file[100], File:PFile, LineForFile[100];
    if (fexist(file))
    {
                    PFile = fopen(file, io_append);
                    format(LineForFile, 100, "Message: %s\r\n", APlayerData[playerid][JoinMessage]);
                    fwrite(PFile, LineForFile);
                    fclose(PFile);
                    format(string, sizeof(string), "You have set your welcome message to: %s", APlayerData[playerid][JoinMessage]);
                    SendClientMessage(playerid, -1, string);
    }
    return 1;
}
You loaded the string as an integer, which gets converted to 0.
You need this when loading:
pawn Код:
if (strcmp(ParameterName, "Message:", false) == 0) // If the parametername is correct ("JoinMessage")
                format(APlayerData[playerid][JoinMessage], 128, ParameterValue); // Store the JoinMessage
Reply


Messages In This Thread
Message not showing, how i make it show? - by DerickClark - 26.01.2014, 19:18
Re: Its not doing nothing - by Weponz - 26.01.2014, 21:05
Re: Its not doing nothing - by DerickClark - 26.01.2014, 21:15
Re: Its not doing nothing - by Misiur - 26.01.2014, 21:31
Re: Its not doing nothing - by DerickClark - 26.01.2014, 21:43
Re: Its not doing nothing - by Misiur - 26.01.2014, 21:53
Re: Its not doing nothing - by DerickClark - 26.01.2014, 21:58
Re: Its not doing nothing - by DerickClark - 26.01.2014, 22:20
Re: Its not doing nothing - by PowerPC603 - 26.01.2014, 22:49
Re: Its not doing nothing - by Shetch - 26.01.2014, 23:30

Forum Jump:


Users browsing this thread: 1 Guest(s)