Raised This Month: $ Target: $400
 0% 

Help Me With My Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Poison_Jay
Senior Member
Join Date: May 2004
Old 07-12-2004 , 05:04   Help Me With My Plugin
Reply With Quote #1

Code:
/* AMX Mod X Script *   *  Transfer Plugin *  By: Poison_Jay * *  Transfer People By Amx_Transfer NICK TEAM */ #include <amxmodx> #include <amxmisc> public plugin_init() {    register_plugin("Transfer Team","0.1","Poison_Jay")    register_concmd("amx_transfer","cmdtransfer", ADMIN_KICK,    return PLUGIN_CONTINUE } public cmdtransfer(id, level, cid) {    if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED    new arg[32]    read_argv(1, arg, 31)    new player = cmd_target(id, arg, 2)    if (player != 0) client_cmd(player, "chooseteam")    if (player != 0) client_cmd(menuselect", "1")    if (player != 0) client_cmd(menuselect", "5")    new authid[32],authid2[32],name2[32],name[32]    get_user_authid(id,authid,31)    get_user_authid(player,authid2,31)    get_user_name(player,name2,31)    get_user_name(id,name,31)    client_print(0,print_chat,"ADMIN %s:%s Has Changed Team To CT",name,name2)    }    return PLUGIN_HANDLED }

there seems to be a major problem, this only transfer u to CT, omfg, i kinda lost now
Poison_Jay is offline
Send a message via MSN to Poison_Jay
[cTs] Strake*ROC*
Member
Join Date: Mar 2004
Old 07-12-2004 , 14:57  
Reply With Quote #2

have to read argument 2 (team)
__________________
[cTs] Strake*ROC* is offline
Blunted1
Senior Member
Join Date: Jun 2004
Old 07-12-2004 , 16:23   Re: Help Me With My Plugin
Reply With Quote #3

Quote:
Originally Posted by Poison_Jay
-CODE-
there seems to be a major problem, this only transfer u to CT, omfg, i kinda lost now
I'm not sure of your problem exactly from what you said.... but it sounds like you are wondering why this will only transfer a player to the CT team....
If that is the problem, the answer is quite simply because that is what you told it to do.

-removed code-

[EDIT]After looking at your code for more than twelve seconds it appears what you may be after is a command that will switch you to the opposite team regardless of which team you are on......
If that is so then you just have to make a check for which team you are on, then if player team is,
Terrorist use....
Code:
if (player != 0) client_cmd("menuselect", "1")
or if CT use...
Code:
if (player != 0) client_cmd("menuselect", "2")

[EDIT2] ignore this for now your plugin seems to have more problems than I anticipated...... is the fact that the person is switched to CT not your main problem by any chance?
Anyways I'll keep looking at it, but dont bother with any of the code I have written here just yet anyways...
Blunted1 is offline
Blunted1
Senior Member
Join Date: Jun 2004
Old 07-12-2004 , 17:11  
Reply With Quote #4

for starters.... now it compiles

Code:
/* AMX Mod X Script *   *  Transfer Plugin *  By: Poison_Jay * *  Transfer People By Amx_Transfer NICK TEAM */ #include <amxmodx> #include <amxmisc> public plugin_init() {    register_plugin("Transfer Team","0.1","Poison_Jay" )    register_concmd("amx_transfer","cmdtransfer", ADMIN_KICK )    return PLUGIN_CONTINUE } public cmdtransfer(id, level, cid) {    if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED    new arg[32]    read_argv(1, arg, 31)    new player = cmd_target(id, arg, 2)    if (player != 0) {    client_cmd(player, "chooseteam")    client_cmd(player, "menuselect", "2")    client_cmd(player, "menuselect", "5")    }    new authid[32],authid2[32],name2[32],name[32]    get_user_authid(id,authid,31)    get_user_authid(player,authid2,31)    get_user_name(player,name2,31)    get_user_name(id,name,31)    client_print(0,print_chat,"ADMIN %s:%s Has Changed Team To CT",name,name2)      return PLUGIN_HANDLED }

... but after testing, it leaves you at the team select screen

[edit] changed "menuselect 1" to "menuselect 2" (as that is actually the CT team and 1 is T )

Still leaves you on the team choose menu though.......
(although you are sucessfully traded to the CT team)


If you want seperate commands for each team and to be left at the choose team menu.... then the rest is simple

Useing a single command and checking which team the player is on to begin with and useing if statements to decide what happens from there, should not be too hard to do at all.

As far as being left on the choose team menu, I have no clue
I only tested on an empty server so that could possibly be the cause, but I am not sure myself.
I am not used to useing client commands to force a person to choose from the team or buy menus and it all looks like it should work to me
(thats how it was written in similar codes anyways)



Why not just use http://forums.alliedmods.net/showthread.php?t=344 ?
Yours - Amx_Transfer NICK TEAM
JGHG - amx_team <player name> <team (t/ct/#)>
seems pretty similar to me
Blunted1 is offline
Poison_Jay
Senior Member
Join Date: May 2004
Old 07-12-2004 , 19:14  
Reply With Quote #5

oh i didn't realise, cuz i searched Team Changer but nothing
Poison_Jay is offline
Send a message via MSN to Poison_Jay
Reply



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 14:40.


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