Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[ROZWIĄZANE] Komenda Spec na Surfa


  • Zamknięty Temat jest zamknięty
21 odpowiedzi w tym temacie

#1 SqNw0w

    Profesjonalista

  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 21.07.2012 02:41

Mam problem z komenda /spec na surf ski 2.
Dokładniej to jak wpisuje /spec to jestem na spec ale zyje i moge bic ct i tt.

proszę o nowy plugin albo naprawienie.

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "Spec/Back"
#define AUTHOR "kramesa"
#define VERSION "v1.1"
new bool:TerroristTeam[33];
new CountTime[33];
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);

        register_clcmd("say /spec", "Spec");
        register_clcmd("say /back", "Back");

        register_cvar("amx_spectimes", "3");
}
public Spec(id)
{
        if(CountTime[id] >= get_cvar_num("amx_spectimes"))
        {
                client_print(id, print_chat, "[AMXX] Sorry, you cant use this command more of %d times.", get_cvar_num("amx_spectimes"));
                return PLUGIN_HANDLED;
        }

        if(cs_get_user_team(id) == CS_TEAM_T)
        {
                TerroristTeam[id] = true;
        }
        else
        {
                TerroristTeam[id] = false;
        }

        if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        {
                client_print(id, print_chat, "[AMXX] You already Spectator.");
                return PLUGIN_HANDLED;
        }
        else
        {
                cs_set_user_team(id, CS_TEAM_SPECTATOR);
                user_kill(id, 1);
                client_print(id, print_chat, "[AMXX] You are now in Spectator.");

                CountTime[id]++;

                return PLUGIN_HANDLED;
        }
        return PLUGIN_HANDLED;
}
public Back(id)
{
        if(cs_get_user_team(id) != CS_TEAM_SPECTATOR)
        {
                client_print(id, print_chat, "[AMXX] You already Non-Spectator.");
                return PLUGIN_HANDLED;
        }

        if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        {
                if(TerroristTeam[id] == true)
                {
                        cs_set_user_team(id, CS_TEAM_T);
                        client_print(id, print_chat, "[AMXX] You are now in Terrorist team.");
                        cs_set_user_deaths(id, 0);
                        ExecuteHam(Ham_CS_RoundRespawn, id);
                        return PLUGIN_HANDLED;
                }

                if(TerroristTeam[id] == false)
                {
                        cs_set_user_team(id, CS_TEAM_CT);
                        client_print(id, print_chat, "[AMXX] You are now in Counter-Terrorist team.");
                        cs_set_user_deaths(id, 0);
                        ExecuteHam(Ham_CS_RoundRespawn, id);
                        return PLUGIN_HANDLED;
                }
        }
        return PLUGIN_HANDLED;
}

Użytkownik SqNw0w edytował ten post 21.07.2012 02:42


#2 GeDox

    Wszechpomocny

  • Użytkownik

Reputacja: 125
Zaawansowany

  • Postów:315
  • Steam:steam
  • Imię:Przemysław
  • Lokalizacja:Kielce
Offline

Napisano 21.07.2012 06:46

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "Spec/Back"
#define AUTHOR "kramesa"
#define VERSION "v1.1"

new CsTeams:UserTeam[33];
new CountTime[33];

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);

register_clcmd("say /spec", "Spec");
register_clcmd("say /back", "Back");

register_cvar("amx_spectimes", "3");
}

public Spec(id)
{
if(CountTime[id] >= get_cvar_num("amx_spectimes"))
{
client_print(id, print_chat, "[AMXX] Sorry, you cant use this command more of %d times.", get_cvar_num("amx_spectimes"));
return PLUGIN_HANDLED;
}

if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
client_print(id, print_chat, "[AMXX] You already Spectator.");
else
{
UserTeam[id] = cs_get_user_team(id);
cs_set_user_team(id, CS_TEAM_SPECTATOR);

if(is_user_alive(id))
user_kill(id, 1);

client_print(id, print_chat, "[AMXX] You are now in Spectator.");

CountTime[id]++;
}

return PLUGIN_HANDLED;
}

