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

[Solved] How to optimize ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pacheco
Senior Member
Join Date: Jul 2011
Old 07-20-2012 , 13:10   [Solved] How to optimize ?
Reply With Quote #1

How to optimize it:

PHP Code:
[...]
    if(
zp_is_swarm_round())
    return;
    if(
zp_is_plague_round())
    return;
    if(
zp_is_survivor_round())
    return;
    if(
zp_is_nemesis_round())
    return;
    if(
zp_is_lnj_round())
    return;
    if(
zp_is_sniper_round())
    return;
    if(
zp_is_assassin_round())
    return;
[...] 
Attached Files
File Type: sma Get Plugin or Get Source (zp_reviver.sma - 152 views - 885 Bytes)
__________________




Last edited by pacheco; 07-22-2012 at 12:11.
pacheco is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-20-2012 , 13:11   Re: How to optimize ?
Reply With Quote #2

Use || (or).
__________________
<VeCo> is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-20-2012 , 13:18   Re: How to optimize ?
Reply With Quote #3

Use || like Veco tell to you.
Or it's not very optized but you can do that :
Code:
if(zp_is_swarm_round()) return; else if(zp_is_plague_round()) return; else if(zp_is_survivor_round()) return;

What's this ?
CS_TEAM_T <= cs_get_user_team(%0) <= CS_TEAM_CT)
__________________
Pawn ? Useless

Last edited by Aooka; 07-20-2012 at 13:19.
Aooka is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-20-2012 , 13:23   Re: How to optimize ?
Reply With Quote #4

There's no point in else, because return already stops the execution of the code below it.

Quote:
Originally Posted by Aooka View Post
CS_TEAM_T <= cs_get_user_team(%0) <= CS_TEAM_CT)
Macro that checks if the player's team is between T or CT.
__________________
<VeCo> is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-20-2012 , 13:35   Re: How to optimize ?
Reply With Quote #5

Aooka please stop to confuse people, again...
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-20-2012 , 14:25   Re: How to optimize ?
Reply With Quote #6

What do you want to do ? Detect if a zp mod is running or not ?
__________________
micapat is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-20-2012 , 16:12   Re: How to optimize ?
Reply With Quote #7

Quote:
Macro that checks if the player's team is between T or CT.
But what is between it ?
__________________
Pawn ? Useless
Aooka is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-20-2012 , 16:16   Re: How to optimize ?
Reply With Quote #8

Quote:
Originally Posted by Aooka View Post
But what is between it ?
It's <= which means it is smaller than or equal to, so that will check if the team is between T and CT (1 and 2), inclusive, or simply if the team is T or CT (not spectator or unassigned).
__________________
<VeCo> is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-20-2012 , 16:37   Re: How to optimize ?
Reply With Quote #9

Ah okay just that ^^ Thanks a lot Veco.
__________________
Pawn ? Useless
Aooka is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 07-20-2012 , 18:21   Re: How to optimize ?
Reply With Quote #10

I tried || but didn't work. This is one plugin to respawn a player when is normal mode in zombie plague.
If is other mode(game play), the player can't respawn.
__________________



pacheco 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 04:58.


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