4th NPC Leaves.
#17

It should be like this. 4 different .rec files on your <Your SA-MP server directory>/npcmodes/recordings/ and 4 different .pwn files like these under.
pawn Код:
#define RECORDING "Soldier1" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //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
pawn Код:
#define RECORDING "Soldier2" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //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
pawn Код:
#define RECORDING "Soldier3" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //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
pawn Код:
#define RECORDING "Soldier4" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //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
pawn Код:
public OnGameModeInit()
{
    ConnectNPC("Soldier_1","Soldier1");
    ConnectNPC("Soldier_2","Soldier2");
    ConnectNPC("Soldier_3","Soldier3");
    ConnectNPC("Soldier_4","Soldier4");
    //More
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) {                   //Checks if the player that just spawned is an NPC.
        new npcname[MAX_PLAYER_NAME];
                                                  //Getting the NPC's name.
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "Soldier_1", true)) { //Checking if the NPC's name is MyFirstNPC
            SetPlayerSkin(playerid, 287);
            return 1;
        }
        if(!strcmp(npcname, "Soldier_2", true)) { //Checking if the NPC's name is MyFirstNPC
            SetPlayerSkin(playerid, 287);
            return 1;
        }
        if(!strcmp(npcname, "Soldier_3", true)) { //Checking if the NPC's name is MyFirstNPC
            SetPlayerSkin(playerid, 287);
            return 1;
        }
        if(!strcmp(npcname, "Soldier_4", true)) { //Checking if the NPC's name is MyFirstNPC
            SetPlayerSkin(playerid, 287);
            return 1;
        }
        return 1;
    }
    //For normal players goes here!
    return 1;
}
Reply


Messages In This Thread
4th NPC Leaves. - by Lynn - 06.11.2011, 21:15
Re: 4th NPC Leaves. - by MP2 - 06.11.2011, 22:18
Re: 4th NPC Leaves. - by Lynn - 07.11.2011, 01:31
Re: 4th NPC Leaves. - by RadioRocker - 07.11.2011, 01:38
Re: 4th NPC Leaves. - by MP2 - 07.11.2011, 02:40
Re: 4th NPC Leaves. - by Lynn - 07.11.2011, 02:48
Re: 4th NPC Leaves. - by MP2 - 07.11.2011, 02:54
Re: 4th NPC Leaves. - by Lynn - 07.11.2011, 02:56
Re: 4th NPC Leaves. - by MP2 - 07.11.2011, 02:58
Re: 4th NPC Leaves. - by Lynn - 07.11.2011, 03:01
Re: 4th NPC Leaves. - by RadioRocker - 07.11.2011, 03:05
Re: 4th NPC Leaves. - by MP2 - 07.11.2011, 03:06
Re: 4th NPC Leaves. - by Lynn - 07.11.2011, 03:09
Re: 4th NPC Leaves. - by MP2 - 07.11.2011, 03:13
Re: 4th NPC Leaves. - by Lynn - 07.11.2011, 03:18
Re: 4th NPC Leaves. - by MP2 - 07.11.2011, 08:51
Re: 4th NPC Leaves. - by Kostas' - 07.11.2011, 10:46
Re: 4th NPC Leaves. - by Lynn - 07.11.2011, 11:17
Re: 4th NPC Leaves. - by Kostas' - 07.11.2011, 11:23
Re: 4th NPC Leaves. - by Lynn - 07.11.2011, 19:12

Forum Jump:


Users browsing this thread: 1 Guest(s)