4th NPC Leaves.
#19

But you code isn't correct.
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    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, "Soldier_1", true)) //Checking if the NPC's name is MyFirstNPC
        {
            SetPlayerSkin(playerid, 287);
        }
        if(!strcmp(npcname, "Soldier_2", true)) //Checking if the NPC's name is MyFirstNPC
        {
            SetPlayerSkin(playerid, 287);
        }
        if(!strcmp(npcname, "Soldier_3", true)) //Checking if the NPC's name is MyFirstNPC
        {
            SetPlayerSkin(playerid, 287);
        }
        if(!strcmp(npcname, "Soldier_4", true)) //Checking if the NPC's name is MyFirstNPC
        {
            SetPlayerSkin(playerid, 287);
        }
        return 1;
    }
    return 1;
}
It doesn't need to have two
Код:
if(IsPlayerNPC(playerid))
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;
}
Also, check again if the 4th NPC's file (.rec) is on the recordings folder and the .pwn in the npcmodes
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)