remove single player or single ID
k i have this. getting the players from the server, what i want to know is how i do for remove a single player or id.
i put the players in a menu so when you choose a player remove that player from menu. so if other person open the menu can't select it PHP Code:
PHP Code:
|
Re: remove single player or single ID
Just be careful when setting these indices to 0 if other functions are iterating through and calling functions on these players. If you try to call a function on a 0 player id you will get an error. Before taking action a player in this array, do a if ( iPlayers[ X ] ) check.
If you know the id location in the iPlayers array: PHP Code:
Suppose id is the id of player you want to remove from iPlayers: PHP Code:
|
Re: remove single player or single ID
If you want to remove an index from an array and reduce the size as well, you can do one of two ways:
Code:
|
Re: remove single player or single ID
ok will try the code where i want to applied this is.
where iPlayers and iNum are global variables, PHP Code:
|
Re: remove single player or single ID
get_players retrieves connected players and stores their player id's in the passed array. Now this doesn't mean you will always end up with ids in order. The array, for example, can look like this:
iPlayers[] = { 2 , 3 , 5 , 7 , 10 , 15 } Accessed with index 0 through 5. [ 0=2 , 1=3 , 2=5 , 3=7 , 4=10 , 5=15 ] So with your method, if you try to remove player with id 4, you are really accessing iPlayers[ 4 ] which is actually player id 10. |
Re: remove single player or single ID
uhmm ya, will try it ty the think is that im still doesn't understand this part of code
i know that in other threat i ask the same and some one link another threat with an explain but still with that don't understand it xD. so if is not to much could you? PHP Code:
|
Re: remove single player or single ID
Quote:
PHP Code:
PHP Code:
|
Re: remove single player or single ID
Replace
PHP Code:
PHP Code:
PHP Code:
|
Re: remove single player or single ID
i dont know what more to do! hell T_T
[IMG]http://img53.**************/img53/1530/sinttulouf.th.png[/IMG] as u can see in the image haba was selected by CT cap T cap and again by CT Cap, the player still in the choose menu T_T im stuck PHP Code:
|
Re: remove single player or single ID
show the full plugin
|
| All times are GMT -4. The time now is 08:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.