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

[EDIT] Roundsleft


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 05-17-2010 , 13:22   [EDIT] Roundsleft
Reply With Quote #1

well i have this code it shows roundsleft but can anyone make that when 0 rounds left insted of showng "0 rounds left"(it's difrent in my lang) to show
"Ovo je zadnja Runda"

Code:
#include <amxmodx>

#define PLUGIN "Rounds Left"
#define VERSION "1.0"
#define AUTHOR "Kimi"

new g_roundnum;
new gRoundsNum;
new roundLeft;

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("SendAudio", "roundend", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw")
    register_event("HLTV", "EventNewRound", "a", "1=0", "2=0");
    register_event("TextMsg", "EventRestartAttempt", "a", "2=#Game_will_restart_in");
    register_clcmd("say timeleft", "displayrounds", ADMIN_ALL, "")
    register_clcmd("say_team timeleft", "displayrounds", ADMIN_ALL, "")
    register_clcmd("say /timeleft", "displayrounds", ADMIN_ALL, "")
    register_clcmd("say_team /timeleft", "displayrounds", ADMIN_ALL, "")
    register_clcmd("say /roundsleft", "displayrounds", ADMIN_ALL, "")
}

public roundend() 
{
    ++g_roundnum
}

public EventNewRound()
{
    gRoundsNum += 1;
}

public displayrounds(id) 
{
    new g_roundnum;
    g_roundnum = get_cvar_num("mp_maxrounds")
    roundLeft = g_roundnum -= gRoundsNum;
    
    //client_print(id, print_chat,"[NPG]: %i rundi preostalo.",roundLeft)
    // ^x04 == green
    // ^x03 == team color
    
    new text[100]
    format(text,99,"^x04 [NPG]: %i rundi preostalo.",roundLeft) //green
    // format(text,99,"^x03 [NPG]: %i rundi preostalo.",roundLeft) // team color
    print_message(id,text)    
}

public EventRestartAttempt()
{
    gRoundsNum = 0;
    roundLeft = g_roundnum;
}

print_message(id, msg[]) {
    message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
    write_byte(id)
    write_string(msg)
    message_end()
}
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-17-2010 , 13:44   Re: [EDIT] Roundsleft
Reply With Quote #2

Code:
    new text[100]
    format(text,99,"^x04 [NPG]: %i rundi preostalo.",roundLeft) //green
    // format(text,99,"^x03 [NPG]: %i rundi preostalo.",roundLeft) // team color
    print_message(id,text)

Code:
    new text[100]
    if(roundLeft)
        formatex(text,99,"^x04 [NPG]: %i rundi preostalo.",roundLeft) //green
        // formatex(text,99,"^x03 [NPG]: %i rundi preostalo.",roundLeft) // team color
    else
        copy(text,99,"^x04 [NPG]: Ovo je zadnja Runda.") // green
        // copy(text,99,"^x03 [NPG]: Ovo je zadnja Runda.") // team
    print_message(id,text)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 05-17-2010 , 13:56   Re: [EDIT] Roundsleft
Reply With Quote #3

thanks very much
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 05-26-2010 , 15:17   Re: [EDIT] Roundsleft
Reply With Quote #4

There is Huge bug sometimes insted of changing map when last round Plugin continues to count and Go's in minus like "-1 -2 rounds left" And map stays until Admin changes it
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
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 19:47.


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