Pawn crashes.
#1

I think it's because of that? O.o

PHP код:
public OnPlayerText(playeridtext[])
{
  new 
noinsult;
  for(new 
0sizeof ForbiddenWordsi++)
  {
    
noinsult strfind(textForbiddenWords[i], true);
    if(
noinsult != -1)
    {
      for(new 
noinsultnoinsult strlen(ForbiddenWords[i]); ++)
      {
        
text[x] = '*';
      }
    }
  }
  new 
ad[15],Index;while(Index strlen(text))
  {
     
ad strtok(text,Index);
     if(
CheckAdv(ad)==1)
     {
       new 
i=strfind(text,ad),j-i+strlen(word)-1text[i++]='[';
       while(
j<j) {text[i]='•';i++}
       
text[j]=']';
       
SetPlayerPos(playerid238.0698,1858.0798,17.8835);
       {
            new 
name[MAX_PLAYER_NAME], str[128];
            
GetPlayerName(playeridname,sizeof(name));
            
CreateObject(971217.262761875.0704312.13465,   0.000000.000000.00000);
            
CreateObject(971208.442751875.1267112.13465,   0.000000.000000.00000);
            
CreateObject(971226.994351858.8521712.13260,   0.000000.00000, -91.00000);
            
CreateObject(971242.755711861.2587915.96940,   0.000000.00000, -55.00000);
            
CreateObject(3524230.576231857.4827913.68170,   0.000000.00000, -286.00000);
            
CreateObject(3524230.759981858.8531513.68170,   0.000000.00000, -286.00000);
            
CreateObject(3092230.977461858.2517114.77976,   0.000000.00000, -120.00000);
            
CreateObject(2908230.988771857.3963615.71300,   -69.4400011.00000156.00000);
            
CreateObject(2908231.161851858.7099615.71300,   -69.4400011.00000156.00000);
            
CreateObject(3092243.304401861.3258117.52950,   0.000000.00000, -258.00000);
            
SendClientMessage(playerid, -1"{FF0000}You have been jailed by the anti cheat - Reason: Adv");
            
format(str,sizeof(str), "{FF0000}[ANTI-CHEAT]: %s Has been jailed by the anti cheat - Reason: Adv.");
            
SendClientMessageToAll(-1,str);
            
SetTimerEx("JailTimer"440000false);
//------------------------------------That's ^^^ not below.
  
SpamTimer[playerid] = SetTimerEx("DecreaseSpam",MAX_DECREASECOUNT*1000,1,"",playerid);
  if(
PlayerSpam[playerid] < MAX_SPAM)
  {
     
PlayerSpam[playerid] ++;
  }
  else if(
PlayerSpam[playerid] >= MAX_SPAM)
  {
    new 
TalkS[120],string[120], name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridname,sizeof(name));
    
format(string,sizeof(string), "{FF0000}[ANTI-CHEAT]: %s(ID: %d) has been kicked from the server - Reason: Spam",nameplayerid);
    
SendClientMessageToAll(-1,string);
    
format(TalkS,sizeof(TalkS), "{FF0000}You have been kicked for spamming.");
    
ShowPlayerDialog(playeridDIALOG_ANTIDIALOG_STYLE_MSGBOX,"{FF0000}ANTI CHEAT",TalkS,"OK","");
    
PlayerSpam[playerid] = 0;
    
KillTimer(SpamTimer[playerid]);
    
SetTimerEx("SpamTimerKick"1000false"i"playerid);
  }
  return 
1;

And this
PHP код:
stock strtok(const string[], &index,seperator=' ')
{
        new 
length strlen(string);
        new 
offset index;
        new 
result[128];
        while ((
index length) && (string[index] != seperator) && ((index offset) < (sizeof(result) - 1)))
        {
                
result[index offset] = string[index];
                
index++;
        }
        
result[index offset] = EOS;
        if ((
index length) && (string[index] == seperator))
        {
                
index++;
        }
        return 
result;
}
IsNumeric(const string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;
}

And that

Код:
forward JailTimer(playerid);
public JailTimer(playerid)
{
   GetPlayerPos(playerid, gPos[0],gPos[1],gPos[2],gPos[3]);
   SetPlayerPos(playerid, gPos[0],gPos[1],gPos[2],gPos[3]);
   SetPlayerHealth(playerid, 2);
   SendClientMessage(playerid, -1, "{FF0000}[ANTI-CHEAT]: Nope, Your punishment is still not over - The anti cheat has setted your HP to %2 - Survive with that and next time don't do it");
return 1;
}
Reply
#2

bump
Reply
#3

You have one bracket to much in your script.
Change:
pawn Код:
IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
}
To:
pawn Код:
IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
Reply
#4

Same, Still crashes.
Reply
#5

Quote:
Originally Posted by Stuun23
Посмотреть сообщение
Same, Still crashes.
Change the OnPlayerText to:
Код:
public OnPlayerText(playerid, text[]) 
{ 

  new noinsult; 
  for(new i = 0; i < sizeof ForbiddenWords; i++) 
  { 
    noinsult = strfind(text, ForbiddenWords[i], true); 
    if(noinsult != -1) 
    { 
      for(new x = noinsult; x < noinsult + strlen(ForbiddenWords[i]); x ++) 
      { 
        text[x] = '*'; 
      } 
    } 
  } 
  new ad[15],Index;
  while(Index < strlen(text)) 
  { 
     ad = strtok(text,Index); 
     if(CheckAdv(ad)==1) 
     { 
       new i=strfind(text,ad),j-i+strlen(word)-1; text[i++]='['; 
       while(j<j) {text[i]='•';i++} 
       text[j]=']'; 
       SetPlayerPos(playerid, 238.0698,1858.0798,17.8835);  
       new name[MAX_PLAYER_NAME], str[128]; 
       GetPlayerName(playerid, name,sizeof(name)); 
       CreateObject(971, 217.26276, 1875.07043, 12.13465,   0.00000, 0.00000, 0.00000); 
       CreateObject(971, 208.44275, 1875.12671, 12.13465,   0.00000, 0.00000, 0.00000); 
       CreateObject(971, 226.99435, 1858.85217, 12.13260,   0.00000, 0.00000, -91.00000); 
       CreateObject(971, 242.75571, 1861.25879, 15.96940,   0.00000, 0.00000, -55.00000); 
       CreateObject(3524, 230.57623, 1857.48279, 13.68170,   0.00000, 0.00000, -286.00000); 
       CreateObject(3524, 230.75998, 1858.85315, 13.68170,   0.00000, 0.00000, -286.00000); 
       CreateObject(3092, 230.97746, 1858.25171, 14.77976,   0.00000, 0.00000, -120.00000); 
       CreateObject(2908, 230.98877, 1857.39636, 15.71300,   -69.44000, 11.00000, 156.00000); 
       CreateObject(2908, 231.16185, 1858.70996, 15.71300,   -69.44000, 11.00000, 156.00000); 
       CreateObject(3092, 243.30440, 1861.32581, 17.52950,   0.00000, 0.00000, -258.00000); 
       SendClientMessage(playerid, -1, "{FF0000}You have been jailed by the anti cheat - Reason: Adv"); 
       format(str,sizeof(str), "{FF0000}[ANTI-CHEAT]: %s Has been jailed by the anti cheat - Reason: Adv."); 
       SendClientMessageToAll(-1,str); 
       SetTimerEx("JailTimer", 440000, false); 
    }
//------------------------------------That's ^^^ not below. 
  }
  SpamTimer[playerid] = SetTimerEx("DecreaseSpam",MAX_DECREASECOUNT*1000,1,"",playerid); 
  if(PlayerSpam[playerid] < MAX_SPAM) 
  { 
     PlayerSpam[playerid] ++; 
  } 
  else if(PlayerSpam[playerid] >= MAX_SPAM) 
  { 
    new TalkS[120],string[120], name[MAX_PLAYER_NAME]; 
    GetPlayerName(playerid, name,sizeof(name)); 
    format(string,sizeof(string), "{FF0000}[ANTI-CHEAT]: %s(ID: %d) has been kicked from the server - Reason: Spam",name, playerid); 
    SendClientMessageToAll(-1,string); 
    format(TalkS,sizeof(TalkS), "{FF0000}You have been kicked for spamming."); 
    ShowPlayerDialog(playerid, DIALOG_ANTI, DIALOG_STYLE_MSGBOX,"{FF0000}ANTI CHEAT",TalkS,"OK",""); 

    PlayerSpam[playerid] = 0; 
    KillTimer(SpamTimer[playerid]); 
    SetTimerEx("SpamTimerKick", 1000, false, "i", playerid); 
  } 
  return 1; 
}
If errors showing up tell me.
Reply
#6

Ah i found why it crashed. lol i had that

PHP код:
new word[150],Index;while(Index strlen(text)) {
        
word strtok(text,Index);
        if(
CheckAdv(word)==1){//If there is a word of the words in the CheckAdv stock!
            //If the player text contained . and numbers!
            
new i=strfind(text,word),j=i+strlen(word)-1text[i++]='[';
            while(
i<j) {text[i]='•';i++;}
            
text[j]=']';
            
Kick(playerid);//This one will kick the player for sure!
            
new string2[128];//WE MAKE A string called string2
            //First we format it!
            
format(string2sizeof(string2), "[ANTI-CHEAT] %s has been jailed by the anti cheat - Reason: Adv",GetName(playerid),playerid);
            
SendClientMessageToAll(-1string2);
            return 
1;

Twice.

eDIT: btw

PHP код:
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(264) : error 017undefined symbol "strtok"
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(264) : error 033: array must be indexed (variable "ad")
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(265) : error 017undefined symbol "CheckAdv"
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(267) : error 001expected token";"but found "-"
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(267) : error 017undefined symbol "word"
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(267) : warning 215expression has no effect
C
:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(268) : error 001expected token";"but found "}"
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(287) : warning 202number of arguments does not match definition
C
:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(289) : warning 217loose indentation
C
:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(307) : warning 217loose indentation
C
:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(307) : error 079inconsistent return types (array & non-array)
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(309) : warning 217loose indentation
C
:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(309) : error 029invalid expressionassumed zero
C
:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(309) : error 017undefined symbol "strtok"
C:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(309) : error 029invalid expressionassumed zero
C
:\Users\yan\Desktop\Scripting tests\filterscripts\AntiCheat.pwn(309) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
11 Errors

Reply
#7

Are you sure you are not missing more missing brackets that cause this problem?
Reply
#8

Nope, No brackets missing.
Reply


Forum Jump:


Users browsing this thread: