Invalid player 0 ??
i keep getting this
Code:
L 09/23/2005 - 22:41:39: Invalid player id 0i think it may because its in public client_prethink? and i just now added the 0 parameter to get_user_origin so dont if thats it either :/ Code:
|
if(!is_user_connected(i)) {
return PLUGIN_HANDLED } Player 0 is the server. i is getting all of the players, including the server. |
Even better dont start with "new i = 0" use "new i = 1"
0 refers to the server so dont check that as a player. |
for( new i = 0; i <get_maxplayers(); i++)
should be for( new i = 1; i <=get_maxplayers(); i++) |
umm ok...i added that and if id == 1 but it doesnt work. I tried changing return PLUGIN_CONTINUE to just continue but it still doesnt work....
this is what i have right now btw, testing this with bots so dont know if thats the prob Code:
|
Quote:
|
EDIT: nm works great :)
|
Well there are some things that you did that you shouldn't do. Yes it may work but its really improper.
You should use Code:
Reasons. 1) Dont call get_maxplayers() in a for loop. It just requires that that function be called ever iteration. 2) This is much more precise. It wont be called for an id of a player that is not in the server. And doesnt require an if statement after the for loop. |
| All times are GMT -4. The time now is 07:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.