public OnPlayerSpawn(playerid)
{
if(dini_Int(file, "Freeze") == 1)
{
SendClientMessage(playerid, COLOR_RED, "Your punishment (freeze) is not done yet, Your still freezed!");
TogglePlayerControllable(playerid, false);
return 1;
}
return 1;
}
CMD:freeze(playerid, params[])
{
new string[128],
id,
pname[MAX_PLAYER_NAME],
victimname[MAX_PLAYER_NAME],
reason[30];
if(PlayerInfo[playerid][Admin] > 3)
{
if(sscanf(params, "us[30]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /freeze <playername/id> <reason>");
if(IsPlayerNPC(id)) return SendClientMessage(playerid, COLOR_RED, "You cannot freeze NPC Bots!");
if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot freeze yourself!");
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(id, victimname, sizeof(victimname));
if(PlayerInfo[id][Freeze] == 0)
{
format(string, sizeof(string), "ADMIN-SPEC: %s has used /freeze", pname);
SentMessageToAdmins(COLOR_GREY, string);
PlayerInfo[id][Freeze] = 1;
TogglePlayerControllable(id, false);
format(string, sizeof(string), "%s(ID:%d) has been freezed Administrator %s(ID:%d) | Reason: %s", victimname, id, pname, playerid, reason);
SendClientMessageToAll(COLOR_RED, string);
format(string, sizeof(string), "| - You freeze %s(ID:%d) | Reason %s - |", victimname, id, reason);
SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "| - You have been freeze by Administrator %s(ID:%d) | Reason %s - |", pname, playerid, reason);
SendClientMessage(playerid, COLOR_RED, string);
}
else return SendClientMessage(playerid, COLOR_RED, "That player is already frozen!");
}
else return SendClientMessage(playerid, COLOR_RED, "You must be Administrator Level 3 or higher to use this command!");
return 1;
}
CMD:unfreeze(playerid, params[])
{
new string[128],
id,
pname[MAX_PLAYER_NAME],
victimname[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][Admin] > 3)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /unfreeze <playername/id>");
if(IsPlayerNPC(id)) return SendClientMessage(playerid, COLOR_RED, "You cannot unfreeze NPC Bots!");
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(id, victimname, sizeof(victimname));
if(PlayerInfo[id][Freeze] == 1)
{
format(string, sizeof(string), "ADMIN-SPEC: %s has used /unfreeze", pname);
SentMessageToAdmins(COLOR_GREY, string);
PlayerInfo[id][Freeze] = 0;
TogglePlayerControllable(id, true);
format(string, sizeof(string), "%s(ID:%d) has been unfreezed Administrator %s(ID:%d)", victimname, id, pname, playerid);
SendClientMessageToAll(COLOR_YELLOW, string);
format(string, sizeof(string), "| - You unfreeze %s(ID:%d) - |", victimname, id);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "| - You have been unfreeze by Administrator %s(ID:%d) - |", pname, playerid);
SendClientMessage(playerid, COLOR_RED, string);
}
else return SendClientMessage(playerid, COLOR_RED, "That player is already unfreeze!");
}
else return SendClientMessage(playerid, COLOR_RED, "You must be Administrator Level 3 or higher to use this command!");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[playerid] == 1)
{
dini_IntSet(file, "Score", PlayerInfo[playerid][Score]);
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
dini_IntSet(file, "Deaths", PlayerInfo[playerid][Deaths]);
dini_IntSet(file, "Kills", PlayerInfo[playerid][Kills]);
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][Admin]);
dini_IntSet(file, "Freeze", PlayerInfo[playerid][Freeze]);
}
gPlayerLogged[playerid] = 0;
GodMode[playerid] = 0; IsAdminInDuty[playerid] = 0;
return 1;
}
|
so i will remove the player-saving Freeze?, i want to resume there punishment when they go in-game again.
This forum requires that you wait 120 seconds between posts. Please try again in 5 seconds. ah this sucks! |
|
Well.. Freeze isn't really a good punishment, /ajail is better and simply if player spawn on air for some reason and it freezes, player will be frozen on the air, and this might also be taken as hacks for some admin.
Player can just spawn and fall due to PC loading lags... |
|
Actually the spawnpoint is not taken from Air. he will spawn directly from the ground. However you say
"and this might also be taken as hacks for some admin" so i'm not sure if i will continue to add Freeze Punishment. |
|
By the way, post the code that set PlayerInfo variables on login. Should be OnDialogResponse if you using dialogs registering system, and show also OnPlayerSpawn.
|