SA-MP Forums Archive
Help system - 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)
+--- Thread: Help system (/showthread.php?tid=630875)



Help system - JhefTFJ - 19.03.2017

Hi friends, I created a simple anti-spam system, is giving the following error but I do not know why!, Could anyone help me?

PHP код:
for(new dstextdstext <sizeof Protectdstext++)
{
if(
strfind(textProtect[dstext], true) != -1)
{
new 
pname[MAX_PLAYER_NAME]; GetPlayerName(playeridpnamesizeof(pname));
format(strsizeof(str), "%s was kicked, | reason: spam!",pname);
SendClientMessageToAll(COR_BRANCOstr);
new 
SalvarDV[100];
format(strsizeof(str), "%s Disclosed, | IP: %s",pnametext);
Log("Disclosed.ini"SalvarDV);
Kick(playerid);
return 
0;
}

Код:
C:\Users\Windows\Desktop\Bz RoleP\gamemodes\bz.pwn(2945) : error 017: undefined symbol "Protect"
C:\Users\Windows\Desktop\Bz RoleP\gamemodes\bz.pwn(2947) : error 017: undefined symbol "Protect"
C:\Users\Windows\Desktop\Bz RoleP\gamemodes\bz.pwn(2947) : warning 215: expression has no effect
C:\Users\Windows\Desktop\Bz RoleP\gamemodes\bz.pwn(2947) : error 001: expected token: ";", but found "]"
C:\Users\Windows\Desktop\Bz RoleP\gamemodes\bz.pwn(2947) : error 029: invalid expression, assumed zero
C:\Users\Windows\Desktop\Bz RoleP\gamemodes\bz.pwn(2947) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.



Re: Help system - Kraeror - 19.03.2017

try this:
for(new dstext; dstext <sizeof dstext; dstext++)
{
if(strfind(text, dstext[dstext], true) != -1)
{
new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname));
format(str, sizeof(str), "%s was kicked, | reason: spam!",pname);
SendClientMessageToAll(COR_BRANCO, str);

new SalvarDV[100];
format(str, sizeof(str), "%s Disclosed, | IP: %s",pname, text);
Log("Disclosed.ini", SalvarDV);
Kick(playerid);
return 0;
}
}


Re: Help system - TitanX - 19.03.2017

no just dont try this^


Re: Help system - Kraeror - 19.03.2017

I hope this works:

Quote:

public OnPlayerText(playerid, text[])
{
new TCount, string[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
TCount = GetPVarInt(playerid, "TextSpam");
TCount++;
SetPVarInt(playerid, "TextSpam", TCount);
if(TCount == 2)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Warning: Please stop spamming or you will be kicked from the server!");
}
if(TCount == 3)
{
format(string, sizeof(string), "[Anti Spam]: %s was kicked by the server.", name);
SendClientMessageToAll(0xD50000FF, string);
Kick(playerid);
TCount = 0;
return 0;
}
SetTimerEx("ResetText", 3000, false, "i", playerid);
return 0;
}
forward ResetText(playerid);
public ResetText(playerid)
{
SetPVarInt(playerid, "TextSpam", 0);
}




Re: Help system - J0sh... - 19.03.2017

The compiler does not know what 'Protect' is.