[Pawn] too resource-intensive array - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] too resource-intensive array (/showthread.php?tid=392) |
too resource-intensive array - Mark2 - 2019-04-19 I need to create an array(i choosed iterator)?of streamed players for every player. So i got PHP Code: Iterator:StreamedPlayers[MAX_PLAYERS]<MAX_PLAYERS> But it's very?resource-intensive, what?can be used instead or may be i don't know something about streaming players? P.S. I know that i can redefine MAX_PLAYERS to less value but i don't want to do it (1000 default). RE: too resource-intensive array - mr_sacrimoni - 2019-04-20 All streamed players for every player? What do you need to do with it? RE: too resource-intensive array - Mark2 - 2019-04-20 (2019-04-20, 05:55 AM)mr_sacrimoni Wrote: All streamed players for every player? What do you need to do with it?? For identify nearby players?instead checking every player PHP Code: for(new i; i < MAX_PLAYERS; i) PHP Code: foreach(StreamedPlayers[playerid], i) I will use it in OnPlayerText for chat sys RE: too resource-intensive array - Y_Less - 2019-04-20 That array is about 4Mb. I wouldn't worry about it. RE: too resource-intensive array - Markski - 2019-04-20 (2019-04-20, 07:19 AM)Mark2 Wrote: For identify nearby players?instead checking every player Checking every player every single time might seem resource-intensive, but it is not. Honestly might be better than having to deal with initializing and updating the array consistently (which would also NOT be resource intensive either, but will be work intensive) RE: too resource-intensive array - unix - 2019-04-25 You want to a local IC chat about RP servers etc? Just use something like this maybe, no need for that..- Code: public OnPlayerText(playerid, text[]) |