Raised This Month: $ Target: $400
 0% 

Creating Buyzones


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-25-2007 , 18:45   Creating Buyzones
Reply With Quote #1

How would you create a buyzone in a certain spot that can be used? Let's just say for example in a spot where a person spawns, thus something like {-16.0,-16.0,-36.0}/{16.0,16.0,36.}.

I've tried checking if the person is next to it and forcing them to touch, but nothing is happening. I've also tried forcing the status icon, but that also doesn't work.

Here's my code for creating it so far:

Code:
Ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))     if(!Ent)         return 0             //new TeamValue[5]     //format(TeamValue,4,"%d",Team + 1)         set_pev(Ent,pev_classname,g_Buyzone)     set_pev(Ent,pev_model,"*19")         //set_kvd(0,KV_ClassName,g_Buyzone)     //set_kvd(0,KV_KeyName,"team")     //set_kvd(0,KV_Value,TeamValue)     //set_kvd(0,KV_fHandled,0)     //dllfunc(DLLFunc_KeyValue,Ent,0)     //set_pev(Ent,pev_movetype,MOVETYPE_PUSH)     set_pev(Ent,pev_team,Team + 1)     dllfunc(DLLFunc_Spawn,Ent)     engfunc(EngFunc_SetOrigin,Ent,Origin)     new Float:Min[3],Float:Max[3]     Min = Origin     Max = Origin     Min[2] -= 36.0     Max[2] += 36.0     for(new Count;Count < 2;Count++)     {         Min[Count] -= 16.0         Max[Count] += 16.0     }         set_pev(Ent, pev_renderfx, kRenderFxNone)     set_pev(Ent, pev_rendercolor, Float:{0.0,255.0,0.0})     set_pev(Ent, pev_rendermode, kRenderNormal)     set_pev(Ent, pev_renderamt, 255.0)         //set_pev(Ent,pev_absmin,Min)     //set_pev(Ent,pev_absmax,Max)     //set_pev(Ent,pev_mins,Min)     //set_pev(Ent,pev_maxs,Max)     //engfunc(EngFunc_SetSize,Ent,Min,Max)     engfunc(EngFunc_SetSize,Ent,Float:{-100.0,-100.0,-36.0},Float:{100.0,100.0,36.0})     set_pev(Ent,pev_solid,SOLID_TRIGGER)     //set_pev(Ent,pev_team,Team + 1)

Very messy, I know.

I also tried the post think thing:

Code:
public ForwardPlayerPostThink(id) {     static Float:Origin[3],Classname[33]     pev(id,pev_origin,Origin)         new Ent,Team = get_user_team(id)         while((Ent = engfunc(EngFunc_FindEntityByString,Ent,"classname",g_Buyzone)) != 0)     {                 if(fm_distance_to_boxent(id,Ent) > 50.0 || pev(Ent,pev_team) != Team)             continue                     client_print(id,print_chat,"Found buyzone")         dllfunc(DLLFunc_Touch,Ent,id)         break     } }

It says "found buyzone" when you're close to one, but it doesn't let you buy.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 22:19.


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