/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Spawn Protector"
#define VERSION "1.0"
#define AUTHOR "lisek"
new bool:runda = false
new cvar_time
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_time = register_cvar("cvar_time","10.0") // po jakim czasie ma zabijać
register_event("HLTV", "NewRound", "a", "1=0", "2=0")
register_logevent("EndRound",2,"1=Round_End")
}
public NewRound()
set_task(get_pcvar_float(cvar_time), "protekcja",0)
public EndRound()
runda=false
public client_spawn(id){
if(runda==true && is_user_alive(id))
client_cmd(id, "kill")
}
public protekcja()
runda=true
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.
|
Zabicie po dolaczeniu podczas trwania rundy
#1
Napisano 14.06.2011 10:55
#3
Napisano 14.06.2011 16:46
#4
Napisano 15.06.2011 14:32
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#define TASKID 146
new gRoundStart;
new round;
new iRoundTime;
public plugin_init(){
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
RegisterHam(Ham_Spawn, "player", "SpawnPost")
}
public eventStartRound(){
round++
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
new iRoundTime = get_systime() - gRoundStart;
}
public SpawnPost(id) {
if (!round > 1) return PLUGIN_CONTINUE;
if (!iRoundTime > 10) return PLUGIN_CONTINUE;
if (is_user_alive(id)){
user_kill(id);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
else return PLUGIN_CONTINUE;
}
EDIT: sprawdź czy działa
Użytkownik stepdub edytował ten post 15.06.2011 15:51
#5
Napisano 15.06.2011 15:06
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team
Warning: Symbol is assigned a value that is never used: "iRoundTime" on line 30
Warning: Tag mismatch on line 33
Error: Undefined symbol "iRoundTime" on line 34
Warning: Function "SpawnPost" should return a value on line 41
1 Error.
#6
Napisano 15.06.2011 15:50
new iRoundTime;
nie zauważyłem
całość - zlikwidowałem warningi
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >
new gRoundStart
new round
new iRoundTime
#define TASKID 146
public plugin_init(){
register_plugin("Selekcjoner", "1.0", "stepdub");
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
RegisterHam(Ham_Spawn, "player", "SpawnPost");
}
public eventStartRound(){
round++
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
new iRoundTime = get_systime() - gRoundStart;
}
public SpawnPost(id) {
if (round < 1) return PLUGIN_CONTINUE;
if (iRoundTime < 10) return PLUGIN_CONTINUE;
if (is_user_alive(id)){
user_silentkill(id);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
else return PLUGIN_CONTINUE;
return PLUGIN_CONTINUE;
}
EDIT: zmieniłem na user_silentkill
Użytkownik stepdub edytował ten post 15.06.2011 19:15
#7
Napisano 16.06.2011 11:10
1 Warning.
#8
Napisano 16.06.2011 11:29
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >
new gRoundStart
new round
new iRoundTime
#define TASKID 146
public plugin_init(){
register_plugin("Selekcjoner", "1.0", "stepdub");
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
RegisterHam(Ham_Spawn, "player", "SpawnPost");
}
public eventStartRound(){
round++
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
iRoundTime = get_systime() - gRoundStart;
}
public SpawnPost(id) {
if (round < 1) return PLUGIN_CONTINUE;
if (iRoundTime < 10) return PLUGIN_CONTINUE;
if (is_user_alive(id)){
user_silentkill(id);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
else return PLUGIN_CONTINUE;
return PLUGIN_CONTINUE;
}
zamiast
public eventTimerTick(){
new iRoundTime = get_systime() - gRoundStart;
}
public eventTimerTick(){
iRoundTime = get_systime() - gRoundStart;
}
gdyż masz już zadeklarowaną zmienną na początku
Piszesz na gg w sprawie pomocy? Z góry ignore, pozdrawiam.
CS 1.6 Download
Serwery CS
Cs nonsteam download
#9
Napisano 16.06.2011 11:35
Użytkownik amxxmaster edytował ten post 16.06.2011 11:35
#10
Napisano 16.06.2011 13:58
zaraz coś pomyślę dalej
EDIT: spróbuj to:
zamień
#include < hamsandwich >
na
#include < fakemeta >
zamień
public SpawnPost(id) {
if (round < 1) return PLUGIN_CONTINUE;
if (iRoundTime < 10) return PLUGIN_CONTINUE;
if (is_user_alive(id)){
user_silentkill(id);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
else return PLUGIN_CONTINUE;
return PLUGIN_CONTINUE;
}
na
public fm_cs_user_spawn(id) {
if (round < 1) return PLUGIN_CONTINUE;
if (iRoundTime < 10) return PLUGIN_CONTINUE;
if (is_user_alive(id)){
user_silentkill(id);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
else return PLUGIN_CONTINUE;
return PLUGIN_CONTINUE;
}
usuń
RegisterHam(Ham_Spawn, "player", "SpawnPost");
zamień
public eventTimerTick(){
new iRoundTime = get_systime() - gRoundStart;
}
na
public eventTimerTick(){
iRoundTime = get_systime() - gRoundStart;
}
i powinno być OK
Dodano 16 czerwiec 2011 - 14:10:
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < fakemeta >
new gRoundStart
new round
new iRoundTime
#define TASKID 146
public plugin_init(){
register_plugin("Selekcjoner", "1.0", "stepdub");
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
}
public eventStartRound(){
round++
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
iRoundTime = get_systime() - gRoundStart;
}
public fm_cs_user_spawn(id) {
if (round < 1) return PLUGIN_CONTINUE;
if (iRoundTime < 10) return PLUGIN_CONTINUE;
if (is_user_alive(id)){
user_silentkill(id);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
else return PLUGIN_CONTINUE;
return PLUGIN_CONTINUE;
}
Użytkownik stepdub edytował ten post 16.06.2011 14:10
#11
Napisano 16.06.2011 14:41
Użytkownik amxxmaster edytował ten post 16.06.2011 14:41
#12
Napisano 16.06.2011 15:03
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >
new gRoundStart
new round
new iRoundTime
#define TASKID 146
public plugin_init(){
register_plugin("Selekcjoner", "1.0", "stepdub");
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
RegisterHam(HamSpawn, "player", "SpawnPost");
}
public eventStartRound(){
round++
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
iRoundTime = get_systime() - gRoundStart;
}
public SpawnPost(id) {
if (round < 1) return PLUGIN_CONTINUE;
if (iRoundTime < 10) return PLUGIN_CONTINUE;
if (is_user_alive(id)){
user_kill(id);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
return PLUGIN_CONTINUE;
}
sorry, jednak HamSpawn działa jak miał działać pierwotnie gdy zaczynałem pisać to
sprawdź teraz
#13
Napisano 16.06.2011 15:08
Error: Undefined symbol "HamSpawn" on line 22 Warning: Expression has no effect on line 22 Warning: Expression has no effect on line 22 Error: Expected token: ";", but found ")" on line 22 Error: Invalid expression, assumed zero on line 22 Error: Too many error messages on one line on line 22 Compilation aborted. 4 Errors.
Użytkownik amxxmaster edytował ten post 16.06.2011 15:08
#14
Napisano 16.06.2011 15:15
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >
new gRoundStart
new round
new iRoundTime
#define TASKID 146
public plugin_init(){
register_plugin("Selekcjoner", "1.0", "stepdub");
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
RegisterHam(Ham_Spawn, "player", "SpawnPost");
}
public eventStartRound(){
round++
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
iRoundTime = get_systime() - gRoundStart;
}
public SpawnPost(id) {
if (round < 1) return PLUGIN_CONTINUE;
if (iRoundTime < 10) return PLUGIN_CONTINUE;
if (is_user_alive(id)){
user_kill(id);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
return PLUGIN_CONTINUE;
}
#15
Napisano 16.06.2011 15:26
#16
Napisano 16.06.2011 17:29
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "PluginName"
#define VERSION "1.0"
#define AUTHOR ".:Vitek:."
new czas = 10 //tu ustawiasz po ilu sec ma killac
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "Spawn", 1)
register_logevent("Poczatek_Rundy", 2, "1=Round_Start")
}
public Poczatek_Rundy()
{
czas --;
return PLUGIN_CONTINUE
}
public Spawn(id)
{
if(czas < 1 && is_user_alive(id))
{
user_silentkill(id)
cs_set_user_deaths(id, 0)
}
}
Użytkownik MarWit edytował ten post 16.06.2011 17:55

#17
Napisano 16.06.2011 18:07
a zobacz to:
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >
new gRoundStart
new round
new iRoundTime
#define TASKID 146
public plugin_init(){
register_plugin("Selekcjoner", "1.0", "stepdub");
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
RegisterHam(Ham_Spawn, "player", "SpawnPost", 1);
}
public eventStartRound(){
round++
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
iRoundTime = get_systime() - gRoundStart;
}
public SpawnPost(id) {
if (round > 1) return HAM_SUPERCEDE;
if (iRoundTime > 10) return HAM_SUPERCEDE;
return PLUGIN_CONTINUE;
}
zamiast zabijania zablokowałem wywołanie funkcji
Użytkownik stepdub edytował ten post 16.06.2011 18:08
#18
Napisano 16.06.2011 20:06
#19
Napisano 16.06.2011 20:31
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >
new gRoundStart
new round
new iRoundTime
#define TASKID 146
public plugin_init(){
register_plugin("Selekcjoner", "1.0", "stepdub");
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
RegisterHam(Ham_Spawn, "player", "SpawnPost", 1);
}
public eventStartRound(){
round++
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
iRoundTime = get_systime() - gRoundStart;
}
public SpawnPost(id) {
if(iRoundTime > 10)
{
if(round < 1) {
return HAM_HANDLED;
}
if(round > 1)
return HAM_SUPERCEDE;
}
return HAM_HANDLED;
}
a teraz?
może ktoś inny spróbuje, bo mi się pomysły kończą
Użytkownicy przeglądający ten temat: 1
0 użytkowników, 1 gości, 0 anonimowych


Dodatki SourceMod



Temat jest zamknięty