public Back(id)
{
if(cs_get_user_team(id) != CS_TEAM_SPECTATOR)
{
client_print(id, print_chat, "[AMXX] You already Non-Spectator.");
return PLUGIN_HANDLED;
}

if(!UserTeam[id])
{
client_print(id, print_chat, "[AMXX] You aren't write /spec.");
return PLUGIN_HANDLED;
}

cs_set_user_team(id, UserTeam[id]);
cs_set_user_deaths(id, 0);
ExecuteHam(Ham_CS_RoundRespawn, id);

if(UserTeam[id] == CS_TEAM_T)
client_print(id, print_chat, "[AMXX] You are now in Terrorist team.");
else if(UserTeam[id] == CS_TEAM_CT)
client_print(id, print_chat, "[AMXX] You are now in Counter-Terrorist team.");

UserTeam[id] = CS_TEAM_UNASSIGNED;

return PLUGIN_HANDLED;
}
Kilka poprawek, sprawdź :)

Użytkownik GeDox edytował ten post 21.07.2012 06:47

  • +
  • -
  • 1

#3 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 21.07.2012 11:15

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "Spec/Back"
#define AUTHOR "kramesa"
#define VERSION "v1.1"

new CsTeams:UserTeam[33];
new CountTime[33];

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);

register_clcmd("say /spec", "Spec");
register_clcmd("say /back", "Back");

register_cvar("amx_spectimes", "3");
}

public Spec(id)
{
if(CountTime[id] >= get_cvar_num("amx_spectimes"))
{
client_print(id, print_chat, "[AMXX] Sorry, you cant use this command more of %d times.", get_cvar_num("amx_spectimes"));
return PLUGIN_HANDLED;
}

if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
client_print(id, print_chat, "[AMXX] You already Spectator.");
else
{
UserTeam[id] = cs_get_user_team(id);
cs_set_user_team(id, CS_TEAM_SPECTATOR);

if(is_user_alive(id))
user_kill(id, 1);

client_print(id, print_chat, "[AMXX] You are now in Spectator.");

CountTime[id]++;
}

return PLUGIN_HANDLED;
}

public Back(id)
{
if(cs_get_user_team(id) != CS_TEAM_SPECTATOR)
{
client_print(id, print_chat, "[AMXX] You already Non-Spectator.");
return PLUGIN_HANDLED;
}

if(!UserTeam[id])
{
client_print(id, print_chat, "[AMXX] You aren't write /spec.");
return PLUGIN_HANDLED;
}

cs_set_user_team(id, UserTeam[id]);
cs_set_user_deaths(id, 0);
ExecuteHam(Ham_CS_RoundRespawn, id);

if(UserTeam[id] == CS_TEAM_T)
client_print(id, print_chat, "[AMXX] You are now in Terrorist team.");
else if(UserTeam[id] == CS_TEAM_CT)
client_print(id, print_chat, "[AMXX] You are now in Counter-Terrorist team.");

UserTeam[id] = CS_TEAM_UNASSIGNED;

return PLUGIN_HANDLED;
}
Kilka poprawek, sprawdź :)



Niestety nie działa. Dalej jak wpisuje /spec to jestem na Spec ale zyje ;/
Dodam iż mam surf + respawn.

Użytkownik SqNw0w edytował ten post 21.07.2012 11:15


#4 GeDox

    Wszechpomocny

  • Użytkownik

Reputacja: 125
Zaawansowany

  • Postów:315
  • Steam:steam
  • Imię:Przemysław
  • Lokalizacja:Kielce
Offline

Napisano 21.07.2012 17:08

To na pewno problem leży przy pluginie z respawnem :P Zapodaj :)
  • +
  • -
  • 0

#5 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 21.07.2012 17:19

