Anti Adverting
#1

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"
Reply
#2

set the length of ip[] to 16.
Reply
#3

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.
Reply
#4

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
Reply
#5

[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.
Reply
#6

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
Reply
#7

^ which line is 36183 ?
Reply
#8

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.
Reply
#9

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)