Quote:
|
Originally Posted by Lord_Destros
Ummmm, that shouldn't work at all.
1. You never created a method named clcmd_buy
2. You never set origin on where NPC (the store only, not the model) should appear, I believe this would cause /buy to work anywhere around the map.
Yes, yes, i know you said this wouldn't work, just pointin it out though  .
|
Really, all the NPC is is a model, you simply see if the person is in a certain area, and if they are, and they have hit /buy, then show the menu.
Suzuka's first tutorial (
http://forums.alliedmods.net/showthread.php?t=11756 ) will make the NPC's model, but she did NOT make a cashier or anything like that. Just a model that stays in place and you cannot pass through it.
Code:
register_cvar("rp_position_gunshop","-2407 144 -411") // Gunshop Position (Mecklenburg_B8v6 Default)
Then later, . . .
Code:
if(get_distance(origin,gunshop) <= 35.0)
{
Gunshop_Main(id)
}
Where Origin is simply where the player is currently, and gunshop is the X, Y, Z coordinates of where the Gunshop NPC is.
And if you're close enough, it forwards your ID to Gunshop_Main, where it checks if you want to buy something (I think? >> )
So you could get the client command, and then check your distance from the Gunshop or whatever else, and if it's less than a certain number, go ahead and make your menu. o.o
Edit: Forgot to add, those code snippets were from Harbu's plugin.