22.07.2010, 17:00
I tried to make a few 'group' chats and only sometimes does it work
Neither of them work, only sometimes.
pawn Код:
if(text[0] == '#' && UGPlayer[playerid] == 1)
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You are muted.");
return 0;
}
else
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[UG Chat]%s: %s",string,text[1]);
SendMessageToUGMembers(COLOR_NEWB,string);
return 0;
}
}
if(text[0] == '$')
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You are muted.");
return 0;
}
if(text[1] == 'l' && text[2] == 'o' && text[3] == 'c')
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You are muted.");
return 0;
}
else
{
new name[MAX_PLAYERS];
new zone[MAX_ZONE_NAME], string[256];
GetPlayerName(playerid, name, sizeof(name));
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
format(string,sizeof(string),"%s's location is %s.", name, zone);
SendClientMessageToAll(COLOR_LOC, string);
print(string);
return 0;
}
}
if(text[1] == 'p' && text[2] == 'o' && text[3] == 's')
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You are muted.");
return 0;
}
else
{
new name[MAX_PLAYERS], string[256];
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s's position is %f, %f, %f.",name,x,y,z);
SendClientMessageToAll(COLOR_LOC,string);
return 0;
}
}
}
if(text[0] == '@' && Admin[playerid] >= 1)
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You are muted.");
return 0;
}
else
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[ADMIN]%s: %s",string,text[1]); SendMessageToAdmins(COLOR_RED,string);
return 0;
}
}
if(text[0] == '!')
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You are muted.");
return 0;
}
else
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[NEW CHAT]%s: %s",string,text[1]); SendClientMessageToAll(COLOR_NEWB,string);
return 0;
}
}