10.06.2015, 18:55
(
Последний раз редактировалось dugi; 11.06.2015 в 13:44.
)
Greetings,
I have made a "Moderator" Staff position but i'm having an issue, I'm able to issue it and when you relog its still there aswell but when i restart the server it gets removed
i have done the following
Defined
Making Moderator
OnPlayerRegister [File]
What is the problem, and if there is a link for a tutorials of how to make as staff position or a group please link me
I have made a "Moderator" Staff position but i'm having an issue, I'm able to issue it and when you relog its still there aswell but when i restart the server it gets removed
i have done the following
Defined
Код HTML:
enum pInfo
{
pModerator,
};
Код HTML:
CMD:makemoderator(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 99999) {
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
return 1;
}
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makemoderator[playerid]");
if(IsPlayerConnected(giveplayerid)) {
if(PlayerInfo[giveplayerid][pModerator] != 1) {
PlayerInfo[giveplayerid][pModerator] = 1;
format(string, sizeof(string), "You have made %s a Moderator.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have been made a Moderator by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
} else {
PlayerInfo[giveplayerid][ppModerator] = 0;
format(string, sizeof(string), "You have revoked %s's Moderator", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have had your Moderator Status revoked by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
}
}
return 1;
}
Код HTML:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[32];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "users/%s.ini", playername3);
new File: hFile = fopen(string3, io_write);
if (hFile)
{
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
new var[156];
format(var, 32, "Moderator=%d\n",PlayerInfo[playerid][pModerator]);fwrite(hFile, var);
format(var, 32, "Moderator=%d\n",PlayerInfo[playerid][pModerator]);fwrite(hFile, var);
format(var, 32, "Moderator=%d\n",PlayerInfo[MAX_PLAYERS][pModerator]);fwrite(hFile, var);
What is the problem, and if there is a link for a tutorials of how to make as staff position or a group please link me

