Skip to content

os npcs não estão sendo exibidos dentro do jogo. #324

@Vecprogramador

Description

@Vecprogramador

o que acontece, o código é compilado certinho e nos los fala que Todos os zumbis foram gerados com sucesso, mais quando entro dentro do jogo eu não vejo um npc no servidor, o código de criação está a baixo. (ah e eu estou usando a verção mais atualizada da include e do plugin).

new Float:ZombieSpawns[][] =
{
	{1089.5581,1771.1646,19.3677},
	{2672.498535,-1943.021728,12.539999},
	{2203.854003,868.086914,6.329998},
	{-1320.320190,-559.027343,13.140000},
	{1570.297851,1266.574707,9.810000},
};

hook OnGameModeInit()
{
	CA_Init();
	MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
	
	new str[50];
	for(new i = 0; i < sizeof(ZombieSpawns); i++)
    {
        format(str, sizeof(str), "Zumbi[%d]", i);
        new npcid = FCNPC_Create(str);
        ZombieLabel[npcid] = Create3DTextLabel("{B22222}Vida: 100", -1, 30.0, 40.0, 50.0, 50.0, -1, 0);
        Attach3DTextLabelToPlayer(ZombieLabel[npcid], npcid, 0.0, 0.0, 0.4);     
        FCNPC_Spawn(npcid, 162, ZombieSpawns[i][0], ZombieSpawns[i][1], ZombieSpawns[i][2] + 1.0);
        FCNPC_SetWeapon(npcid, 1);
        FCNPC_SetHealth(npcid, 100);
        FCNPC_SetInvulnerable(npcid, false);
        SetZombieAttachedObjects(npcid);
        ZombieTimer[npcid] = repeat ZombieMove(npcid);
        SetPlayerColor(npcid, 0xFF0000FF);
        IsAZombie[npcid] = 1;
    }
	printf("Todos os zumbis foram gerados com sucesso.");	
	return 1;
}

hook FCNPC_OnCreate(npcid)
{
	
	new rnd = random(sizeof(ZombieSpawns));
	ZombieLabel[npcid] = Create3DTextLabel("{B22222}[Zumbi]\n{FFFFFF}Vida: 100", -1, 30.0, 40.0, 50.0, 60.0, -1, 0);
	Attach3DTextLabelToPlayer(ZombieLabel[npcid], npcid, 0.0, 0.0, 0.4); 	
	FCNPC_Spawn(npcid,162, ZombieSpawns[rnd][0],ZombieSpawns[rnd][1],ZombieSpawns[rnd][2]+1.0);
	FCNPC_SetWeapon(npcid, 1);
	FCNPC_SetHealth(npcid, 100);
	FCNPC_SetInvulnerable(npcid, false);
	SetZombieAttachedObjects(npcid);
	ZombieTimer[npcid] = repeat ZombieMove(npcid);
	SetPlayerColor(npcid,0xFF0000FF);
	IsAZombie[npcid] = 1;
	return 1;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions