27.10.2010, 19:07
Filterscript:
Npcmodes script:
The NPC spawns at his spawn place but dont moves, i alreadly tried to fix it but i cant, its something with OnPlayerSpawn. Anyone can help me?
Код:
//Rhino driver
#include <a_samp>
#include <a_npc>
new rhinodriver;
public OnFilterScriptInit()
{
ConnectNPC("rhino","rhino");
rhinodriver = CreateVehicle(432, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
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, "rhino", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, rhinodriver, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
return 1;
}
Код:
#define RECORDING "rhino" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //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

