How to set a specific NPC's skin?
#2

Didn't understand well what you meant by "add one demonic NPC at a coordinate" so i'll just assume you want the first one to be at random coords

so:
Код:
new IsDemonicOne[MAX_PLAYERS];
new DemonicHasSpawned = 0;
OnPlayerSpawn
Код:
 if(DemonicHasSpawned == 0 && IsPlayerNPC(playerid))
{
//Set him the skin you want to have and have him spawn at a random coord
DemonicGuy = 1; //So it won't trigger anymore this func
IsDemonicOne[playerid] = 1; //So you defined that he IS the demonic zombie and you can handle him separately
}
Код:
if(IsPlayerNPC(playerid) && DemonicHasSpawned == 1) //Check if the demonic zombie has spawned, if yes spawn the other zombies this way
    {
            new spawn = random(sizeof(ZombieSpawns));
            SetPlayerPos(playerid, ZombieSpawns[spawn][0], ZombieSpawns[spawn][1], ZombieSpawns[spawn][2]);

            SetRNPCHealth(playerid, ZOMBIE_HEALTH);
            SetPlayerSkin(playerid, ZSkins[random(12)]);
            SetPlayerColor(playerid, ZOMBIE_COLOR);

            RNPC_SetShootable(playerid, 1);
            RNPC_ToggleVehicleCollisionCheck(playerid, 1);

            GetZombieVictimID[playerid] = INVALID_PLAYER_ID;
            return 1;
    }
PS. I'm not that very good at scripting but i tried to help you, just don't take my code as perfect, it may contain errors and bugs.
Reply


Messages In This Thread
How to set a specific NPC's skin? - by Zeus666 - 25.09.2018, 09:40
Re: How to set a specific NPC's skin? - by Flamehaze7 - 25.09.2018, 11:33

Forum Jump:


Users browsing this thread: 1 Guest(s)