ERRORS WITH NPC! - 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)
+--- Thread: ERRORS WITH NPC! (
/showthread.php?tid=289815)
ERRORS WITH NPC! -
DaRkAnGeL[NBK] - 13.10.2011
Hey,
trying to add NPC's into my game but i get errors:
pawn Код:
#define RECORDING "Cop1" //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>
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 OnFilterScriptInit()
{
print("my filterscript");
ConnectNPC("MyFirstNPC","Cop1");
if(IsPlayerNPC(playerid)) return 1;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
Код:
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(18) : error 017: undefined symbol "ConnectNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(19) : error 017: undefined symbol "IsPlayerNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(22) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn")
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(24) : error 017: undefined symbol "IsPlayerNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(30) : error 017: undefined symbol "PutPlayerInVehicle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
its proberly summit simple but im to tired to find out what so please help
Re: ERRORS WITH NPC! -
SuperViper - 13.10.2011
Move
pawn Код:
public OnFilterScriptInit()
{
print("my filterscript");
ConnectNPC("MyFirstNPC","Cop1");
if(IsPlayerNPC(playerid)) return 1;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
to your gamemode or a filterscript and remove
NPC scripts are different from regular filterscripts and gamemodes.
Re: ERRORS WITH NPC! -
DaRkAnGeL[NBK] - 13.10.2011
Код:
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(18) : error 017: undefined symbol "ConnectNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(21) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn")
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(23) : error 017: undefined symbol "IsPlayerNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(29) : error 017: undefined symbol "PutPlayerInVehicle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Re: ERRORS WITH NPC! -
DaRkAnGeL[NBK] - 13.10.2011
nvm all working fine now
Re: ERRORS WITH NPC! -
DaRkAnGeL[NBK] - 13.10.2011
okay now my NPC is timing out ? why would this be
Re: ERRORS WITH NPC! -
whitedragon - 13.10.2011
RequestClass check return 1 for them?(bots)
Re: ERRORS WITH NPC! -
Tigerkiller - 13.10.2011
i tell you in msn
Re: ERRORS WITH NPC! -
DaRkAnGeL[NBK] - 13.10.2011
when you coming on MSN ?
Re: ERRORS WITH NPC! -
SDraw - 13.10.2011
You don't have
PHP код:
#include <a_samp>
So simple....
Re: ERRORS WITH NPC! -
DaRkAnGeL[NBK] - 13.10.2011
you dont need it i dont think with bots i have never used it and never had any issues