proszę:

/* AMXX Mod script.
*
* (c) Copyright 2004, developed by Geesu
* This file is provided as is (no warranties). 
*
* Changelog
* 1.1:
*   Added /respawn command to spawn a player if they're dead
*   Added a public cvar
* 1.0: 
* Pistols are now given to players when they respawn
* sv_checkpistols cvar added, if this is set to 0, then players will always spawn with a pistol, otherwise they will only spawn with a pistol when it is not scoutzknivez and not a ka map
* sv_respawn cvar added, set this to 0 to disable the plugin
*/

new const VERSION[] = "1.1"

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

#define DISABLE_CS 0

// team ids 
#define UNASSIGNED 0 
#define TS 1 
#define CTS 2 
#define AUTO_TEAM 5 

new bool:g_PistolsDisabled = false

public plugin_init(){

register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")

register_event("DeathMsg","on_Death","a")

register_cvar("sv_checkpistols", "1")
register_cvar("sv_respawn", "1")
register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)

register_clcmd("say","on_Chat")
register_clcmd("say_team","on_Chat")
}

public on_Chat(id)
{
if ( !get_cvar_num("sv_respawn") )
{
client_print(id, print_chat, "* Respawn plugin disabled")
return PLUGIN_CONTINUE
}

new szSaid[32]
read_args(szSaid, 31) 

if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^""))
{
spawn_func(id)
}
}

public check_pistols()
{
/* Determine if we should give players a pistol or not */
if ( get_cvar_num("sv_checkpistols") )
{
set_task(1.0, "check_pistols")
new mapname[32]
get_mapname(mapname,31) 
if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
g_PistolsDisabled = true
}
}

public spawn_func(id)
{
new parm[1]
parm[0]=id

/* Spawn the player twice to avoid the HL engine bug */
set_task(0.5,"player_spawn",72,parm,1)
set_task(0.7,"player_spawn",72,parm,1)

/* Then give them a suit and a knife */
set_task(0.9,"player_giveitems",72,parm,1)
}

public on_Death()
{
if ( !get_cvar_num("sv_respawn") )
return PLUGIN_CONTINUE

new victim_id = read_data(2)

spawn_func( victim_id )

return PLUGIN_CONTINUE
}

public player_giveitems(parm[1])
{
new id = parm[0]

give_item(id, "item_suit")
give_item(id, "weapon_knife")

/* Determines if a players should be given a pistol */
if ( !g_PistolsDisabled )
{
new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false 
get_user_weapons(id,wpnList,number)

/* Determine if the player already has a pistol */
for (new i = 0;i < number;i++)
{ 
if (wpnList[i] == CSW_GLOCK18) 
foundGlock = true 
if (wpnList[i] == CSW_USP) 
foundUSP = true 
}

/* Give a T his/her pistol */
if ( get_user_team(id)==TS && !foundGlock )
{
give_item(id,"weapon_glock18")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
}
/* Give a CT his/her pistol */
else if ( get_user_team(id)==CTS && !foundUSP )
{
give_item(id,"weapon_usp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
}
}

return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
spawn(parm[0])
}


#6 Klakier

    Volenti non fit iniuria

  • Power User

Reputacja: 390
Wszechpomocny

  • Postów:878
  • GG:
  • Imię:Sebastian
  • Lokalizacja:Mogilno
Offline

Napisano 22.07.2012 18:37

@up w tym twoim pluginie /respawn poszukaj publica
public spawn_func(id)
usuń go i zamiast niego daj:
public spawn_func(id)
{
new parm[1]
parm[0]=id

if(get_user_team(id) != 3)
{
/* Spawn the player twice to avoid the HL engine bug */
set_task(0.5,"player_spawn",72,parm,1)
set_task(0.7,"player_spawn",72,parm,1)

/* Then give them a suit and a knife */
set_task(0.9,"player_giveitems",72,parm,1)
}
}


tutaj masz plugin na /spec i /back

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>

#define PLUGIN "Spec"
#define AUTHOR "Klakier"
#define VERSION "1.0"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);

register_clcmd("say /spec", "Spec");
register_clcmd("say /back", "back")


}


