AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Unknown command: jointeam [HLDM] (https://forums.alliedmods.net/showthread.php?t=85520)

BFK_GoNER 02-12-2009 01:14

Unknown command: jointeam [HLDM]
 
Hey everybody,

I am trying to strip the players of all weapons whenever they pick up one. I use the following code. However, it does not seem to work with grenades, bugs and satchels. It's really weird, try for yourself:

PHP Code:

#include <amxmodx>
#include <fun>
 
new PLUGIN[]="test123"
new AUTHOR[]="gonr"
new VERSION[]="1.00"
 
public plugin_init()
{
     
register_plugin(PLUGINVERSIONAUTHOR)
     
register_event("WeapPickup""WepPkd""be")
}

public 
WepPkd(id)
{
    
set_task(0.1"WeaponPicked"id)
    return 
PLUGIN_CONTINUE
}

public 
WeaponPicked(id)
{
    
strip_user_weapons(id)
    
client_print(idprint_chat"Picked up")
    return 
PLUGIN_CONTINUE


I would appreciate any help from you guys
Thanks!

hleV 02-12-2009 05:11

Re: strip_user_weapons works selectively [HLDM]
 
Why don't you block the pickup?
Code:
#include <amxmodx> #include <fakemeta_util> #include <hamsandwich>   #define MAX_CLASSNAMES 3   new g_szClassNames[MAX_CLASSNAMES][] = {         "weaponbox",         "armoury_entity",         "grenade" };   public plugin_init() {         register_forward(FM_Touch, "fwTouch");           RegisterHam(Ham_Spawn, "player", "hSpawn", 1); }   public fwTouch(iEnt, iCl) {         if (!pev_valid(iEnt) || !is_user_alive(iCl))                 return FMRES_IGNORED;           new szClassName[32];         pev(iEnt, pev_classname, szClassName, 31);           for (new i = 0; i < MAX_CLASSNAMES; i++)                 if (equal(szClassName, g_szClassNames[i]))                         return FMRES_SUPERCEDE;           return FMRES_IGNORED; }   public hSpawn(iCl) {         if (!is_user_alive(iCl))                 return;           fm_strip_user_weapons(iCl); }

BFK_GoNER 02-12-2009 15:02

Re: strip_user_weapons works selectively [HLDM]
 
Thanks a lot! I've got another question.

I want my plugin to be able to switch players to spect mode and back. The first part is easy, I just execute the client command "spectate", but how do I bring the player back into the game? I can't use the jointeam command for some reason because this is what I get in console:

Code:

Unknown command: jointeam
I tried running the server in both DM and Teamplay modes but neither of them seem to work.

hleV 02-12-2009 15:26

Re: strip_user_weapons works selectively [HLDM]
 
Did you try engclient_cmd()?
Code:
engclient_cmd(Client, "jointeam", "num"); // num - team's number

BFK_GoNER 02-12-2009 16:28

Re: strip_user_weapons works selectively [HLDM]
 
Quote:

Originally Posted by hleV (Post 760573)
Did you try engclient_cmd()?
Code:
engclient_cmd(Client, "jointeam", "num"); // num - team's number


Yes, the client console gives this error: Unknown command: jointeam

Exolent[jNr] 02-12-2009 17:23

Re: strip_user_weapons works selectively [HLDM]
 
He asked if you tried engclient_cmd(), not client_cmd().

engclient_cmd() shouldn't print anything to the console.

BFK_GoNER 02-12-2009 18:47

Re: strip_user_weapons works selectively [HLDM]
 
Quote:

Originally Posted by Exolent[jNr] (Post 760631)
He asked if you tried engclient_cmd(), not client_cmd().

engclient_cmd() shouldn't print anything to the console.


Strangely enough, mine does :| Here's the code. Type me_spectate or me_play:

PHP Code:

#include <amxmodx>

new PLUGIN[]="spectate and back"
new AUTHOR[]="me"
new VERSION[]="1.00"

public plugin_init()
{
     
register_plugin(PLUGINVERSIONAUTHOR)
     
register_concmd("me_spectate""X_spect"ADMIN_USER)
     
register_concmd("me_play""X_play"ADMIN_USER)
}

public 
X_spect(idlevelcid)
{
     
engclient_cmd(id"jointeam""0");
     return 
PLUGIN_CONTINUE
}

public 
X_play(idlevelcid)
{
     
engclient_cmd(id"jointeam""1");
     return 
PLUGIN_CONTINUE



BFK_GoNER 02-14-2009 12:56

Re: Unknown command: jointeam [HLDM]
 
Ok, let's rephrase the question. In HLDM, to spectate you have to type "spectate" in console. My question is: what do you type to go back into the game??

Some people already told me that I just have to press Enter and choose a team, but then I'm still getting the Unknown command: jointeam error.
Has anyone encountered this problem before?? It's really frustrating..


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

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