FakeClients - specifically their weapons
Hi all,
I'm still playing around with fakeclients for testing purposes. (I can't run CS, so I'm stuck with hordes of log_amx() and fakeclients) I'm having some problems with getting them to fire, though ... I should be able to force an attack by setting their "buttons" in FM, but that's not the real problem atm. I just can't get them to equip a weapon at all, and it's really annoying me. How would you get the FakeClient to "equip" a weapon ... that is, have it so that when they fire, they fire that weapon, and cs_get_user_weapon will return it as their current weapon. Thanks. On a related note (came across this while testing): 1) What are the real differences between fakeclients and real clients for AMX/CS? 2) What is the difference between client_cmd() and engclient_cmd() ? |
Re: FakeClients - specifically their weapons
1) None... with minor exceptions...
2) simply put: client_cmd() is used to "set" a client attribute (ex. you would do a client_cmd(id, "name", "whatever") to force a name change), while engclient_cmd() is used for "pure" commands (you would do an engclient_cmd(id, "drop") to force the player to drop the current weapon). Mostly you would use engclient_cmd() if the command has no arguments. Note that you cannot control your player with either of them. Movement, combat, etc. actions are handled in another way. For the problem at hand: you would have to give the weapon first and make it the current weapon. If you'r unable to test it "live" the you should use a message-logger. There was a tut about this a while ago... I can't find it atm... |
Re: FakeClients - specifically their weapons
Quote:
I don't think I need a message-logger as such (at least right now) - I'm spawning a bot, then on a task trying to give / set its weapon and amx_log'ing a get_user_weapon(). I can handle most "viewing" of the game with amx_log. From reading other plugins' code, to force a real player to equip a specific weapon is just its name. e.g. englient_cmd(id,"weapon_knife") but this doesn't work on fake ones :-( And as for the movement, combat and actions - I'd do that with RunPlayerMove and the "buttons" bit field, right? Thanks again. p.s. anyone know a straight answer to "how do you force a fakeclient to equip a weapon?" (but feel free to reply to anything else mentioned) |
Re: FakeClients - specifically their weapons
Right. My bad.
Spaw the weapon, set it solid, force a touch with your fake player. The code for this is much like the one for transfer_user_gun() from VEN's Fakemeta Utilities. engclient_cmd(id, ""weapon_x") is used to force the player to make that weapon the current one. This implies that the player must have it first. You'll find the answers (at least most of them) if you take a look into Potti |
Re: FakeClients - specifically their weapons
Well it just doesn't work.
Hmmph. I read through Potti, and I can see that the method is again 'engclient_cmd(id,"weapon_deagle")' to equip a deagle ... The code I used is this: (cs_createbot() is a fully functional routine to create a fakeclient and put them in the server. Returns playerid ) Code:
Any ideas? (Thanks again, btw) |
Re: FakeClients - specifically their weapons
http://forums.alliedmods.net/showthr...&highlight=botthe tutorial abut how to make a bot/npc and equip it whit gun...
|
Re: FakeClients - specifically their weapons
I could give the model a weapon, no hassle.
I want the player to actually equip the weapon, not just look like it does. Unless of course I've just mis-read TS's whole thread and it does actually do this ... |
| All times are GMT -4. The time now is 16:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.