NPC Help
#1

Alright, so, how do we actually set the flying NPCS to the ground using ColAndreas?
Reply
#2

Bump
Reply
#3

Quote:
Originally Posted by DBZdabIt3Bro7
Посмотреть сообщение
I'd suggest to use FCNPC, and then use the native;


And the rest is relatively easy to solve.
PHP код:
new Float:xFloat:yFloat:z;
CA_FindZ_For2DCoord(xyz);
SetMyPos(npcidxyz);
// Or
FCNPC_SetPosition(npcidxyz); 
FCNPC gives you a lot bigger control over NPC's than what you already got.
Already using FCNPC, and if I use that everytime, I guess the zombie will go under ground, well let me check it out
Reply
#4

PHP код:
new Float:xFloat:yFloat:znewFloat:z;
GetPlayerPos(npcidxyz);
CA_FindZ_For2DCoord(xyznew);
FCNPC_SetVelocity(npcid,x,y,znew); 
The zombie gets tped to somewhere else, a far away place tho.
Reply
#5

Tried using FCNPC_GetPositon now but still the issue is same.
Reply
#6

It still disappears.
PHP код:
new Float:xFloat:yFloat:zFloat:unused;
                
FCNPC_GetPosition(npcidxyz);
                new 
Float:zx,Float:zy;
                
GetXYInFrontOfPlayer(npcidzxzy5.0);
                new 
Float:angle;
                
GetPlayerFacingAngle(npcid,angle);
                new 
Float:newx 0.0Float:newy 0.0Float:znew;
                
CA_FindZ_For2DCoord(newxnewyznew);
                
FCNPC_SetVelocity(npcid,x,y,znew);
                
                if(
CA_RayCastLineAngle(xyzzxzyzunusedunusedunusedunusedunusedunused))
                {
                    
                    
FCNPC_Stop(npcid);
                    
printf("Wall"); //debug
                    
SetPVarInt(npcid,"Ignore",1);
                } 
Here's the full code, that raycast code is for avoiding walls but yeah that can be wrong too, because I'm new to ColAndreas
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)