SA-MP Forums Archive
[Problem]NPC has left the server - 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)
+--- Thread: [Problem]NPC has left the server (/showthread.php?tid=421658)



[Problem]NPC has left the server - ZmaXy - 10.03.2013



OnGameModeInit
pawn Код:
ConnectNPC("Bolnica_Doktor","Bolnica_Doktor");
ConnectNPC("Bolnicak_Bot","Bolnicak_Bot");
OnPlayerSpawn
pawn Код:
if(IsPlayerNPC(playerid))
    {
        new npc_name[24];
        GetPlayerName(playerid,npc_name,sizeof(npc_name));
        if(!strcmp(npc_name,"Bolnica_Doktor",false))
        {
            SetPlayerSkin(playerid, 70);
            ApplyAnimation(playerid, "PED", "IDLE_CHAT", 1, 0, 0, 0, 0, 1000, 1);
            ApplyAnimation(playerid, "PED", "IDLE_CHAT", 1, 0, 0, 0, 0, 1000, 1);
        }
        if(!strcmp(npc_name,"Bolnicak_Bot",false))
        {
            SetPlayerSkin(playerid, 146);
            ApplyAnimation(playerid,"CRACK","crckdeth2",4.1,1,1,1,1,1,1);
            ApplyAnimation(playerid,"CRACK","crckdeth2",4.1,1,1,1,1,1,1);
        }
        return 1;
    }



Re: [Problem]NPC has left the server - Threshold - 10.03.2013

NOTE: If you are using a login system, make sure you are allowing the NPC through it.

pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    //rest of onplayerconnect here
    return 1;
}



Re: [Problem]NPC has left the server - ZmaXy - 10.03.2013

doesn't work, the same, npc has left.....


Re: [Problem]NPC has left the server - ZmaXy - 10.03.2013

bump, please, i need this...