Raised This Month: $ Target: $400
 0% 

question about id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teamo@am
Junior Member
Join Date: Oct 2006
Old 10-09-2006 , 19:37   question about id
Reply With Quote #1

Hi all,im new here and new to scripting CS plugins.
These days i've read nealy all the tech articles and tutorials the wiki have.I want to know if we must take a "id" parameter when we ourselves define a user function which would be called from the console?(such as te_showsomthing(id)) Somebody in Intro to AMX Mod X Scripting (maybe bailopan )said "These parameters will hold special data when the command is used - id will hold the player's id who started the command",which means the id parameter is a must? reaally appreciate your detailed explanation.
teamo@am is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-09-2006 , 20:00   Re: question about id
Reply With Quote #2

when it's called from console, the id is 0

if you want to do something like print a message back, you have to check if(!id) or something to that effect and then do server_print(...)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
teamo@am
Junior Member
Join Date: Oct 2006
Old 10-10-2006 , 00:24   Re: question about id
Reply With Quote #3

Quote:
Originally Posted by Hawk552 View Post
when it's called from console, the id is 0
why 0?i think the id represent the player called the func and nobody's id is 0 imo.
teamo@am is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-10-2006 , 12:25   Re: question about id
Reply With Quote #4

The server console or rcon.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
teamo@am
Junior Member
Join Date: Oct 2006
Old 10-10-2006 , 19:43   Re: question about id
Reply With Quote #5

Quote:
Originally Posted by Zenith77 View Post
The server console or rcon.
Roger That! Then what about players dont have the access to admin?in other words,if it will be any other numbers than 0,and when(when the cmd is used by normal players from the console?)Be patient of my ignorance,thx alot
teamo@am is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-10-2006 , 19:44   Re: question about id
Reply With Quote #6

Quote:
Originally Posted by teamo@am View Post
Roger That! Then what about players dont have the access to admin?in other words,if it will be any other numbers than 0,and when(when the cmd is used by normal players from the console?)Be patient of my ignorance,thx alot
That's why you check their access using cmd_access or get_user_flags. It'll still give you their id even if they don't have access to it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 04:51.


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