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


Messages In This Thread
NPC Failure. - by Brunok - 22.07.2011, 17:46
AW: NPC Failure. - by Meta - 22.07.2011, 17:47
Re: NPC Failure. - by Brunok - 22.07.2011, 18:08
Re: NPC Failure. - by DRIFT_HUNTER - 22.07.2011, 18:18
Re: NPC Failure. - by Brunok - 22.07.2011, 18:35

Forum Jump:


Users browsing this thread: 1 Guest(s)