Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[Cerere] Plugin respawn
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
1374
DANNY*
[Mentally Stable]
Status: Offline
(since 26-04-2018 11:28)
Joined: 08 Feb 2017
Posts: 161
,
Topics: 28
Location:
Romania
Reputation:
26.7
Votes
: 1
Posted: 04-03-2017, 23:18:20
| Translate post to:
... (
Click for more languages
)
Nume: Plugin respawn
Descriere plugin: Vreau daca se poate sa mi se adauge 2 cvaruri la acest plugin. De activare si dezactivare, !
Alte detalii: si imi mai da mesajele astea :
[CSDM] This server is running CSDM 2.1.2
[CSDM] Visit
http://www.*******.net/
In sma nu le-am gasit o fi de la module ???
Exemplu:
amx_cvar respawn 1 / 0 1 - sa se activeze 0 - sa se fie dezactivat, adica sa nu mai primesc respawn .
SMA
Quote:
#define MAX_SPAWNS 5000
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <csdm>
//Tampering with the author and name lines will violate copyrights
new PLUGINNAME[] = "CSDM Mod"
new VERSION[] = CSDM_VERSION
new AUTHORS[] = "CSDM Team"
new Float:g_SpawnVecs[MAX_SPAWNS][3];
new Float:g_SpawnAngles[MAX_SPAWNS][3];
new Float:g_SpawnVAngles[MAX_SPAWNS][3];
new g_TotalSpawns = 0;
public csdm_Init(const version[])
{
if (version[0] == 0)
{
set_fail_state("CSDM failed to load.")
return
}
csdm_addstyle("preset", "spawn_Preset")
}
public csdm_CfgInit()
{
csdm_reg_cfg("settings", "read_cfg")
}
public plugin_init()
{
register_plugin(PLUGINNAME,VERSION,AUTHORS)
}
public read_cfg(action, line[], section[])
{
if (action == CFG_RELOAD)
{
readSpawns()
}
}
readSpawns()
{
//-617 2648 179 16 -22 0 0 -5 -22 0
// Origin (x,y,z), Angles (x,y,z), vAngles(x,y,z), Team (0 = ALL) - ignore
// :TODO: Implement team specific spawns
new Map[32], config[32], MapFile[64]
get_mapname(Map, 31)
get_configsdir(config, 31)
format(MapFile, 63, "%s\csdm\%s.spawns.cfg", config, Map)
g_TotalSpawns = 0;
if (file_exists(MapFile))
{
new Data[124], len
new line = 0
new pos[12][8]
while(g_TotalSpawns < MAX_SPAWNS && (line = read_file(MapFile , line , Data , 123 , len) ) != 0 )
{
if (strlen(Data)<2 || Data[0] == '[')
continue;
parse(Data, pos[1], 7, pos[2], 7, pos[3], 7, pos[4], 7, pos[5], 7, pos[6], 7, pos[7], 7, pos[8], 7, pos[9], 7, pos[10], 7);
// Origin
g_SpawnVecs[g_TotalSpawns][0] = str_to_float(pos[1])
g_SpawnVecs[g_TotalSpawns][1] = str_to_float(pos[2])
g_SpawnVecs[g_TotalSpawns][2] = str_to_float(pos[3])
//Angles
g_SpawnAngles[g_TotalSpawns][0] = str_to_float(pos[4])
g_SpawnAngles[g_TotalSpawns][1] = str_to_float(pos[5])
g_SpawnAngles[g_TotalSpawns][2] = str_to_float(pos[6])
//v-Angles
g_SpawnVAngles[g_TotalSpawns][0] = str_to_float(pos[8])
g_SpawnVAngles[g_TotalSpawns][1] = str_to_float(pos[9])
g_SpawnVAngles[g_TotalSpawns][2] = str_to_float(pos[10])
//Team - ignore - 7
g_TotalSpawns++;
}
log_amx("Loaded %d spawn points for map %s.", g_TotalSpawns, Map)
} else {
log_amx("No spawn points file found (%s)", MapFile)
}
return 1;
}
public spawn_Preset(id, num)
{
if (g_TotalSpawns < 2)
return PLUGIN_CONTINUE
new list[MAX_SPAWNS]
new num = 0
new final = -1
new total=0
new players[32], n, x = 0
new Float:loc[32][3], locnum
//cache locations
get_players(players, num)
for (new i=0; i<num; i++)
{
if (is_user_alive(players[i]) && players[i] != id)
{
pev(players[i], pev_origin, loc[locnum])
locnum++
}
}
num = 0
while (num <= g_TotalSpawns)
{
//have we visited all the spawns yet?
if (num == g_TotalSpawns)
break;
//get a random spawn
n = random_num(0, g_TotalSpawns-1)
//have we visited this spawn yet?
if (!list[n])
{
//yes, set the flag to true, and inc the number of spawns we've visited
list[n] = 1
num++
}
else
{
//this was a useless loop, so add to the infinite loop prevention counter
total++;
if (total > 100) // don't search forever
break;
continue; //don't check again
}
new trace = csdm_trace_hull(g_SpawnVecs[n], 1)
if (trace)
continue;
if (locnum < 1)
{
final = n
break
}
final = n
for (x = 0; x < locnum; x++)
{
new Float:distance = get_distance_f(g_SpawnVecs[n], loc[x]);
if (distance < 250.0)
{
//invalidate
final = -1
break;
}
}
if (final != -1)
break
}
if (final != -1)
{
new Float:mins[3], Float:maxs[3]
pev(id, pev_mins, mins)
pev(id, pev_maxs, maxs)
engfunc(EngFunc_SetSize, id, mins, maxs)
engfunc(EngFunc_SetOrigin, id, g_SpawnVecs[final])
set_pev(id, pev_fixangle, 1)
set_pev(id, pev_angles, g_SpawnAngles[final])
set_pev(id, pev_v_angle, g_SpawnVAngles[final])
set_pev(id, pev_fixangle, 1)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
0
0
Back to top
-P!C@-
[Simply Normal]
Status: Offline
(since 21-04-2022 19:07)
Joined: 28 May 2012
Posts: 21086
,
Topics: 1601
Location:
Constanta
Reputation:
1870.3
Votes
: 781
Posted: 04-03-2017, 23:30:39
| Translate post to:
... (
Click for more languages
)
Nici nu vei gasi mesajele sa le stergi
de ce vrei sa activezi/dezactivezi? nu te incurca? adica sa ramana ori respawn ori clasic..
0
0
Back to top
DANNY*
[Mentally Stable]
Status: Offline
(since 26-04-2018 11:28)
Joined: 08 Feb 2017
Posts: 161
,
Topics: 28
Location:
Romania
Reputation:
26.7
Votes
: 1
Posted: 04-03-2017, 23:40:38
| Translate post to:
... (
Click for more languages
)
Am gasit alt plugin , mult mai bun ,asta are cvaruri , dar problema este ca da si pistoale .
Am pus cvarul ala de pistoale pe 0 dar , dar dupa prima runda iar se primeste pistoale .
Am pus cvarul si in amxx.cfg dar degeaba ,
Puteti sa scoateti pistoalele de tot ( tot ce tine de pistoale , cvar ,,,, etc . ) sa ramana doar respawnul !
Tero primeste Glock si CT USP /
Sma"
Spoiler:
/* 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", "0")
register_cvar("sv_respawn", "0")
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])
}
0
0
Back to top
TwisTer
[GOOGLE SEARCHER]
Status: Offline
(since 28-05-2025 19:27)
Joined: 04 May 2007
Posts: 6962
,
Topics: 147
Location:
Romania
Reputation:
2774.4
Votes
: 232
Posted: 06-03-2017, 18:40:55
| Translate post to:
... (
Click for more languages
)
Vezi acum :
Spoiler:
Code:
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
public plugin_init(){
register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")
register_event("DeathMsg","on_Death","a")
register_cvar("sv_respawn", "0")
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 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")
return PLUGIN_CONTINUE
}
public player_spawn(parm[1])
{
spawn(parm[0])
}
0
0
Back to top
DANNY*
[Mentally Stable]
Status: Offline
(since 26-04-2018 11:28)
Joined: 08 Feb 2017
Posts: 161
,
Topics: 28
Location:
Romania
Reputation:
26.7
Votes
: 1
Posted: 07-03-2017, 18:25:39
| Translate post to:
... (
Click for more languages
)
Merge , multumesc mult !.
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
-P!C@-
, 07 March 2017 18:19
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 02-08-2025, 15:53:15
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details