Raised This Month: $ Target: $400
 0% 

[Help] half_rounds and then only count until 16 Score


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
jppmarujo
Junior Member
Join Date: Nov 2011
Location: Portugal
Old 11-22-2011 , 13:21   [Help] half_rounds and then only count until 16 Score
Reply With Quote #1

Hey there guys,

So, i'm really new in scripting, i've been spending the last 5 days reading about pawn, AMX Mod X scripting and the tutorials available in here, and i'm starting to understand source files of some basic plugins.

So, i'm trying to edit this plugin: https://sourcemod.net/showthread.php?t=90898

What happens in that plugin is that it switches teams based on the number of rounds we want to make a half. So, i want the first half of the 'game' to be played within 15 rounds (for example: CT Team score: 9 ; T Team score: 6).

After that, and here it is the problem, i want it to be played until any of the teams reaches, first, the score 16 (which means, in the example above, that the CT team have to score 7 more rounds or the T Team has to score 10 more rounds).

But the plugin is defined for, after team switches, play the same number of rounds that we define has half (being that: if i define it to 15 rounds, it switches the teams, and then they have to play 15 MORE rounds).

The code that i'm editing is here:

PHP Code:
//This is a try of editing a plugin to make
//my first plugin

#include <amxmodx>
#include <cstrike>

new half_roundsrounds_countround_left
new enableMaxplayerslive

new TEAM_T[] = "Terrorist"
new TEAM_CT[] = "Counter-Terrorist"

public plugin_init() 
{
    
register_plugin("PCW on Public Server""1.0""jppmarujo")
    
    
enable register_cvar("pcw_on","1")
    
half_rounds register_cvar("pcw_half_rounds","15")
    
live register_cvar("pcw_live","1")
    
    
    
Maxplayers get_maxplayers();
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_event("TextMsg""Event_TextMsg""a""2&#Game_C""2=#Game_will_restart_in")
    
register_event("SendAudio""event_round_end""a""2&%!MRAD_terwin""2&%!MRAD_ctwin""2&%!MRAD_rounddraw"
}

public 
event_round_start()
{
    if(
get_pcvar_num(enable)==1)
    {
    
client_print(0print_chat"rounds"rounds_countget_pcvar_num(half_rounds))

set_cvar_num("mp_maxrounds"get_pcvar_num(half_rounds)*2
I'm sorry for the text being so long and not saying almost anything, but as i stated, i'm only starting. SO, i'm guessing the last line of code is saying to set the mp_maxrounds like half_rounds X 2 , right? But that's not what i want, and i can't find a way to set the finish to when team reaches 16 SCORE and not 15 more rounds.

I'm stuck here. I thank you in advance for your help.

Last edited by jppmarujo; 11-22-2011 at 13:23.
jppmarujo is offline
 



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 08:30.


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