Raised This Month: $12 Target: $400
 3% 

Chicken spawner


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Imanoobie
BANNED
Join Date: Sep 2006
Old 01-05-2007 , 15:58   Chicken spawner
Reply With Quote #1

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:
Attached Files
File Type: sma Get Plugin or Get Source (amx_chickenspawner.sma - 1041 views - 1.8 KB)
Imanoobie is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 01-05-2007 , 16:08   Re: Chicken spawner
Reply With Quote #2

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?
hlstriker is offline
Old 01-05-2007, 16:22
Imanoobie
This message has been deleted by Imanoobie.
Imanoobie
BANNED
Join Date: Sep 2006
Old 01-05-2007 , 16:27   Re: Chicken spawner
Reply With Quote #3

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.
Imanoobie is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 01-05-2007 , 18:06   Re: Chicken spawner
Reply With Quote #4

float is a function.. thats why amx studio tells you that
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Calimaw
Junior Member
Join Date: Dec 2006
Old 01-05-2007 , 18:45   Re: Chicken spawner
Reply With Quote #5

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

http://forums.alliedmods.net/showthread.php?t=11756
Calimaw is offline
Imanoobie
BANNED
Join Date: Sep 2006
Old 01-05-2007 , 19:10   Re: Chicken spawner
Reply With Quote #6

Quote:
Originally Posted by Calimaw View Post
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
Imanoobie is offline
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 01-05-2007 , 19:56   Re: Chicken spawner
Reply With Quote #7

Try to use get_user_info to get the origin of the player.
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 01-06-2007 , 05:38   Re: Chicken spawner
Reply With Quote #8

Quote:
Originally Posted by hip_hop_x View Post
Try to use get_user_info to get the origin of the player.
no...
pev(ent, pev_origin, fRetOrigin)
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 01-06-2007 , 08:50   Re: Chicken spawner
Reply With Quote #9

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 View Post
no...
pev(ent, pev_origin, fRetOrigin)
Or just use the basic native get_user_origin.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 01-07-2007 , 12:12   Re: Chicken spawner
Reply With Quote #10

Quote:
Originally Posted by MaximusBrood View Post
Or just use the basic native get_user_origin.
I think its better to use Float for vectors...
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
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

Forum Jump


All times are GMT -4. The time now is 06:29.


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