SA-MP Forums Archive
Anti Adverting - 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: Anti Adverting (/showthread.php?tid=179999)



Anti Adverting - Pixeli - 29.09.2010

Anyone can fix that:

pawn Код:
new ip[4];
     new cmd[256];
    if(ipmatch(text, ip))
    {
      SendClientMessage(playerid, COLOR_RED, "You can't advertisement your server.");
      return 0;

Error and Warnings:

D:\Lataukset\mrp(2).pwn(36180) : warning 217: loose indentation
D:\Lataukset\mrp(2).pwn(36182) : warning 217: loose indentation
D:\Lataukset\mrp(2).pwn(36182) : error 047: array sizes do not match, or destination array is too small
D:\Lataukset\mrp(2).pwn(36181) : warning 204: symbol is assigned a value that is never used: "cmd"


Re: Anti Adverting - CJ101 - 29.09.2010

set the length of ip[] to 16.


Re: Anti Adverting - TheHoodRat - 29.09.2010

Try this.

pawn Код:
#pragma tabsize 0
     new ip[20];
     //new cmd[256]; // You never assigned this value, so it must be commented.
    if(ipmatch(text, ip))
    {
      SendClientMessage(playerid, COLOR_RED, "You can't advertisement your server.");
      return 0;
Код:
This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.



Re: Anti Adverting - Pixeli - 29.09.2010

Quote:
Originally Posted by TheHoodRat
Посмотреть сообщение
Try this.

pawn Код:
#pragma tabsize 0
     new ip[20];
     //new cmd[256]; // You never assigned this value, so it must be commented.
    if(ipmatch(text, ip))
    {
      SendClientMessage(playerid, COLOR_RED, "You can't advertisement your server.");
      return 0;
[code]This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.[/code
Now i have only 1 error:

D:\Lataukset\mrp(2).pwn(36183) : error 047: array sizes do not match, or destination array is too small


Re: Anti Adverting - TheHoodRat - 29.09.2010

[QUOTE=Pixeli;855684]Now i have only 1 error:

D:\Lataukset\mrp(2).pwn(36183) : error 047: array sizes do not match, or destination array is too small

pawn Код:
#pragma tabsize 0
     new ip[64];
     //new cmd[256]; // You never assigned this value, so it must be commented.
    if(ipmatch(text, ip))
    {
      SendClientMessage(playerid, COLOR_RED, "You can't advertisement your server.");
      return 0;
Try that. If it still does not work, change new ip[64]; to a number between 64 to 128.
Oh and here's a tip; 256 uses too much memory. I recommend 128 or 192.


Re: Anti Adverting - Pixeli - 29.09.2010

new ip[64] and new ip[128] [192] not work. same error

pawn Код:
public OnPlayerText(playerid, text[])
{
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new string[128];
    new tmp[128];
    if(PlayerInfo[playerid][pHospital] == 1 || CanTalk[playerid] == 0)
    {
        return 0;
    }
#pragma tabsize 0
     new ip[192];
     //new cmd[256]; // You never assigned this value, so it must be commented.
    if(ipmatch(text, ip))
    {
      SendClientMessage(playerid, COLOR_RED, "You can't advertisement your server.");
      return 0;

D:\Lataukset\mrp(2).pwn(36183) : error 047: array sizes do not match, or destination array is too small


Re: Anti Adverting - rbN. - 29.09.2010

^ which line is 36183 ?


Re: Anti Adverting - TheHoodRat - 29.09.2010

pawn Код:
public OnPlayerText(playerid, text[])
{
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new string[128];
    new tmp[128];
    new ip[256]
    new cmd[256];
    if(PlayerInfo[playerid][pHospital] == 1 || CanTalk[playerid] == 0)
    {
        return 0;
    }
#pragma tabsize 0
    if(ipmatch(text, ip))
    {
      SendClientMessage(playerid, COLOR_RED, "You can't advertisement your server.");
      format(string, sizeof(string)," ",cmd);
      SendFamilyMessage(10, COLOR_YELLOW, string);
      return 0;
Hey I know that script... It's from a popular gamemode that I also have in my collection.
Anyways, if 192 doesn't work, use 256 cells. It doesn't matter if it takes too much memory because it's to fix a damn error.
Try it now. The reason why the last 2 lines are there is because it's to use cmd so you don't get the error.


Re: Anti Adverting - royal_king - 29.09.2010

See this post mate this will help you a lot i think

http://forum.sa-mp.com/showthread.ph...716#post855716


Re: Anti Adverting - TheHoodRat - 29.09.2010

Quote:
Originally Posted by royal_king[xXx]
Посмотреть сообщение
See this post mate this will help you a lot i think

http://forum.sa-mp.com/showthread.ph...716#post855716
You don't need to advertise your filterscript because I've probably fixed it by now.