AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   question about id (https://forums.alliedmods.net/showthread.php?t=45709)

teamo@am 10-09-2006 19:37

question about id
 
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 :wink: )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.:up:

Hawk552 10-09-2006 20:00

Re: question about id
 
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(...)

teamo@am 10-10-2006 00:24

Re: question about id
 
Quote:

Originally Posted by Hawk552 (Post 389317)
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.:oops:

Zenith77 10-10-2006 12:25

Re: question about id
 
The server console or rcon.

teamo@am 10-10-2006 19:43

Re: question about id
 
Quote:

Originally Posted by Zenith77 (Post 389558)
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:oops:

Hawk552 10-10-2006 19:44

Re: question about id
 
Quote:

Originally Posted by teamo@am (Post 389707)
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:oops:

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.


All times are GMT -4. The time now is 04:51.

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