Raised This Month: $ Target: $400
 0% 

get player specific id's


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
desert
Junior Member
Join Date: Jan 2006
Location: Canada
Old 10-06-2006 , 14:29   get player specific id's
Reply With Quote #1

I need a way to get a players specific ID. would their be a native for it or would it be a couple commands formed together to get it?
desert is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-06-2006 , 14:34   Re: get player specific id's
Reply With Quote #2

Their userid (ie: kick #123), their steamid (ie: STEAM_0:1:123456), their player index (1-32) from their name, or something else? You need to be a little bit more clear please.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
desert
Junior Member
Join Date: Jan 2006
Location: Canada
Old 10-06-2006 , 14:51   Re: get player specific id's
Reply With Quote #3

player index. im trying to gain each players specific index this way when they type a command for a client command it only acts for them. Lemme add my coding this way i can explain it better. Where i need the help is in the Antidote section where it only works for CT Team Members. And only the specific player who calls upon it.
desert is offline
desert
Junior Member
Join Date: Jan 2006
Location: Canada
Old 10-06-2006 , 14:52   Re: get player specific id's
Reply With Quote #4

Code:
  public antidote (id) {         new ANTIDOTE = 50         new playerMoney         new playerHealth         new newPlayerHealth         new minHealth         new userid                 userid = get_user_userid(id)                 minHealth = 50         playerHealth = get_user_health (userid)         newPlayerHealth = (playerHealth + ANTIDOTE)         playerMoney = cs_get_user_money (userid)                         if(playerHealth <= minHealth)         {             if (get_cvar_num("amx_antidote") <= playerMoney)             {                   set_user_health(userid,newPlayerHealth)             cs_set_user_money(userid,playerMoney - get_cvar_num("amx_antidote"),1)             client_print(userid,print_chat,"[REO] You Have Bought The T-Virus Antidote")             }             else if (get_cvar_num("amx_antidote") > playerMoney)             {                   client_print(userid,print_chat,"[REO] You Don't Have Enough for Antitdote")             }         }                 if (playerHealth >= minHealth)         {               client_print(userid,print_chat,"[REO] You Aren't Infected")         } }

Last edited by desert; 10-06-2006 at 15:05.
desert is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-06-2006 , 14:52   Re: get player specific id's
Reply With Quote #5

Code:
// AMXModX is using the Players Ent-IDs (From 1 to 32) to do Stuff with Players. new authid[32] get_user_authid(id,authid,31) // Will print Players STEAM_ID to variable 'authid' (For example: STEAM_0:1:23456) new userid=get_user_userid(id) // Will write Players User_ID to variable 'userid' (userid>=1)
__________________
EAT YOUR VEGGIES
Silencer123 is offline
desert
Junior Member
Join Date: Jan 2006
Location: Canada
Old 10-06-2006 , 14:56   Re: get player specific id's
Reply With Quote #6

would that be using it correctly?

Last edited by desert; 10-06-2006 at 15:05.
desert is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-06-2006 , 16:56   Re: get player specific id's
Reply With Quote #7

No.
Did you never ask yourself why you have this "(id)" behind your public Function?
For example, if a Player says the Command to call that Function, the "(id)" means:
"Create a new variable called "id"". Would be the same as "new id". But:
The variable is created in a special way: In brackets behind the Function.
This tells AMXX: In this Variable write the Data that comes with the fact,
that a Player used this Command: His ID. This ID goes from 1 to 32. So,
do not use userid. Use id. These public Functions can have Tons of Parameters
behind them in Brackets! Also, you can call a Function inside a Function.
Code:
public function_a(id,bla,blupp,hello) {     function_b(id,bla,blupp,hello) }   public function_b(asd,gogo,gaga,dingdong) {     // The id from function_a is = asd here in function_b     // The bla from function_a is = gogo here in function_b     // The blupp from function_a is = gaga here in function_b     // The hello from function_a is = dingdong here in function_b }
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 10-06-2006 at 17:01.
Silencer123 is offline
desert
Junior Member
Join Date: Jan 2006
Location: Canada
Old 10-06-2006 , 22:46   Re: get player specific id's
Reply With Quote #8

Iight Thanks Man.
desert 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 04:55.


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