Quote:
Originally Posted by epic .
Code:
public plugin_init()
{
register_srvcmd("bot","bot_interface")
}
public bot_interface()
{
new sid[8],id
read_argv(1,sid,7)
id = str_to_num(sid)
A_function(id)
return PLUGIN_CONTINUE
}
What does the "id" means here ?
|
Quote:
Originally Posted by wrecked_
It's a player index. For example, if sid was equal to "27", id would be 27. It converts the string to a number and stores the numerical value in id.
|
You are assuming the first argument is a player id because he used the variable name "id". But, infact, it will be what ever string is passed as the first argument of the server command that which is then converted to a integer. So, if you type in
id will be 12325434 which definitely is not a player id.
__________________