[ROZWIĄZANE] Komenda Spec na Surfa
SqNw0w 21.07.2012
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.
Użytkownik SqNw0w edytował ten post 21.07.2012 02:42
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
GeDox
21.07.2012
#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
SqNw0w 21.07.2012
#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
SqNw0w 21.07.2012
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]) }
Klakier
22.07.2012
@up w tym twoim pluginie /respawn poszukaj publica
tutaj masz plugin na /spec i /back
Powinno grać
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ć
Nenczoks 25.07.2012
@Klakier - fakemeta tu rzeczywiście potrzeba -.-
Użytkownik Nenczoks edytował ten post 25.07.2012 20:53
#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
SqNw0w 26.07.2012
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
Probowalem tego - http://amxx.pl/topic/947-spec-switch/ Ale tez nic ;/
Użytkownik SqNw0w edytował ten post 26.07.2012 02:30
Nenczoks 27.07.2012
Proszę, sprawdź:
Użytkownik Nenczoks edytował ten post 27.07.2012 11:05
/* 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
SqNw0w 27.07.2012
Nenczoks, działa komenda /spec wszystko pięknie, ale teraz respawn nie działa...
Jak zgine to nie odradza mnie a powinno.
Jak zgine to nie odradza mnie a powinno.
Nenczoks 27.07.2012
/* 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