Raised This Month: $51 Target: $400
 12% 

Solved return Plugin_Stop without breaking loop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
djvx
Junior Member
Join Date: Sep 2019
Old 10-05-2019 , 07:24   return Plugin_Stop without breaking loop
Reply With Quote #1

As the title states, is there any creative ways of working around this?

What I'm trying to achieve is

PHP Code:
for (int vicinityClient 1vicinityClient <= MaxClientsvicinityClient++) 
{
  ..
  ..
  
  if (
clientToVicinityClientDistance 750
  {
    return 
Plugin_Continue;
  } 
  else 
  {
    return 
Plugin_Stop;
  }

The for-loop breaks before finding the victim since it has to iterate and search against TR entity.

Last edited by djvx; 10-05-2019 at 09:53.
djvx is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 10-05-2019 , 07:57   Re: return Plugin_Stop without breaking loop
Reply With Quote #2

PHP Code:
for (int vicinityClient 1vicinityClient <= MaxClientsvicinityClient++) 
{
  ..
  ..
  
  if (
clientToVicinityClientDistance 750
  {
    continue;
  } 
  else 
  {
    break;
  }

__________________
8guawong is offline
djvx
Junior Member
Join Date: Sep 2019
Old 10-05-2019 , 08:00   Re: return Plugin_Stop without breaking loop
Reply With Quote #3

Quote:
Originally Posted by 8guawong View Post
PHP Code:
for (int vicinityClient 1vicinityClient <= MaxClientsvicinityClient++) 
{
  ..
  ..
  
  if (
clientToVicinityClientDistance 750
  {
    continue;
  } 
  else 
  {
    break;
  }

That works? I'm hooking it to tempent in this case, to block off entity when the criteria meets
djvx is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 10-05-2019 , 08:41   Re: return Plugin_Stop without breaking loop
Reply With Quote #4

Quote:
Originally Posted by djvx View Post
That works? I'm hooking it to tempent in this case, to block off entity when the criteria meets
try it
__________________
8guawong is offline
djvx
Junior Member
Join Date: Sep 2019
Old 10-05-2019 , 09:53   Re: return Plugin_Stop without breaking loop
Reply With Quote #5

Looks good so far! Thanks a lot!
djvx is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:25.


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