02.09.2012, 20:05
(
Последний раз редактировалось _Khaled_; 02.09.2012 в 20:58.
Причина: Fixed Q1
)
So, after I got my server online with OTHER players, I found out these errors.
First, DONE
Second, /mute, if I for example mute ID 1 or "Ejb" it shows An Administrator has muted EJB, but I'm the one muted.
Third, /whisper shows all over the map! <3
Fourth, same as mute! but for KICK!
Fifth, the auto messages are not LONG enough, example
It cuts at Fail... if the name of player is long..
That's all!
Any help? :\
First, DONE
Second, /mute, if I for example mute ID 1 or "Ejb" it shows An Administrator has muted EJB, but I'm the one muted.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(IsMuted[playerid] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "You are currently muted, you can't use the chat.");
return 0;
}
return 1;
}
//============================================================================//
dcmd_mute(playerid,params[])
{
#pragma unused params
new pname[MAX_PLAYER_NAME];
new string[128];
new cmdreason[100];
new id;
if(sscanf(params,"us[100]",id,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"Usage: /mute (Player Name/ID) (Reason)");
return 1;
}
GetPlayerName(id,pname,sizeof pname);
if(IsMuted[playerid] == 1)
{
format(string,sizeof(string),"%s(%d) is already muted by an Administrator.",pname,id);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
IsMuted[playerid] =1;
format(string,sizeof(string),"***An Administrator has muted %s(%d). (Reason: %s.)",pname,id,cmdreason);
SendClientMessageToAll(COLOR_PINK,string);
//format(string,sizeof(string),"9[ADMIN] Administrator has frozen %s(%d) for reason: %s.",PlayerName(ID),ID,cmdreason);
//IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
//============================================================================//
dcmd_unmute(playerid,params[])
{
#pragma unused params
new pname[MAX_PLAYER_NAME];
new string[128];
new id;
if(sscanf(params,"us[100]",id))
{
SendClientMessage(playerid,COLOR_ERROR,"Usage: /unmute (Player Name/ID)");
return 1;
}
GetPlayerName(id,pname,sizeof pname);
if(IsMuted[playerid] == 0)
{
format(string,sizeof(string),"%s(%d) is already un-muted by an Administrator.",pname,id);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
IsMuted[playerid] =0;
format(string,sizeof(string),"***An Administrator has un-muted %s(%d)",pname,id);
SendClientMessageToAll(COLOR_PINK,string);
//format(string,sizeof(string),"9[ADMIN] Administrator has un-muted %s(%d) for reason: %s.",PlayerName(ID),ID,cmdreason);
//IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
pawn Код:
//Stock GetDistanceBetweenPlayers
stock Float:GetDistanceBetweenPlayers(playerid, targetplayerid)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetplayerid)) {
return -1.00;
}
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(targetplayerid,x2,y2,z2);
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
//============================================================================//
dcmd_w(playerid,params[])
{
#pragma unused params
new string[128];
new id;
new pname[MAX_PLAYER_NAME];
if(!strlen(params))
{
SendClientMessage(playerid,COLOR_ERROR,"Usage: /w(hisper) (Message)");
return 1;
}
/*format(string, sizeof(string), "[WHISPER] %s(%d): %s",pname,playerid,params);
printf("%s", string);
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);*/
for(new i=0;i<MAX_PLAYERS;++i)
{
if(GetDistanceBetweenPlayers(playerid,i) < 10)
{
GetPlayerName(id,pname,MAX_PLAYER_NAME);
format(string, sizeof(string), "[WHISPER]: %s(%d): %s",pname,playerid,params);
SendClientMessage(i,COLOR_YELLOW,string);
}
}
return 1;
}
dcmd_whisper(playerid,params[]) return dcmd_w(playerid,params);
pawn Код:
dcmd_kick(playerid,params[])
{
#pragma unused params
new pname[MAX_PLAYER_NAME];
new string[128];
new id;
new cmdreason[100];
if(sscanf(params,"us[100]",id,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"Usage: /kick (Player Name/ID) (Reason)");
return 1;
}
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string),"***An Administrator has kicked %s(%d) from the server. (Reason: %s.)",pname,id,cmdreason);
SendClientMessageToAll(COLOR_PINK,string);
Kick(playerid);
/*format(string,sizeof(string),"9[ADMIN] Administrator has kicked %s(%d) from the server. Reason: %s.",PlayerName(ID),ID,cmdreason);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
SetTimer("KickPlayer",700,0);*/
return 1;
}
pawn Код:
if (!response)
{
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "***(Auto-Kick) %s(%d) Has been kicked from the server. (Reason: Failure to register)", pname, id, aDisconnectNames);
SendClientMessageToAll(COLOR_PINK, string);
Kick(playerid);
return 1;
}
That's all!
Any help? :\