3 errors
#1

pawn Код:
// Insulting Bot

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Insulting Bot 1.0");
    print("--------------------------------------\n");
    return 1;
}


#endif


public OnPlayerText(playerid, text[])
{
    if (strfind(text, "Fuck") != -1)
    {
        new string[80], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s Please Don't Insult!", name);
        SendChat(string);
    }
    return 1;
}

public OnPlayerTeamPrivmsg(playerid, text[])
{
        new
        sSenderName[24],
        sString[128];

    GetPlayerName(playerid, sSenderName, sizeof sSenderName);
    format(sString, sizeof sString, "(Team Message) ID: %d.%s. (%s) ",playerid, senderName, text);

    for(new iPlayer = 0 ; iPlayer < MAX_PLAYERS; iPlayer++)
    {
        if(IsPlayerAdmin(iPlayer))
        {
            SendPlayerMessage(iPlayer, 0xFFFFFFAA, sString);
        }
    }

    return true;
}
Код:
C:\Users\user\Desktop\TextTT.pwn(26) : error 017: undefined symbol "SendChat"
C:\Users\user\Desktop\TextTT.pwn(31) : warning 235: public function lacks forward declaration (symbol "OnPlayerTeamPrivmsg")
C:\Users\user\Desktop\TextTT.pwn(37) : warning 217: loose indentation
C:\Users\user\Desktop\TextTT.pwn(38) : error 017: undefined symbol "senderName"
C:\Users\user\Desktop\TextTT.pwn(44) : error 017: undefined symbol "SendPlayerMessage"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#2

Hmm no reply?
Reply
#3

Код:
// Insulting Bot

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Insulting Bot 1.0");
    print("--------------------------------------\n");
    return 1;
}


#endif


public OnPlayerText(playerid, text[])
{
    if (strfind(text, "Fuck") != -1)
    {
        new string[80], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s Please Don't Insult!", name);
    }
    return 1;
}

public OnPlayerTeamPrivmsg(playerid, text[])
{
        new
        sSenderName[24],
        sString[128];

    GetPlayerName(playerid, sSenderName, sizeof (sSenderName);
    format(sString, sizeof sString, "(Team Message) ID: %d.%s. (%s) ",playerid, sSenderName, text);

    for(new iPlayer = 0 ; iPlayer < MAX_PLAYERS; iPlayer++)
    {
        if(IsPlayerAdmin(iPlayer))
        {
            SendClientMessage(iPlayer, 0xFFFFFFAA, sString);
        }
    }

    return true;
}
Try this


**EDIT: Fixed something
Reply
#4

SendChat is an NPC function, you haven't even included a_npc, hence why you're getting the error for it not being a valid function.

See here for more information on how NPCs work.
Reply
#5

pawn Код:
// Insulting Bot

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Insulting Bot 1.0");
    print("--------------------------------------\n");
    return 1;
}


#endif


public OnPlayerText(playerid, text[])
{
    if (strfind(text, "Fuck") != -1)
    {
        new string[80], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s Please Don't Insult!", name);
    }
    return 1;
}

public OnPlayerTeamPrivmsg(playerid, text[])
{
        new
        sSenderName[24],
        sString[128];

    GetPlayerName(playerid, sSenderName, sizeof (sSenderName);
    format(sString, sizeof sString, "(Team Message) ID: %d.%s. (%s) ",playerid, sSenderName, text);

    for(new iPlayer = 0 ; iPlayer < MAX_PLAYERS; iPlayer++)
    {
        if(IsPlayerAdmin(iPlayer))
        {
            SendClientMessage(iPlayer, 0xFFFFFFAA, sString);
        }
    }

    return true;
}
Код:
C:\Users\user\Desktop\TextTT.pwn(30) : warning 235: public function lacks forward declaration (symbol "OnPlayerTeamPrivmsg")
C:\Users\user\Desktop\TextTT.pwn(36) : warning 217: loose indentation
C:\Users\user\Desktop\TextTT.pwn(36) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Hmm still 1 error and 2 warnings ....

Help me out
Reply
#7

OnPlayerPrivMsg can be removed because SA:MP 0.3 doesnt have that function anymore and therefore it will not work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)