04.12.2014, 18:36
Hello, i've got a mute command what mutes in minutes, but it doesn't save so when a player logs off when muted it unmutes them, could you please help me out with saving the mute so when the player comes back on.
and I was woundering now that i have a mute command that save mutes in minutes, how would i use the founction from the mute code to make a kick command that kicks by minutes and makes them stay kicked?
if you're able to help me that would be great! thank you!
pawn Код:
ACMD:mute(playerid, params[])
{
if (pInfo[playerid][Adminlevel] < 1) return 0;
new giveplayerid, reason[128], string[120], minutes, pname1[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
if(sscanf(params, "uds[50]", giveplayerid, minutes, reason)) return SCM(playerid, orange, "--- /mute <ID> <Minutes> <Reason> ---");
if(ID == IPI)return SCM(playerid, red, "Player is not connected!");
GetPlayerName(playerid, pname1, sizeof(pname1));
GetPlayerName(giveplayerid, pname2, sizeof(pname2));
format(string, sizeof(string), "%s %s has muted %s for %d minutes: %s", AdminLevelName(playerid), pname1, pname2 , minutes, reason);
SCMToAll(red, string);
new calc = minutes*60;
Mute[giveplayerid] = calc;
return 1;
}
pawn Код:
ACMD:kick(playerid, params[])
{
new reason[128], string[120], pname1[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME], giveplayerid;
if(sscanf(params, "uds[50]", reason, giveplayerid)) return SCM(playerid, orange, "--- /kick <ID> <Reason> ---");
if(ID == IPI)return SCM(playerid, red, "Player is not connected!");
GetPlayerName(playerid, pname1, sizeof(pname1));
GetPlayerName(giveplayerid, pname2, sizeof(pname2));
format(string, sizeof(string), "%s %s has kicked %s for %s", AdminLevelName(playerid), pname1, pname2, reason);
SCMToAll(red, string);
SetTimerEx("KickTimer", 1000, false, "d", playerid);
return 1;
}