#define RECORDING "mujbot" //Název souboru, který jsme nahrávali bez přípony .rec
#define RECORDING_TYPE 1 //1 pokud je v autě, pěšky je to 2
#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
new AutoBota; //Global variable!
public OnPlayerConnect(playerid)
{
ConnectNPC("Michal","mujbot");
AutoBota = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Kontrola, pokud je spawnutý NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Zjišťuje jméno NPC.
if(!strcmp(npcname, "Michal", true)) //Zjišťuje, jestli je jméno bota Michal
{
PutPlayerInVehicle(playerid, AutoBota, 0); //Strčí NPC do auta, které sme vytvořili
}
}
return 1;
}
ERRORY ->
C:\Documents and Settings\Admin\Plocha\se\npcmodes\mujbot.pwn(19) : warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")
C:\Documents and Settings\Admin\Plocha\se\npcmodes\mujbot.pwn(21) : error 017: undefined symbol "ConnectNPC"
C:\Documents and Settings\Admin\Plocha\se\npcmodes\mujbot.pwn(22) : error 017: undefined symbol "CreateVehicle"
C:\Documents and Settings\Admin\Plocha\se\npcmodes\mujbot.pwn(27) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn")
C:\Documents and Settings\Admin\Plocha\se\npcmodes\mujbot.pwn(29) : error 017: undefined symbol "IsPlayerNPC"
C:\Documents and Settings\Admin\Plocha\se\npcmodes\mujbot.pwn(35) : error 017: undefined symbol "PutPlayerInVehicle"
C:\Documents and Settings\Admin\Plocha\se\npcmodes\mujbot.pwn(22) : warning 204: symbol is assigned a value that is never used: "AutoBota"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.