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_rounds, rounds_count, round_left
new enable, Maxplayers, live
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(0, print_chat, "rounds", rounds_count, get_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.