Raised This Month: $ Target: $400
 0% 

2 commands - work together


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-29-2005 , 14:49   2 commands - work together
Reply With Quote #1

how do i make two functions work together?

example:

func no.1(amx_sayer)
choose an player by nick or steamid and set him as "the sayer"


func no.2(amx_sws)
when an admin types amx_sws <something> the choosen player ("the sayer") says "<something>"

plz give an snippet!
__________________
Sig(h)!
Obbin is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-29-2005 , 14:57  
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> new player public plugin_init() {     register_plugin("test","1.0","Hawk552")     register_concmd("amx_target","test",ADMIN_KICK,"<user> - lol internet")     register_concmd("amx_execute","execute",ADMIN_KICK,"<lol> - internet") } public test(id,level,cid) {     if(!cmd_access(id,level,cid,2))     {         return PLUGIN_HANDLED     }         new arg[32]     read_argv(2,arg,31)     player = cmd_target(id,arg,1)         return PLUGIN_HANDLED } public execute(id,level,cid) {     if(!cmd_access(id,level,cid,2))     {         return PLUGIN_HANDLED     }         new arg[32]     read_argv(2,arg,31)         remove_quotes(arg)         client_cmd(player,arg)         return PLUGIN_HANDLED }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-29-2005 , 16:04  
Reply With Quote #3

it onley says "client width that name or userid nor found" every time (trying to set myself as amx_target)
__________________
Sig(h)!
Obbin is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-29-2005 , 16:35  
Reply With Quote #4

These commands:
Code:
read_argv(2,arg,31)

should be:

Code:
read_argv(1,arg,31)

Sorry.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-29-2005 , 16:41  
Reply With Quote #5

thx hawk
You are my cliff!
__________________
Sig(h)!
Obbin is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-29-2005 , 16:42  
Reply With Quote #6

"cliff"?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-29-2005 , 17:15  
Reply With Quote #7

Keep in mind that admin A may set it to player F, afterwards admin B sets it to player C, and when admin A uses the command it will execute on player C instead of player F because there is only one player stored instead of one for each admin.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply


Thread Tools
Display Modes

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:18.


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