AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Chicken spawner (https://forums.alliedmods.net/showthread.php?t=49498)

Imanoobie 01-05-2007 15:58

Chicken spawner
 
1 Attachment(s)
Hi!

I am making an chicken spawner, you can use it to spawn chickens (like those on cs_italy) where you aim. But i am having a strange bug.

When i try to spawn a chicken, i instantly gets teleported to the maps 0, 0, 0 origin, and the chicken too.

Otherwise, its working just as intended.
If anyone could help out, it would be appreciated.


Source:

hlstriker 01-05-2007 16:08

Re: Chicken spawner
 
Line 32 you have...

Code:
new float:origin[3]

It should be...
Code:
new Float:origin[3]

Capital F on Float. I think that should fix it?

Imanoobie 01-05-2007 16:27

Re: Chicken spawner
 
It was AMXX-Studio that told it should be 'float' and not 'Float'

Damnit.
Well, i tryed with 'Float' and the var turned into an float.
But it still teleported me to the 0, 0, 0 origin of the map :S

Thanks for helping out, anyway.

P34nut 01-05-2007 18:06

Re: Chicken spawner
 
float is a function.. thats why amx studio tells you that

Calimaw 01-05-2007 18:45

Re: Chicken spawner
 
Rukia made a good tutorial on NPCs, I think this would fit the bill.

http://forums.alliedmods.net/showthread.php?t=11756

Imanoobie 01-05-2007 19:10

Re: Chicken spawner
 
Quote:

Originally Posted by Calimaw (Post 424080)
Rukia made a good tutorial on NPCs, I think this would fit the bill.

http://forums.alliedmods.net/showthread.php?t=11756

Thats is what i based the plugin on, lol

hip_hop_x 01-05-2007 19:56

Re: Chicken spawner
 
Try to use get_user_info to get the origin of the player.

P34nut 01-06-2007 05:38

Re: Chicken spawner
 
Quote:

Originally Posted by hip_hop_x (Post 424108)
Try to use get_user_info to get the origin of the player.

no...
pev(ent, pev_origin, fRetOrigin)

MaximusBrood 01-06-2007 08:50

Re: Chicken spawner
 
Ignore the people above me, they don't know where they are talking about.

Line 33:
Code:
entity_set_vector(id, EV_VEC_origin, origin)

I don't know why you want to set your origin to your current origin, it makes no sense.
IF you want to set the origin of a player, use set_user_origin, not entity_set_vector!

Quote:

Originally Posted by P34nut (Post 424224)
no...
pev(ent, pev_origin, fRetOrigin)

Or just use the basic native get_user_origin.

P34nut 01-07-2007 12:12

Re: Chicken spawner
 
Quote:

Originally Posted by MaximusBrood (Post 424242)
Or just use the basic native get_user_origin.

I think its better to use Float for vectors...


All times are GMT -4. The time now is 18:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.