PDA

View Full Version : AMXX Spawnangle Bug Fixer (jghg)


Little Chang
07-17-2004, 18:49
Thanks to EKS for do the Port to AMXX

/*
AMXX Map Bug Fixer/Spawnangle Bug Fixer
=================
To set angles for a map just place the command(s) in amxmodx/configs/maps/mapname.cfg
like amxmodx/configs/maps/he_arena.cfg

The spawn points of the CT:s in the awp_map.bsp are rotated a little unfair, so you spawn facing the wall.
With this plugin and the Custom Map Configs plugin you can have problems like this permantently fixed on any map,
without having to change the mapfile itself.
Just add a short line (like "amx_spawnangle ct = 180") to the config file of the map you want to fix, and you're set.
You can also use the same command to turn the spawns in-game, should you ever need to. (ADMIN_CFG access required)

/jghg

USAGE
=====
amx_spawnangle <team (ct, t, or vip)> <mode (=, - or +)> <# of degrees>

Example uses:
amx_spawnangle t + 180 (this TURNS all terrorists spawns 180 degrees counter-clockwise if seen from above)
amx_spawnangle ct = 45 (this SETS all counter-terrorists spawns to exactly 45 degrees)
amx_spawnangle vip + 4 (you can TURN and SET vip's spawn too, if you want...)

Some suggested fixes for a few maps:
Face to Face

he_tennis.cfg: amx_spawnangle ct = 180
awp_map.cfg: amx_spawnangle ct = 180
3rooms.cfg: amx_spawnangle t = 180
aim_aztec.cfg: amx_spawnangle ct + 180
aim_firewall.cfg: amx_spawnangle t + 180
aim_glockrox.cfg: amx_spawnangle ct + 180
aim_headshot.cfg: amx_spawnangle t + 180
aim_paranoia.cfg: amx_spawnangle t + 180

VERSIONS
========
1.2, 040717 Ported to AMXX by EKS
name change from "AMX Map Bug Fixer" to "AMXX Spawnangle Bug Fixer"
Added extra check to entity "scan" to prevent it from going into a never ending loop
1.1, 031227 Removed use of isdigit function, which means this will probably work on older amx versions (?).
1.0, 031205 Complete change of everything. :-) We now rely on Custom Map Configs, and use amx_spawnangle to set the angles...
0.3, 031204 Removed to only use vexd and not xtrafun.
Fixed 3rooms.bsp
Changed plugin name because of more support for more maps...
0.2, ?????? Same problem with he_tennis, added support :-)
0.1, ?????? First version
*/

Have Fun - Little Chang

XxKpAznGuyxX
07-16-2005, 03:32
Anyway to make the T spawn facing the walls? For right now I'm using your previous cvar for awp_map which makes thes CT's face towards the T's which just make its more chaos.. (Sorry I don't know my angles)

Blitz
07-16-2005, 05:11
Very interesting...
Nice plugin. :D

Johnny got his gun
07-16-2005, 07:17
Wow, long time no sea. I forgot about all plugins I made...

Anyway, you should probably edit the info because Custom Map Cfg plugins isn't used/needed.

To set angles for a map just place the command(s) in amxmodx/configs/maps/mapname.cfg
like amxmodx/configs/maps/he_arena.cfg


XxKpAznGuyxX: You can just try the cmd until it works. Try 0, 90, 180, 270. Maps are usually made in straight angles.

XxKpAznGuyxX
07-16-2005, 11:30
It was amx_spawnangle t = 180 thanks

Edit - This Plugin rocks.. not that many ppl are now spawning.. instead of using spawn protection plugin this plugin is easier to use and better!

awp_map - spawn kill
fy_pool_day - nades spawn / spawn kill
fy_snow - nade spawn
cs_deagle5 - players can see there opponents respawn point
aim_map - spawn kill

I suggest you all should make all this map face towards the wall to prevent spawn killing..

XxKpAznGuyxX
07-19-2005, 14:56
L 07/19/2005 - 19:49:27: [AMXX] Native error in "entity_set_vector" on line 123 (file "amxx_spawnangle_bug_fixer.sma").
L 07/19/2005 - 19:49:27: [ENGINE] Invalid player 0 (not in-game)