public Spec(id)
{
if(is_user_connected(id))
{
if (cs_get_user_team(id) != CS_TEAM_SPECTATOR)
{
dllfunc(DLLFunc_ClientKill, id)
cs_set_user_team(id, CS_TEAM_SPECTATOR)
}
}

}
public back(id)
client_cmd(id, "chooseteam")


Powinno grać :D
  • +
  • -
  • 0

Sell - System Klanów (wojny, top15 etc)

 

Kontakt GG: 7285018


#7 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 23.07.2012 02:22

Nie działa... dalej jak wpisuje /spec to jestem na spec i zyje :/

#8 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 25.07.2012 15:27

Ktos jest wstanie pomoc ?

#9 Nenczoks

    Banned

  • Zbanowany

Reputacja: 50
Pomocny

  • Postów:358
  • Lokalizacja:Warszawa
Offline

Napisano 25.07.2012 20:51

@Klakier - fakemeta tu rzeczywiście potrzeba -.-

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "Spec/Back"
#define AUTHOR "kramesa"
#define VERSION "v1.1"

new bool:TerroristTeam[33];
new CountTime[33];

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);

register_clcmd("say /spec", "Spec");
register_clcmd("say /back", "Back");

}
public Spec(id)
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
TerroristTeam[id] = true;
}
else
{
TerroristTeam[id] = false;
}

if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
{
client_print(id, print_chat, "Jestes na spekcie!");
return PLUGIN_HANDLED;
}
else
{
cs_set_user_team(id, CS_TEAM_SPECTATOR);
user_kill(id, 1);
client_print(id, print_chat, "Zostales przeniesiony na spect!");

CountTime[id]++;

return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public Back(id)
{
if(cs_get_user_team(id) != CS_TEAM_SPECTATOR)
{
client_print(id, print_chat, "Nie jestes na spekcie");
return PLUGIN_HANDLED;
}

if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
{
if(TerroristTeam[id] == true)
{
cs_set_user_team(id, CS_TEAM_T);
client_print(id, print_chat, "Jestes znowu w TT");
cs_set_user_deaths(id, 0);
ExecuteHamB(Ham_CS_RoundRespawn, id);
return PLUGIN_HANDLED;
} else {
cs_set_user_team(id, CS_TEAM_CT);
client_print(id, print_chat, "Jestes znowu w CT");
cs_set_user_deaths(id, 0);
ExecuteHamB(Ham_CS_RoundRespawn, id);
return PLUGIN_HANDLED;
}
}
return PLUGIN_HANDLED;
}

Użytkownik Nenczoks edytował ten post 25.07.2012 20:53


#10 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 26.07.2012 02:28

Po cichu mialem nadzieje, że w końcu ktos umie to zrobic ale jednak nie .. Nie działa.

Probowalem tego - http://amxx.pl/topic/947-spec-switch/ Ale tez nic ;/

Użytkownik SqNw0w edytował ten post 26.07.2012 02:30


#11 Nenczoks

    Banned

  • Zbanowany

Reputacja: 50
Pomocny

  • Postów:358
  • Lokalizacja:Warszawa
Offline

Napisano 26.07.2012 10:38

To Ty musisz źle podmieniać czy coś robić, bo testowałem i mi działa.

#12 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 26.07.2012 17:01

a Masz auto respawn ? Nie ;]

wpisuje /spec i jestem na spec ale zyje :]

#13 Nenczoks

    Banned

  • Zbanowany

Reputacja: 50
Pomocny

  • Postów:358
  • Lokalizacja:Warszawa
Offline

Napisano 26.07.2012 20:11

To daj sma tego auto respawnu -.-

