AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   2 commands - work together (https://forums.alliedmods.net/showthread.php?t=17322)

Obbin 08-29-2005 14:49

2 commands - work together
 
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!

Hawk552 08-29-2005 14:57

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 }

Obbin 08-29-2005 16:04

it onley says "client width that name or userid nor found" every time (trying to set myself as amx_target)

Hawk552 08-29-2005 16:35

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

should be:

Code:
read_argv(1,arg,31)

Sorry.

Obbin 08-29-2005 16:41

thx hawk :D
You are my cliff!

Hawk552 08-29-2005 16:42

"cliff"?

XxAvalanchexX 08-29-2005 17:15

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.


All times are GMT -4. The time now is 14:18.

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