SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/12/2019, 07:53 AM   #1
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Posts: 678
Reputation: 64
Default ColAndreas: NPC not spawning

PHP Code:
public CreateZombies(newkeys)
{
    new 
string[50], zombie;
    if(
SpawnedZombies MAX_ZOMBIES)
    {
        
format(string,sizeof(string),"Zombie(%d)",MAX_PLAYERS-(SpawnedZombies));
        
zombie FCNPC_Create(string);

        
ZombieLabel[zombie] = Create3DTextLabel("Zombie\n"ZOMBIE_COLOR30.040.050.060.0, -10);
        
Attach3DTextLabelToPlayer(ZombieLabel[zombie], zombie0.00.00.4);

        new    
Float:pos[3], x=random(4000)-2000y=random(4000)-2000Float:z;
        for(new 
a100a++)
        {
            
//MapAndreas_FindZ_For2DCoord(x, y, z);
            
CA_FindZ_For2DCoord(xyz);
            if(
>= 5.0 && 30.0)
            {
                
pos[0] = x;
                
pos[1] = y;
                
pos[2] = z;
                
FCNPC_Spawn(zombieZOMBIE_SKINxyz);
                break;
            }
        }

          new 
Rand random(9);
        switch(
Rand)
        {
            case 
0FCNPC_SetWeapon(zombie1);
            case 
1FCNPC_SetWeapon(zombie2);
            case 
2FCNPC_SetWeapon(zombie3);
            case 
3FCNPC_SetWeapon(zombie4);
            case 
4FCNPC_SetWeapon(zombie5);
            case 
5FCNPC_SetWeapon(zombie6);
            case 
6FCNPC_SetWeapon(zombie7);
            case 
7FCNPC_SetWeapon(zombie8);
            case 
8FCNPC_SetWeapon(zombie15);
        }
        
FCNPC_SetHealth(zombieZOMBIE_HEALTH);

        
SetTimerEx("MoveZombie",100,1,"i",zombienewkeys);
          
//ZombieTimer[zombie] = repeat MoveZombie(zombie, newkeys);
        
SetPlayerColor(zombie,ZOMBIE_COLOR);
        
IsAZombie[zombie] = 1;
        
SpawnedZombies++;
    }
    else
    {
        
KillTimer(CreationTimer);
        
printf("Zombies creation done!");
    }
    return 
1;

So When I switched to ColAndreas for spawning NPCs, it doesn't work.
KayJ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] ColAndreas Ph0eniX Tutorials 1 23/07/2018 12:32 AM
ColAndreas DTV Scripting Help 1 20/10/2016 11:22 PM
ColAndreas Max_Andolini Scripting Help 13 12/06/2016 09:14 AM
ColAndreas - What have you used it for? Pottus Everything and Nothing 21 29/03/2016 10:05 PM
Help ColAndreas Crystallize Scripting Help 7 02/03/2016 03:53 AM


All times are GMT. The time now is 02:48 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.