NPC weird reaction
#3

If you think that pasting a code shuttered around the gm is that easy then... meh, mkay.
But, I will say again, there's not much difference between the codes. So, how does one bus work but the other one just stops in the presence of a player? [ The recording keeps going, if i TP to the bus id again, it teleports me to an invisible moving thingy which is the actual recording. ]

Код:
    OnPlayerSpawn:
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "EasternBus", true))
        {
                SetPlayerColor(playerid, 0xFFFFFF00);
	        PutPlayerInVehicle(playerid, Bus38, 0);
        	SetPlayerSkin(playerid, 255);
        	ResetPlayerWeapons(playerid);
        	Attach3DTextLabelToVehicle(Text38, Bus38, 0.0, 0.0, 0.0);
        }
        if(!strcmp(npcname, "WesternBus", true))
        {
                SetPlayerColor(playerid, 0xFFFFFF00);
		PutPlayerInVehicle(playerid, Bus85, 0);
        	SetPlayerSkin(playerid, 255);
        	ResetPlayerWeapons(playerid);
        	Attach3DTextLabelToVehicle(Text85, Bus85, 0.0, 0.0, 0.0);
        }
        return 1;
    }
The basic stuff at ongamemodeinit: 
        ConnectNPC("EasternBus","Bus");
	ConnectNPC("WesternBus","Bus2");

The recordings .pwn files:
#define RECORDING "Bus"
#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

and

#define RECORDING "Bus2"
#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

The rest of the code doesn't matter so i won't bother pasting it.
Reply


Messages In This Thread
NPC weird reaction - by KreeDz - 28.01.2012, 22:30
Re: NPC weird reaction - by [KHK]Khalid - 29.01.2012, 00:43
Re: NPC weird reaction - by KreeDz - 29.01.2012, 12:34
Re: NPC weird reaction - by KreeDz - 31.01.2012, 18:11

Forum Jump:


Users browsing this thread: 3 Guest(s)