Raised This Month: $ Target: $400
 0% 

Whats is better?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-24-2011 , 21:39   Whats is better?
#1

Please, explain what is better script (Remember: the plugins have the same function).

cvar: pug_warmup is created by other plugin

PHP Code:
public CHECAR()
{
get_players(USERS,TRs,"e","TERRORIST")
get_players(USERS,CTs,"e","CT")
TOTAL get_playersnum()

new 
WARMUP get_cvar_num("pug_warmup")

if(
WARMUP == 1)
return 
PLUGIN_HANDLED

else if(WARMUP == && TOTAL <= MINIMOGH)
{
client_print(0,3,"%s Faltam %d jogadores para continuar. (Reiniciando em %d segundos)",HEADER,(10 TOTAL),TEMPO)
set_task(float(TEMPO),"RESTART")
return 
PLUGIN_HANDLED
}
else if(
WARMUP == && TRs <= MINIMO)
{
client_print(0,3,"%s Reiniciando sistema em %d segundos. (Faltando: %d TRs - %d CTs)",HEADER,TEMPO,(TRs),(CTs))
set_task(float(TEMPO),"RESTART")
return 
PLUGIN_HANDLED
}
else if(
WARMUP == && CTs <= MINIMO)
{
client_print(0,3,"%s Reiniciando sistema em %d segundos. (Faltando: %d TRs - %d CTs)",HEADER,TEMPO,(TRs),(CTs))
set_task(float(TEMPO),"RESTART")
return 
PLUGIN_HANDLED
}
return 
PLUGIN_HANDLED

Or:

PHP Code:
public CHECAR()
{
get_players(USERS,TRs,"e","TERRORIST")
get_players(USERS,CTs,"e","CT")
TOTAL get_playersnum()

new 
WARMUP get_cvar_num("pug_warmup")

switch(
WARMUP)
{
case 
0:
{
if(
TRs <= MINIMO)
{
client_print(0,3,"%s Reiniciando sistema em %d segundos. (Faltando: %d TRs - %d CTs)",HEADER,TEMPO,(TRs),(CTs))
set_task(float(TEMPO),"RESTART")
return 
PLUGIN_HANDLED
}
else if(
CTs <= MINIMO)
{
client_print(0,3,"%s Reiniciando sistema em %d segundos. (Faltando: %d TRs - %d CTs)",HEADER,TEMPO,(TRs),(CTs))
set_task(float(TEMPO),"RESTART")
return 
PLUGIN_HANDLED
}
}
case 
1:
{
return 
PLUGIN_HANDLED
}
case 
2:
{
if(
TOTAL <= MINIMOGH)
{
client_print(0,3,"%s Faltam %d jogadores para continuar. (Reiniciando em %d segundos)",HEADER,(10 TOTAL),TEMPO)
set_task(float(TEMPO),"RESTART")
return 
PLUGIN_HANDLED
}
}
}
return 
PLUGIN_HANDLED

Ps. If it is not no, explain more
The beginning of the code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define HEADER "[PUG]"

new USERS[32],TRs,CTs,TOTAL
new MINIMO 3
new MINIMOGH 5
new TEMPO 10

public plugin_init()
{
register_plugin("Minplayers",AMXX_VERSION_STR ,"SmileY")
register_logevent("CHECAR",2,"1=Round_Start")
}

public 
RESTART()
{
server_cmd("pug_votemap_enabled 1")
     
set_cvar_num("pug_votemap",1)
      
server_cmd("restart")

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ConnorMcLeod; 03-25-2011 at 03:11.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
 



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 14:34.


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