Advanced Spectate

Cadet
  Avatar utilizator
Admin Server
Mesaje: 6
Membru din: Dum Ian 13, 2019 7:32 pm
Localitate: Arad
Contact:

Advanced Spectate

Mesaj de Cadet » Dum Ian 13, 2019 9:46 pm

Descriere: Permite jucatorilor sa se mute la spectatori prin comanda /back ,dupa care se pot intoarce la echipa la care au fost inainte cu scorul care il aveau cand au scris /back.Daca jucatorul sta mai mult de X minute(se poate modifica prin cvar) la spectatori il transfera automat la echipa la care a fost inainte cu scorul care il aveau cand a scris /back

Descarcare: -
Nume: Advanced Spectate
Versiune: 2.0
Autor: sPuf ?,D3luxe,LOL

Instalare:
1. Fisierul nume_plugin.sma il puneti in addons/amxmodx/scripting
2. Fisierul nume_plugin.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Code:
nume_plugin.amxx


Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
spec_time <numar de minute> - cate minute sa poata sta jucatorul la spectatori.
admin_imm <0/1> - daca e setat pe 1 atunci admini care au flagul x(setati flagul din sursa) nu au limita de stat la spec

Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
/spec - te muta la spectatori
/back - te muta inapoi la echipa la care ai fost
/ct - te muta la echipa CT
/t - te muta la echipa T

Daca vreti sa scoateti comenzile /t si /ct puneti // in fata #define CT_T

Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- Cstrike
- Fun

Sursa:
Spoiler:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >
#include < fun >

static const PLUGIN_NAME[] = "Advanced Spectate";
static const PLUGIN_AUTHOR[] = "sPuf ? || D3luxe || LOL";
static const PLUGIN_VERSION[] = "2.0";

new gReturn[33],gDeaths[33],gFrags[33],gDeaths2[33],gFrags2[33],gDeaths3[33],gFrags3[33],nr_min,g_imm;

//|---------------------------Numele Echipelor--------------------------------------------------|

new const TEAM_CT[] = "Anti-Furien"
new const TEAM_T[] = "Furien"

//|---------------------------------------------------------------------------------------------|


//|---------------------------Prefix-ul care apare la inceputul tuturor mesajelor din chat------|

new const Prefix[] = "!t[FURIEN]!n"

//|---------------------------------------------------------------------------------------------|



//|------------------Flag-ul adminului care nu are limita de stat la spec-----------------------|

#define FLAG_ADMIN ADMIN_IMMUNITY

//|---------------------------------------------------------------------------------------------|



//|----------------------Lasa-ti asa daca doriti comenzile "/t" , "/ct"-------------------------|
//|---------------------Adaugati // daca vreti sa scoateti comenzile "/t" , "/ct"---------------|

#define CT_T

//|---------------------------------------------------------------------------------------------|


public plugin_init() {
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

nr_min = register_cvar("spec_time","3");
g_imm = register_cvar("admin_imm","1");

register_clcmd("say /spec","saySpec");
register_clcmd("say_team /spec","saySpec");

register_clcmd("say /back","sayBack");
register_clcmd("say_team /back","sayBack");


#if defined CT_T
register_clcmd("say /ct","sayct");
register_clcmd("say_team /ct","sayct");

register_clcmd("say /t","sayt");
register_clcmd("say_team /t","sayt");
#endif

}

