13.10.2011, 03:33
Hey,
trying to add NPC's into my game but i get errors:
its proberly summit simple but im to tired to find out what so please help
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.