#14 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 27.07.2012 02:24

Łap.

Załączone pliki



#15 Nenczoks

    Banned

  • Zbanowany

Reputacja: 50
Pomocny

  • Postów:358
  • Lokalizacja:Warszawa
Offline

Napisano 27.07.2012 11:02

Proszę, sprawdź:

/* AMXX Mod script.
*
* (c) Copyright 2004, developed by Geesu
* This file is provided as is (no warranties).
*
* Changelog
* 1.1:
* Added /respawn command to spawn a player if they're dead
* Added a public cvar
* 1.0:
* Pistols are now given to players when they respawn
* sv_checkpistols cvar added, if this is set to 0, then players will always spawn with a pistol, otherwise they will only spawn with a pistol when it is not scoutzknivez and not a ka map
* sv_respawn cvar added, set this to 0 to disable the plugin
*/

new const VERSION[] = "1.1"

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

#define DISABLE_CS 0

// team ids
#define UNASSIGNED 0
#define TS 1
#define CTS 2
#define AUTO_TEAM 5

new bool:g_PistolsDisabled = false

public plugin_init(){

register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")

register_event("DeathMsg","on_Death","a")

register_cvar("sv_checkpistols", "1")
register_cvar("sv_respawn", "1")
register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)

register_clcmd("say","on_Chat")
register_clcmd("say_team","on_Chat")
}

public on_Chat(id)
{
if ( !get_cvar_num("sv_respawn") )
{
client_print(id, print_chat, "* Respawn plugin disabled")
return PLUGIN_CONTINUE
}

new szSaid[32]
read_args(szSaid, 31)

if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^""))
{
spawn_func(id)
}
}

public check_pistols()
{
/* Determine if we should give players a pistol or not */
if ( get_cvar_num("sv_checkpistols") )
{
set_task(1.0, "check_pistols")
new mapname[32]
get_mapname(mapname,31)
if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
g_PistolsDisabled = true
}
}

public spawn_func(id)
{
new parm[1]
parm[0]=id

/* Spawn the player twice to avoid the HL engine bug */
set_task(0.5,"player_spawn",72,parm,1)
set_task(0.7,"player_spawn",72,parm,1)

/* Then give them a suit and a knife */
set_task(0.9,"player_giveitems",72,parm,1)
}

public on_Death()
{
for(new id = 0; id <= 32; id++)
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
return PLUGIN_CONTINUE;

if ( !get_cvar_num("sv_respawn") )
return PLUGIN_CONTINUE

new victim_id = read_data(2)

spawn_func( victim_id )

return PLUGIN_CONTINUE
}

public player_giveitems(parm[1])
{
new id = parm[0]

give_item(id, "item_suit")
give_item(id, "weapon_knife")

/* Determines if a players should be given a pistol */
if ( !g_PistolsDisabled )
{
new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false
get_user_weapons(id,wpnList,number)

/* Determine if the player already has a pistol */
for (new i = 0;i < number;i++)
{
if (wpnList[i] == CSW_GLOCK18)
foundGlock = true
if (wpnList[i] == CSW_USP)
foundUSP = true
}

/* Give a T his/her pistol */
if ( get_user_team(id)==TS && !foundGlock )
{
give_item(id,"weapon_glock18")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
}
/* Give a CT his/her pistol */
else if ( get_user_team(id)==CTS && !foundUSP )
{
give_item(id,"weapon_usp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
}
}

return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
spawn(parm[0])
}

Użytkownik Nenczoks edytował ten post 27.07.2012 11:05


#16 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 27.07.2012 15:02

w końcu :) Działa pięknie.

Close.

#17 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 27.07.2012 15:48

Nenczoks, działa komenda /spec wszystko pięknie, ale teraz respawn nie działa...


Jak zgine to nie odradza mnie a powinno.

#18 Nenczoks

    Banned

  • Zbanowany

