23.06.2010, 00:01
Alright I completed the code, but for some reason, I can spam the same thing without getting any mesage.
pawn Код:
dcmd_o(playerid,params[])
{
new string[128], spam[128];
if(!strlen(params)) return SendClientMessage(playerid, color_white,"[Info] Usage: /o [message]");
if(gPlayerMuted[playerid] == 0) {
if(TogOOC == 1) {
if(GetPVarInt(playerid,"OCCTick")< GetTickCount() + 3000)
{
GetPVarString(playerid,"params", spam, sizeof(spam));
if(!strcmp(params, spam, false, strlen(params)))
{
SetPVarString(playerid,"params", params);
SetPVarInt(playerid,"OCCTick", GetTickCount());
format(string,sizeof(string),"(( OOC: [ID:%d] %s: %s ))", playerid ,GetPlayerNameEx(playerid),params);
SendGlobalMessage(color_ooc, string);
printf("[%d]%s: %s ",playerid ,GetPlayerNameEx(playerid), params);
return 1;
}
else
{
SendClientMessage(playerid, color_red, "[Error] Please refrain from saying the same thing twice.");
return 1;
}
}
else
{
SendFormattedMessage(playerid, color_red, "[Error] You must wait %d seconds before talking again!", GetTickCount() / 100);
return 1;
}
}
else
{
SendClientMessage(playerid, color_red, "[Error] The Global OOC chat is currently disabled!");
return 1;
}
}
else
{
SendClientMessage(playerid, color_red, "[Error] You cannot use the Global OOC chat while muted");
return 1;
}
}