09.11.2011, 14:36
Hi,
I want To Make Some Of Those Commands Be Evade
For Example:Some One Muted And IF He Relog He Stay Muted
Mute
Freeze
Jail
I want To Make Some Of Those Commands Be Evade
For Example:Some One Muted And IF He Relog He Stay Muted
Mute
pawn Код:
dcmd_mute(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 2)
{
new tmp[256];
new tmp2[256];
new Index;
tmp = strtok(params,Index);
tmp2 = strtok(params,Index);
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /mute [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "Function: Will mute the specified player");
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
new player1, string[128];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]) )
{
if(AccInfo[player1][Muted] == 0)
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
SendCommandToAdmins(playerid,"Mute");
PlayerPlaySound(player1,1057,0.0,0.0,0.0);
AccInfo[player1][Muted] = 1;
AccInfo[player1][MuteWarnings] = 0;
if(strlen(tmp2))
{
format(string,sizeof(string),"|- You have been Muted by Administrator %s | Reason: %s -|",adminname,params[2]);
SendClientMessage(player1,blue,string);
format(string,sizeof(string),"|- You have Muted %s | Reason: %s -|", playername,params[2]);
return SendClientMessage(playerid,BlueMsg,string);
}
else
{
format(string,sizeof(string),"|- You have been muted by Administrator %s | No Specified Reason! -|",adminname);
SendClientMessage(player1,blue,string);
format(string,sizeof(string),"|- You have Muted %s -|", playername);
return SendClientMessage(playerid,BlueMsg,string);
}
}
else return SendClientMessage(playerid, red, "ERROR: Player is already muted");
}
else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
pawn Код:
dcmd_freeze(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 3)
{
new tmp[256],tmp2[256],tmp3[256],Index;
tmp = strtok(params,Index);
tmp2 = strtok(params,Index);
tmp3 = strtok(params,Index);
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /freeze [PlayerID]") &&
SendClientMessage(playerid, orange, "Function: Will Freeze the specified player");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname[MAX_PLAYER_NAME];
player1 = ReturnUser(tmp, playerid);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
if(AccInfo[player1][Frozen] == 0)
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new ftime = strval(tmp2);
if(ftime == 0) ftime = 9999;
SendCommandToAdmins(playerid,"Freeze");
TogglePlayerControllable(player1,false); AccInfo[player1][Frozen] = 1;
PlayerPlaySound(player1,1057,0.0,0.0,0.0);
AccInfo[player1][FreezeTime] = ftime*1000*60;
FreezeTimer[player1] = SetTimerEx("UnFreezeMe",AccInfo[player1][FreezeTime],0,"d",player1);
if(ftime == 9999)
{
if(!strlen(params[strlen(tmp2)+1]))
format(string,sizeof(string),"|- Administrator %s has Frozen %s -|",adminname,playername);
else format(string,sizeof(string),"|- Administrator %s has Frozen %s | Reason: %s -|",adminname,playername,params[strlen(tmp)+1]);
}
else
{
if(!strlen(tmp3)) format(string,sizeof(string),"|- Administrator %s has Frozen %s for %d Minutes",adminname,playername,ftime);
else format(string,sizeof(string),"|- Administrator %s has Frozen %s for %d Minutes | Reason: %s",adminname,playername,ftime,params[strlen(tmp2)+strlen(tmp)+1]);
}
return SendClientMessageToAll(blue,string);
}
else return SendClientMessage(playerid, red, "ERROR: Player is already Frozen");
}
else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
pawn Код:
dcmd_jail(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 3)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /jail [PlayerID] [Minutes] [Reason]") &&
SendClientMessage(playerid, orange, "Function: Will Jailed the specified player");
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
if(AccInfo[player1][Jailed] == 0)
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new jtime = strval(tmp2);
if(jtime == 0) jtime = 9999;
SendCommandToAdmins(playerid,"Jail");
AccInfo[player1][JailTime] = jtime*1000*60;
SetTimerEx("JailPlayer",5000,0,"d",player1);
SetTimerEx("Jail1",1000,0,"d",player1);
AccInfo[player1][Jailed] = 1;
if(jtime == 9999)
{
if(!strlen(params[strlen(tmp2)+1])) format(string,sizeof(string),"|- Administrator %s has Jailed %s -|",adminname,playername);
else format(string,sizeof(string),"|- Administrator %s has Jailed %s | Reason: %s -|",adminname,playername,params[strlen(tmp)+1]);
}
else
{
if(!strlen(tmp3)) format(string,sizeof(string),"|- Administrator %s has Jailed %s for %d Minutes -|",adminname,playername, jtime);
else format(string,sizeof(string),"|- Administrator %s has Jailed %s for %d Minutes | Reason: %s -|",adminname,playername,jtime,params[strlen(tmp2)+strlen(tmp)+1]);
}
return SendClientMessageToAll(blue,string);
}
else return SendClientMessage(playerid, red, "ERROR: Player is already in jail");
}
else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}