pawn Код:
COMMAND:mute(playerid,params[]) {
new
id,
name1[30],
name2[30],
time,
timef,
reason[50],
text[128];
if(sscanf(params,"uis",id,time,reason))
return SendClientMessage(playerid,rot,"USAGE: /mute [id] [time (in mins)] [reason]");
if(PlayerInfo[playerid][pAdminLevel] >= 2) {
if(IsPlayerConnected(id)) {
if(PlayerInfo[id][pAdminLevel] <= PlayerInfo[playerid][pAdminLevel]) {
if(PlayerInfo[playerid][pMuted] == 0) {
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(id,name2,sizeof(name2));
format(text,sizeof(text),"Administrator \"%s\" has muted \"%s\" for %i minute(s). (Reason: %s)",name1,name2,time,reason);
SendClientMessageToAll(red,text);
timef = time * 60000;
PlayerInfo[id][pMuted] = 1;
new command[30];
format(command,sizeof(command),"unmute(%i)",id);
SetTimerEx("unmute",timef,false,"i",id);
SaveIn("mutes",text);
} else {
return SendClientMessage(playerid,red,"Player is muted already.");
}
} else {
return SendClientMessage(playerid,red,"You can't mute a higher level admin!");
}
} else {
return SendClientMessage(playerid,red,"Invalid ID");
}
} else {
return SendClientMessage(playerid,red,"Only lvl2 admins can use this command!");
}
return 1;
}
COMMAND:unmute(playerid,params[]) {
new
id,
name1[30],
name2[30],
text[128];
if(sscanf(params,"u",id))
return SendClientMessage(playerid,rot,"USAGE: /unmute [id]");
if(PlayerInfo[playerid][pAdminLevel] >= 2) (
if(IsPlayerConnected(id)) {
if(PlayerInfo[id][pAdminLevel] <= PlayerInfo[playerid][pAdminLevel]) {
if(PlayerInfo[playerid][pMuted] == 1) {
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(id,name2,sizeof(name2));
format(text,sizeof(text),"Administrator \"%s\" has unmuted \"%s\".",name1,name2);
SendClientMessageToAll(red,text);
PlayerInfo[id][pMuted] = 0;
SaveIn("unmutes",text);
} else {
return SendClientMessage(playerid,red,"Player is unmuted already.");
}
} else {
return SendClientMessage(playerid,red,"You can't unmute a higher level admin!");
}
} else {
return SendClientMessage(playerid,red,"Invalid ID");
}
} else {
return SendClientMessage(playerid,red,"Only lvl2 admins can use this command!");
}
return 1;
}
//unmute timer:
forward unmute(id);
public unmute(id) {
PlayerInfo[id][pMuted] = 0;
SendClientMessage(id,COLOR_GREEN,"Your mute time is over. You can talk again :]");
}
//OnlyPlayerText:
public OnPlayerText(playerid, text[])
{
new
mess[128],
name[30];
if(PlayerInfo[playerid][pMuted] == 1) {
if(PlayerInfo[playerid][pWarns] == 3) {
SendClientMessage(playerid,red,"You've been kicked for being warned 3 times.");
GetPlayerName(playerid,name,sizeof(name));
format(mess,sizeof(mess),"%s has been kicked for exceeding mute warnings. (3)");
SendClientMessageToAll(red,mess);
Kick(playerid);
return 0;
} else {
format(mess,sizeof(mess),"You are muted. You will get a message when your muted time is over. Warning(s): %i",PlayerInfo[playerid][pWarns]);
SendClientMessage(playerid,red,mess);
PlayerInfo[playerid][pWarns]++;
return 0;
}
}
return 1;
}
That's your problem, you'll need an enum with all your player statistics in (admin level, money, skin etc.)