Raised This Month: $ Target: $400
 0% 

1 func choosing, 1 func using


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-28-2005 , 16:41   1 func choosing, 1 func using
Reply With Quote #1

How to make one function that chooses an player (nick/steamid), and one function that uses an function width that player?

example (console):

amx_choose Obbin
[AMXx] You choosen Obbin!
amx_chooseexec "say AMXx owns"
Obbin: AMXx owns
__________________
Sig(h)!
Obbin is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-28-2005 , 16:56  
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("AMXX Choose","1.0","Hawk552")     register_concmd("amx_choose","choose",ADMIN_BAN," <player> - chooses the player to say 'AMXX Owns'") } public choose(id,level,cid) {     if(!cmd_access(id,level,cid,2))     {         return PLUGIN_HANDLED     }         new arg[32]     read_argv(1,arg,31)     new target = cmd_target(id,arg,1)         if(!target)     {         return PLUGIN_HANDLED     }         client_cmd(target,"say AMXX Owns!")         return PLUGIN_HANDLED }

EDIT: Use Exec 2 by v3x, it's a lot better.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-28-2005 , 17:02  
Reply With Quote #3

WRONG ^^^

lastfunction(id) {
function(id,informationfromlastfunction)
}

function(id,informationfromlastfunction) {
client_print(0,print_chat,informationfromlast function)
}
pdoubleopdawg is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-28-2005 , 20:35  
Reply With Quote #4

In the first function store the player's id in a variable, in the second function use the stored player's id.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-29-2005 , 02:40  
Reply With Quote #5

thx avalanche!
__________________
Sig(h)!
Obbin is offline
darkcloud9sgl
Member
Join Date: Dec 2004
Old 08-29-2005 , 08:08  
Reply With Quote #6

wow nice job avalanche
darkcloud9sgl is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-29-2005 , 11:31  
Reply With Quote #7

hmm. when i create an variable in one func and then uses it in 'nother func compiler says "unidentifined sypbol"
__________________
Sig(h)!
Obbin is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-29-2005 , 13:25  
Reply With Quote #8

Code? ;]
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-29-2005 , 14:04  
Reply With Quote #9

Make a global var not one in the first function
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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:26.


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