this spam alot in my logs.. can anyone fix this?

DahVid
07-19-2005, 15:05
Quick guess. :) :)

new const PLUGINNAME[] = "AMXX Spawnangle Bug Fixer"
new const VERSION[] = "1.2"
new const AUTHOR[] = "jghg"
/*
Copyleft 2003
http://amxmod.net/forums/viewtopic.php?t=19198

AMXX Map Bug Fixer/Spawnangle Bug Fixer
=================
This plugin should be used in combination with JustinHoMi's Custom Map Configs.

The spawn points of the CT:s in the awp_map.bsp are rotated a little unfair, so you spawn facing the wall.
With this plugin and the Custom Map Configs plugin you can have problems like this permantently fixed on any map, without having to change the mapfile itself.
Just add a short line (like "amx_spawnangle ct = 180") to the config file of the map you want to fix, and you're set.
You can also use the same command to turn the spawns in-game, should you ever need to. (ADMIN_CFG access required)

Requires Vexd utilities module.

/jghg

USAGE
=====
amx_spawnangle <team (ct, t, or vip)> <mode (=, - or +)> <# of degrees>

Example uses:
amx_spawnangle t + 180 (this TURNS all terrorists spawns 180 degrees counter-clockwise if seen from above)
amx_spawnangle ct = 45 (this SETS all counter-terrorists spawns to exactly 45 degrees)
amx_spawnangle vip + 4 (you can TURN and SET vip's spawn too, if you want...)

Some suggested fixes for a few maps:

he_tennis.bsp: amx_spawnangle ct = 180
awp_map.bsp: amx_spawnangle ct = 180
3rooms.bsp: amx_spawnangle t = 180


VERSIONS
========
1.2, 040717 Ported to AMXX by EKS
name change from "AMX Map Bug Fixer" to "AMXX Spawnangle Bug Fixer"
Added extra check to entity "scan" to prevent it from going into a never ending loop
1.1, 031227 Removed use of isdigit function, which means this will probably work on older amx versions (?).
1.0, 031205 Complete change of everything. :-) We now rely on Custom Map Configs, and use amx_spawnangle to set the angles...
0.3, 031204 Removed to only use vexd and not xtrafun.
Fixed 3rooms.bsp
Changed plugin name because of more support for more maps...
0.2, ?????? Same problem with he_tennis, added support :-)
0.1, ?????? First version
*/

#include <amxmodx>
#include <amxmisc>
#include <engine>

public spawnangle_cmd(id, level, cid) {
if (!cmd_access(id,level,cid,4)) {
console_print(id, "Example use: amx_spawnangle ct + 180 (adds 180 degrees to all CTs' spawnangles)")
return PLUGIN_HANDLED
}
if(is_user_connected(id)) {
// Get parameters
new arguments[100]
read_args(arguments, 99)

new team[4]
new mode[2]
new InternalDegrees[10]
if (parse(arguments, team, 3, mode, 1, InternalDegrees, 9) != 3) {
console_print(id, "[AMX] Error - couldn't read parse line!")
server_print("[AMX] Error - couldn't read parse line!")
return PLUGIN_HANDLED
}

// Check team
// info_vip_start = vip spawn
// info_player_start = ct spawn
// info_player_deathmatch = t spawn
new spawnentity[30]
if (equali(team, "ct"))
spawnentity = "info_player_start"
else if (equali(team, "t"))
spawnentity = "info_player_deathmatch"
else if (equali(team, "vip"))
spawnentity = "info_vip_start"
else {
console_print(id, "[AMX] Error - ^"%s^" is not a valid team (use ct, t, or vip)", team)
return PLUGIN_HANDLED
}

// Check mode
if (!equal(mode, "+") && !equal(mode, "-") && !equal(mode, "=")) {
console_print(id, "[AMX] Error - ^"%s^" is not a valid mode (use +, - or =)", mode)
return PLUGIN_HANDLED
}

// Check degrees
for (new i = 0;i < strlen(InternalDegrees);i++) {
//if (!isdigit(degrees[i])) {
if (InternalDegrees[i] < '0' || InternalDegrees[i] > '9') {
console_print(id, "[AMX] Error - ^"%s^" is not valid degrees (use only numbers)", InternalDegrees)
return PLUGIN_HANDLED
}
}

new Float:degreesvalue = floatstr(InternalDegrees)

// Do it... the rotation of spawns, that is :-)
new ent = 1, Float:angles[3], counter = 0
server_print("[AMX] Turning all %s spawn points...(Looking for ent of the %s class", team,spawnentity)
do {
ent = find_ent_by_class(ent, spawnentity)

if (ent != -1) {
entity_get_vector(ent,EV_VEC_angles,angles)

if (equal(mode, "+"))
angles[1] += degreesvalue
else if (equal(mode, "-"))
angles[1] -= degreesvalue
else
angles[1] = degreesvalue

entity_set_vector(ent,EV_VEC_angles,angles)
counter++
}
}
while (ent != -1 && counter <= 1024)
if(counter == 1024)
server_print("The server Failed to find: %s",spawnentity)
console_print(id, "[AMX] Turned %d %s:s.", counter, spawnentity)

return PLUGIN_HANDLED
}
}

