public OnPlayerPrivmsg(playerid, recieverid, text[])
{
static lastmsg[MAX_PLAYERS][128];
if(strfind(lastmsg[playerid], text, false) != -1)
{
SendClientMessage(playerid, 0xFF0000FF, "Stop repeat your messages!");
Kick(playerid);
return 0;
}
strmid(lastmsg[playerid],text,0,strlen(text),sizeof(lastmsg[]));
return 1;
}
|
Originally Posted by shark
Hey Guyz, wazup?
So, I wanna know if I can do cmd to turn on/off a public statement? Here is my public: Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
static lastmsg[MAX_PLAYERS][128];
if(strfind(lastmsg[playerid], text, false) != -1)
{
SendClientMessage(playerid, 0xFF0000FF, "Stop repeat your messages!");
Kick(playerid);
return 0;
}
strmid(lastmsg[playerid],text,0,strlen(text),sizeof(lastmsg[]));
return 1;
}
|
new PublicPrivMsgOn = 1;
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
if(PublicPrivMsgOn == 1)
{
static lastmsg[MAX_PLAYERS][128];
if(strfind(lastmsg[playerid], text, false) != -1)
{
SendClientMessage(playerid, 0xFF0000FF, "Stop repeat your messages!");
Kick(playerid);
return 0;
}
strmid(lastmsg[playerid],text,0,strlen(text),sizeof(lastmsg[]));
}
return 1;
}