Reputacja: 50
Pomocny

  • Postów:358
  • Lokalizacja:Warszawa
Offline

Napisano 27.07.2012 21:56

/* AMXX Mod script.
*
* (c) Copyright 2004, developed by Geesu
* This file is provided as is (no warranties).
*
* Changelog
* 1.1:
* Added /respawn command to spawn a player if they're dead
* Added a public cvar
* 1.0:
* Pistols are now given to players when they respawn
* sv_checkpistols cvar added, if this is set to 0, then players will always spawn with a pistol, otherwise they will only spawn with a pistol when it is not scoutzknivez and not a ka map
* sv_respawn cvar added, set this to 0 to disable the plugin
*/

new const VERSION[] = "1.1"

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

#define DISABLE_CS 0

// team ids
#define UNASSIGNED 0
#define TS 1
#define CTS 2
#define SPEC 3
#define AUTO_TEAM 5

new bool:g_PistolsDisabled = false

public plugin_init(){

register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")

register_event("DeathMsg","on_Death","a")

register_cvar("sv_checkpistols", "1")
register_cvar("sv_respawn", "1")
register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)

register_clcmd("say","on_Chat")
register_clcmd("say_team","on_Chat")
}

public on_Chat(id)
{
if ( !get_cvar_num("sv_respawn") )
client_print(id, print_chat, "* Respawn plugin disabled")

if (get_user_team(id) == SPEC)
client_print(id, print_chat, "* Jestes na spekcie !!")
else
{

new szSaid[32]
read_args(szSaid, 31)

if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^""))
spawn_func(id)
}
}

public check_pistols()
{
/* Determine if we should give players a pistol or not */
if ( get_cvar_num("sv_checkpistols") )
{
set_task(1.0, "check_pistols")
new mapname[32]
get_mapname(mapname,31)
if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
g_PistolsDisabled = true
}
}

public spawn_func(id)
{
if(get_user_team(id) == SPEC)
return;

new parm[1]
parm[0]=id

/* Spawn the player twice to avoid the HL engine bug */
set_task(0.5,"player_spawn",72,parm,1)
set_task(0.7,"player_spawn",72,parm,1)

/* Then give them a suit and a knife */
set_task(0.9,"player_giveitems",72,parm,1)
}

public on_Death()
{
if ( !get_cvar_num("sv_respawn") )
return PLUGIN_CONTINUE

new victim_id = read_data(2)

spawn_func( victim_id )

return PLUGIN_CONTINUE
}

public player_giveitems(parm[1])
{
new id = parm[0]

give_item(id, "item_suit")
give_item(id, "weapon_knife")

/* Determines if a players should be given a pistol */
if ( !g_PistolsDisabled )
{
new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false
get_user_weapons(id,wpnList,number)

/* Determine if the player already has a pistol */
for (new i = 0;i < number;i++)
{
if (wpnList[i] == CSW_GLOCK18)
foundGlock = true
if (wpnList[i] == CSW_USP)
foundUSP = true
}

/* Give a T his/her pistol */
if ( get_user_team(id)==TS && !foundGlock )
{
give_item(id,"weapon_glock18")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
}
/* Give a CT his/her pistol */
else if ( get_user_team(id)==CTS && !foundUSP )
{
give_item(id,"weapon_usp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
}
}

return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
spawn(parm[0])
}

?

Użytkownik Nenczoks edytował ten post 27.07.2012 21:59


#19 SqNw0w

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 2
Nowy

  • Postów:183
  • Lokalizacja:Gdansk
Offline

Napisano 27.07.2012 23:27

Teraz nie dziala komenda /spec
Wpisuje /spec i jestem na spect ale zyje :]

#20 Nenczoks

    Banned

  • Zbanowany

Reputacja: 50
Pomocny

  • Postów:358
  • Lokalizacja:Warszawa
Offline

Napisano 28.07.2012 00:24

http://wklej.org/id/799131/ o matko..




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych