Text does not send message - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Text does not send message (
/showthread.php?tid=162210)
Text does not send message -
Яσскѕтая - 22.07.2010
I tried to make a few 'group' chats and only sometimes does it work
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;
}
}
Neither of them work, only sometimes.
Re: Text does not send message -
DJDhan - 22.07.2010
What do you mean by "doesn't work"? Does it send the chat even if he is muted?
Re: Text does not send message -
Last_Stand_Guardian - 22.07.2010
You're saying that they work sometimes.
Is this sometimes, often or not? :O
Because this text[1] is a little bit strange in the strings xD ^^
text[1] is just one letter I thought? :O
Re: Text does not send message -
Яσскѕтая - 22.07.2010
It is it detects if the first letter is # or @ or $ or ! and then cancels it and sends the message.
and what I mean by it doesnt work is that it like sometimes it willsend in regular chat "#ohai" but "[The Chat][Name]: ohai" not in what i want..