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