NPC help
#1

Ok so i have something when i type a cmd IG it makes it seem as my NPC is using it, but my god.pwn is not compiling for some reason... I get errors...

Code
Код:
#define RECORDING "god" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //1 for in vehicle and 2 for on foot.
#include <a_npc>
#include <sscanf2>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif

public OnClientMessage(color, text[])
{
    if(text[0] != '/' || color != 123456) return; // ignore all other client messages that NPC receives

    new cmd[64], params[128];
    sscanf(text, "s[64]s[128]", cmd, params);

    if(strcmp(cmd, "/sendcmd", true) == 0)
    {
        SendCommand(params);
        return;
    }

    if(strcmp(cmd, "/playback", true) == 0)
    {
        new playbacktype, recordname[64], msg[128];
        sscanf(params, "ds[64]", playbacktype, recordname);
        format(msg, sizeof(msg), "Starting playback (type: %d  name: %s)", playbacktype, recordname);
        SendChat(msg);
        StartRecordingPlayback(playbacktype, recordname);
        return;
    }
}
errors
Код:
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(43) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(46) : error 017: undefined symbol "GetMaxPlayers"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(50) : error 017: undefined symbol "CallLocalFunction"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(62) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit")
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(67) : error 017: undefined symbol "GetMaxPlayers"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(84) : error 017: undefined symbol "CallLocalFunction"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(98) : warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(103) : error 017: undefined symbol "IsPlayerNPC"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(114) : error 017: undefined symbol "CallLocalFunction"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(128) : warning 235: public function lacks forward declaration (symbol "OnPlayerDisconnect")
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(143) : error 017: undefined symbol "CallLocalFunction"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Reply
#2

Maybe you forgot to include these :
pawn Код:
#include <a_npc>
#include <a_samp>
Also, you need to add thse:
pawn Код:
public OnFilterScriptInit()
{
    print(" NPC_Name Loaded.");
    return 1;
}
public OnPlayerConnect(playerid)
{
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}
Reply
#3

No no my gamemode does fine, but not the npcmode (god.pwn)
Reply
#4

this is the tut i used

https://sampforum.blast.hk/showthread.php?tid=276088
Reply
#5

You have to add what I sent you to your God.pwn ..
Reply
#6

Ok i did...

Code now
pawn Код:
#define RECORDING "god" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //1 for in vehicle and 2 for on foot.
#include <a_npc>
#include <a_samp>
#include <sscanf2>

main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif

// Public's

public OnFilterScriptInit()
{
    print(" NPC_Name Loaded.");
    return 1;
}
public OnPlayerConnect(playerid)
{
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnClientMessage(color, text[])
{
    if(text[0] != '/' || color != 123456) return; // ignore all other client messages that NPC receives

    new cmd[64], params[128];
    sscanf(text, "s[64]s[128]", cmd, params);

    if(strcmp(cmd, "/sendcmd", true) == 0)
    {
        SendCommand(params);
        return;
    }

    if(strcmp(cmd, "/playback", true) == 0)
    {
        new playbacktype, recordname[64], msg[128];
        sscanf(params, "ds[64]", playbacktype, recordname);
        format(msg, sizeof(msg), "Starting playback (type: %d  name: %s)", playbacktype, recordname);
        SendChat(msg);
        StartRecordingPlayback(playbacktype, recordname);
        return;
    }
}
Same errors...
pawn Код:
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(43) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(46) : error 017: undefined symbol "GetMaxPlayers"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(50) : error 017: undefined symbol "CallLocalFunction"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(62) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit")
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(67) : error 017: undefined symbol "GetMaxPlayers"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(84) : error 017: undefined symbol "CallLocalFunction"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(98) : warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(103) : error 017: undefined symbol "IsPlayerNPC"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(114) : error 017: undefined symbol "CallLocalFunction"
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(128) : warning 235: public function lacks forward declaration (symbol "OnPlayerDisconnect")
G:\Server\A-RP V.1.5 0.3z RC3\pawno\include\sscanf2.inc(143) : error 017: undefined symbol "CallLocalFunction"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.
Reply
#7

BUMP
Reply
#8

Issue solved. I help him out and everything is fine now, no need to post here anymore
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)