SA-MP Forums Archive
Help NPC Vehicle Don't work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help NPC Vehicle Don't work (/showthread.php?tid=180395)



Help NPC Vehicle Don't work - eixas10000 - 01.10.2010

..

My npc is not work?

What wrong?

This my code

Код HTML:
#define RECORDING "busnpc" 
#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
in gamemode


Код HTML:
Ontop
new busNPC;

OnplayerSpawn
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, "Bus_Npc", true)) //Checking if the NPC's name is MyFirstNPC
        {
            PutPlayerInVehicle(playerid, busNPC, 0); //Putting the NPC into the vehicle we created for it.
        }
        return 1;
    }


OnGameModeInit

print("my gamemode");
    ConnectNPC("Bus_Npc","busnpc");

busNPC = CreateVehicle(431, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);