25.06.2013, 22:53
(
Последний раз редактировалось _Khaled_; 26.06.2013 в 12:37.
)
Commands, lots of it, based on shit
for example, me and my friend Junior were in the server.
It's supposed to be Junior(1), it posted my name, with his ID.
For example, freeze.
like that, but in several other commands, help?
for example, me and my friend Junior were in the server.
Quote:
[01:40:50] [ADMIN PROMOTE] Vanter(1) has been promoted to be a Server Administrator |
pawn Код:
dcmd_makeadmin(playerid,params[])
{
new string[128];
new ID;
new tname[MAX_PLAYER_NAME];
GetPlayerName(ID,tname,sizeof(tname));
if(sscanf(params,"us[100]",ID))
{
SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /makeadmin (Player Name/ID)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"[ERROR] The player ID you entered is not connected to the server.");
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(PlayerInfo[ID][pAdmin] == 10)
{
format(string,sizeof(string),"[ERROR] %s(%d) is already a Server Administrator.",tname,ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
PlayerInfo[ID][pAdmin] =10;
format(string,sizeof(string),"[ADMIN PROMOTE] %s(%d) has been promoted to be a Server Administrator",tname,ID);
SendClientMessageToAll(COLOR_PINK,string);
SendClientMessage(ID,COLOR_PINK,"[ADMIN PROMOTE] You have been promoted to be a Server Administrator");
format(string,sizeof(string),"9[ADMIN PROMOTE] %s(%d) has been promoted to be a Server Administrator",tname,ID);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
format(string,sizeof(string),"[ADMIN PROMOTE] %s(%d) has been promoted to be a Server Administrator",tname,ID);
SendAdminMessage(COLOR_PINK,string);
IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
return 1;
}
Quote:
[01:48:00] [ADMIN FREEZE] Administrator has frozen Vanter(1). [Reason: test] [01:48:00] [ADMIN RADIO] Administrator Vanter(0) has frozen Vanter(1). [Reason: test] [01:48:00] <Junior> a !!! [01:48:06] <Junior> ok [01:48:14] [ADMIN UNFREEZE] Administrator has unfrozen Vanter(1). [01:48:14] [ADMIN RADIO] Administrator Vanter(0) has unfrozen Vanter(1). |
pawn Код:
dcmd_freeze(playerid,params[])
{
new string[128];
new ID;
new cmdreason[100];
new pname[MAX_PLAYER_NAME];
new tname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(ID,tname,sizeof(tname));
if(sscanf(params,"us[100]",ID,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /freeze (Player Name/ID) (Reason)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"[ERROR] The player ID you entered is not connected to the server.");
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(IsSpawned[ID] == 0)
{
format(string,sizeof(string),"[ERROR] %s(%d) is not spawned in order to freeze them.",tname,ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(IsFrozen[ID] == 1)
{
format(string,sizeof(string),"[ERROR] %s(%d) is already frozen by a Server Administrator.",tname,ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
IsFrozen[ID] =1;
TogglePlayerControllable(ID,0);
format(string,sizeof(string),"[ADMIN FREEZE] Administrator has frozen %s(%d). [Reason: %s]",tname,ID,cmdreason);
SendClientMessageToAll(COLOR_PINK,string);
format(string,sizeof(string),"9[ADMIN FREEZE] Administrator has frozen %s(%d). [Reason: %s]",tname,ID,cmdreason);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
format(string,sizeof(string),"[ADMIN RADIO] Administrator %s(%d) has frozen %s(%d). [Reason: %s]",pname,playerid,tname,ID,cmdreason);
SendAdminMessage(COLOR_PINK,string);
IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
return 1;
}
dcmd_unfreeze(playerid,params[])
{
new string[128];
new ID;
new pname[MAX_PLAYER_NAME];
new tname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(ID,tname,sizeof(tname));
if(sscanf(params,"uS[100]",ID))
{
SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /unfreeze (Player Name/ID)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"[ERROR] The player ID you entered is not connected to the server.");
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(IsFrozen[ID] == 0)
{
format(string,sizeof(string),"[ERROR] %s(%d) is not frozen by a Server Administrator.",tname,ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
IsFrozen[ID] =0;
TogglePlayerControllable(ID,1);
format(string,sizeof(string),"[ADMIN UNFREEZE] Administrator has unfrozen %s(%d).",tname,ID);
SendClientMessageToAll(COLOR_PINK,string);
format(string,sizeof(string),"9[ADMIN UNFREEZE] Administrator has unfrozen %s(%d).",tname,ID);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
format(string,sizeof(string),"[ADMIN RADIO] Administrator %s(%d) has unfrozen %s(%d).",pname,playerid,tname,ID);
SendAdminMessage(COLOR_PINK,string);
IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
return 1;
}