public saySpec(id) {
new team = get_user_team(id);
switch(team) {
case 1: {
gReturn[id] = 1;
}
case 2: {
gReturn[id] = 2;
}
case 3: {
ColorChat(id, "!t[FURIEN]!nEsti deja la !tSpectatori !g!");
}
}
gFrags[id] = get_user_frags(id);
gDeaths[id] = get_user_deaths(id);
if(is_user_alive(id)) {
user_silentkill(id);
}
cs_set_user_team(id,3);
ColorChat(id, "%sAi fost transferat la !tSpectatori !g! ", Prefix);
ColorChat(id, "%sFoloseste comanda !t/back !npentru a reveni la fosta echipa !g!", Prefix);
if(get_pcvar_num(g_imm) == 1){
if ( !(get_user_flags(id) & FLAG_ADMIN)){
ColorChat(id, "%sDupa!t %d !nminute vei fi transferat automat la fosta echipa !g!", Prefix, get_pcvar_num(nr_min));
set_task(get_pcvar_float(nr_min)*60.0,"sayBack",id);
}
}else if(get_pcvar_num(g_imm) == 0){
ColorChat(id, "%sDupa!t %d !nminute vei fi transferat automat la fosta echipa !g!", Prefix, get_pcvar_num(nr_min));
set_task(get_pcvar_float(nr_min)*60.0,"sayBack",id)
}
return PLUGIN_CONTINUE;
}
public sayBack(id) {
if(!(get_user_team(id) == 3)) {
ColorChat(id, "%sPoti folosi comanda!t /back !ndoar daca esti la !tSpectatori !g!", Prefix);
ColorChat(id, "%sFoloseste comanda!t /spec !npentru a fi transferat la !tSpectatori !g!", Prefix);
return PLUGIN_HANDLED;
} else {
switch(gReturn[id]) {
case 1: {
cs_set_user_team(id,1);
ColorChat(id, "%sAi fost transferat inapoi la echipa!t %s !g!", Prefix, TEAM_T);
cs_set_user_deaths(id, gDeaths[id]);
set_user_frags(id, gFrags[id]);
}
case 2: {
cs_set_user_team(id,2);
ColorChat(id, "%sAi fost transferat inapoi la echipa!t %s !g!", Prefix, TEAM_CT);
cs_set_user_deaths(id, gDeaths[id]);
set_user_frags(id, gFrags[id]);
}
}
}
return PLUGIN_CONTINUE;
}
#if defined CT_T
public sayt(id) {
if(is_user_connected(id)){
if ( cs_get_user_team(id) == CS_TEAM_T )
{
ColorChat(id, "%sEsti deja la echipa!t %s !g!", Prefix, TEAM_T);

}else{
gFrags2[id] = get_user_frags(id);
gDeaths2[id] = get_user_deaths(id);
if(is_user_alive(id)) {
user_silentkill(id);
}
cs_set_user_team(id,1);
set_user_frags(id, gFrags2[id]);
cs_set_user_deaths(id, gDeaths2[id]);
ColorChat(id, "%sAi fost transferat la echipa!t %s !g!", Prefix, TEAM_T);
}
}
return PLUGIN_CONTINUE;
}

public sayct(id) {

if(is_user_connected(id)){
if ( cs_get_user_team(id) == CS_TEAM_CT )
{
ColorChat(id, "%sEsti deja la echipa!t %s !g!", Prefix, TEAM_CT);
}else{
gFrags3[id] = get_user_frags(id);
gDeaths3[id] = get_user_deaths(id);
if(is_user_alive(id)) {
user_silentkill(id);
}
cs_set_user_team(id,2);
set_user_frags(id, gFrags3[id]);
cs_set_user_deaths(id, gDeaths3[id]);
ColorChat(id, "%sAi fost transferat la echipa!t %s !g!", Prefix, TEAM_CT)
}
}
return PLUGIN_CONTINUE;
}
#endif
public client_putinserver(id) {
gDeaths[id] = 0;
gFrags[id] = 0;
gReturn[id] = 0;
}
public client_disconnect(id) {
gDeaths[id] = 0;
gFrags[id] = 0;
gReturn[id] = 0;
}
stock ColorChat(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!n", "^1")
replace_all(msg, 190, "!t", "^3")

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
write_byte(players);
write_string(msg);
message_end();
}
}
}
}
M!CuTzu
  Avatar utilizator
Admin Server
Mesaje: 22
Membru din: Joi Dec 20, 2018 12:37 pm

Re: Advanced Spectate

Mesaj de M!CuTzu » Lun Ian 14, 2019 3:16 pm

e cat de cat buna propunerea..dar am maia vut pluginul asta pe server doar ca scriai /spec ,/t , /ct si te transfera la echipa/spectatori
PRO
Scrie răspuns

Înapoi la “AmxModX Plugins”