public plugin_init() {
register_plugin(PLUGINNAME, VERSION, AUTHOR)
register_concmd("amx_spawnangle", "spawnangle_cmd", ADMIN_CFG, "<team> <+/=> <degrees> (+ turn team's spawns degrees, = set team's spawns to degree direction)")
}

XxKpAznGuyxX
07-19-2005, 15:07
I'm going to try it out right now

XxKpAznGuyxX
07-20-2005, 22:50
waring 209: function "spawnangle_cmd" should return a value

1 Warning.
Done.

Just wondering if I should still replace the previous file with the new compiled version.. I don't want to mess up my server

n00bl0l
12-20-2005, 12:47
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// AMXX_Spawnangle_Bug_Fixer.sma
// C:\Documents and Settings\HP_Eier\Skrivebord\AMXX_Spawnangle_B ug_Fixer.sma(0)
: fatal error 101: cannot write to file: "C:\Documents and Settings\HP_Eier\Skr
ivebord\compiled\AMXX_Spawnangle_Bug_Fixer.am x"
//
// Compilation aborted.
// 1 Error.
// Could not locate output file C:\Documents and Settings\HP_Eier\Skrivebord\com
piled\AMXX_Spawnangle_Bug_Fixer.amx (compile failed).
//
// Compilation Time: 0,06 sec

Bug or something I had done wrong??? dunno please help me

Vm|Mayhem
01-05-2006, 11:33
L 01/05/2006 - 08:27:38: [ENGINE] Invalid player 0 (not in-game)
L 01/05/2006 - 08:27:38: [AMXX] Run time error 10 (plugin "AMXX_Spawnangle_Bug_Fixer.amxx") - debug not enabled!

What would cause these errors? is the "Vexd utilities module" still needed in 1.6?

With debug, I found this. Any ideas?:

L 01/05/2006 - 08:49:10: [AMXX] Displaying debug trace (plugin "AMXX_Spawnangle_Bug_Fixer.amxx")
L 01/05/2006 - 08:49:10: [AMXX] Run time error 10: native error (native "entity_get_vector")
L 01/05/2006 - 08:49:10: [AMXX] [0] amxx_spawnangle_bug_fixer.sma::spawnangle_cmd (line 114)

Simon Logic
02-01-2007, 08:06
Here is the replacement of this plugin:

Player Spawn Points Fixer (http://forums.alliedmods.net/showthread.php?t=50649) [approved]

Hope you'll like it.

whodarezwins
11-07-2008, 01:06
Wow I didnt know this plugin exist since a long time. I like this plugin. I am running a deathmatch playing at aim maps. Usually i make the respawn facing the enemy using the deathmatch built-in respawn thing. Having this plugin make my life really easier. Thank you Little Chang for this plugin. Appreciate it.