NPC Failure.
#1

Hey all, I've made a NPC Script and i got it recorded and everyting. My first npc worked well (on-foot) the second NPC Was a helicopter in air but it kind of failed.. It leaves the server as soon i join.. Here's my stuff :

Yes, I put maxnpc on 5.



I made a special Filterscript for it, my on-foot npc is in the GM.
Quote:

#include <a_samp>

new PoliceMav;

main(){}


public OnFilterScriptInit()
{
print("Maverick 0.1");
PoliceMav = CreateVehicle(497, 0.0, 0.0, 5.0, 0.0, 2, 2, 5000);
ConnectNPC("Pilot", "npc_maverick");
return 1;
}



public OnPlayerRequestClass(playerid, classid)
{
if(!IsPlayerNPC(playerid))
{

}
return 1;
}

public OnPlayerConnect(playerid)
{
if(!IsPlayerNPC(playerid))
{

}
return 1;
}


public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npc_name[24];
GetPlayerName(playerid,npc_name,sizeof(npc_name));
if(!strcmp(npc_name,"Pilot",true))
{
PutPlayerInVehicle(playerid, PoliceMav, 0);
SetSpawnInfo(playerid, 1, 284, 185.2623,2634.1902,104.4029,93.5125, 31, 1, 0, 0, 0 ,0);
return 1;
}
}
return 1;
}

Script of NPC


Quote:

#define RECORDING "npc_polic"
#define RECORDING_TYPE 1

#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

Error's on compiling : None
Reply
#2

Did you record it as vehicle npc?
Reply
#3

Yes, IG I recorded as vehicle NPC And than fly'ed around, and stopped with /stoprecord
Reply
#4

You checking if player is NOT NPC
pawn Код:
if(IsPlayerNPC(playerid)) return 1;
Reply
#5

lemme test
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)