Quick guess.
Code:
new const PLUGINNAME[] = "AMXX Spawnangle Bug Fixer"
new const VERSION[] = "1.2"
new const AUTHOR[] = "jghg"
/*
Copyleft 2003
<a href="http://amxmod.net/forums/viewtopic.php?t=19198" target="_blank" rel="nofollow noopener">http://amxmod.net/forums/viewtopic.php?t=19198</a>
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)")
}