Плъгинът променя съобщението "Enemy spotted" според това колко противника виждате. Примерно: "Two enemies spotted" или "Six enemies spotted" ако играчите са съответно двама или шестима.
Модули :engine
Enemy spotted
Модератори: Форум Модератори, Екип Банове
7 мнения
• Страница 1 от 1
-
LoShaTa LaDy - Потребител
- Предупреждения: 0
- Мнения: 528
- Регистриран на: 17 Сеп 2010, 14:59
- Име в игра: LoShaTa LaDy
- Skype: sandri4ka_07
Re: Enemy spotted
Има ли шанс да го качиш отново някъде, защото линкът за сваляне е невалиден?
-
Alexxx - Потребител
- Предупреждения: 0
- Мнения: 11
- Регистриран на: 12 Авг 2012, 00:02
- Име в игра: ^.- / Balcoin
- Skype: AKOnqkoiGOiskaSHTEgoDAMnaLS
Re: Enemy spotted
Това е тема от 2011 гледай датата преди да пишеш моля
-
BaTkO_SaSS - Потребител
- Предупреждения: 0
- Мнения: 618
- Регистриран на: 10 Сеп 2011, 20:43
- Местоположение: Ямбол
- Име в игра: BaTkO_SaSS
- Skype: ringoringov
Re: Enemy spotted
BaTkO_SaSS написа:Това е тема от 2011 гледай датата преди да пишеш моля
Видял съм датата и точно за това попитах дали има шанс (ако все още го пази)
-
Alexxx - Потребител
- Предупреждения: 0
- Мнения: 11
- Регистриран на: 12 Авг 2012, 00:02
- Име в игра: ^.- / Balcoin
- Skype: AKOnqkoiGOiskaSHTEgoDAMnaLS
Re: Enemy spotted
Качвам го наново, вече трябва да е ок
-
LoShaTa LaDy - Потребител
- Предупреждения: 0
- Мнения: 528
- Регистриран на: 17 Сеп 2010, 14:59
- Име в игра: LoShaTa LaDy
- Skype: sandri4ka_07
Re: Enemy spotted
LoShaTa LaDy написа:Качвам го наново, вече трябва да е ок
Идеално е, мерси!
-
Alexxx - Потребител
- Предупреждения: 0
- Мнения: 11
- Регистриран на: 12 Авг 2012, 00:02
- Име в игра: ^.- / Balcoin
- Skype: AKOnqkoiGOiskaSHTEgoDAMnaLS
Re: Enemy spotted
- Код за потвърждение: Избери целия код
#define PLUGINNAME "Enemy spotted"
#define VERSION "0.1"
#define AUTHOR "JGHG"
/*
Copyleft 2005
Plugin topic: http://www.amxmodx.org/forums/viewtopic.php?p=90073
ENEMY SPOTTED
=============
Makes "Enemy spotted" radio messages go "Three enemies spotted" if the person has three people in his view.
/JGHG
VERSIONS
========
050204 0.1 First version
*/
#include <amxmodx>
#include <engine>
#define PI 3.1415926535897932384626433832795
#define VIEWSPAN 48.0 // degrees, tweakable
// Globals below
new g_MAXPLAYERS
new Float:g_ONEEIGHTYTHROUGHPI
// Globals above
public plugin_modules() {
require_module("engine")
}
visible_enemies(id) {
new Float:origin[3], Float:targetOrigin[3], team = get_user_team(id), hitIndex, Float:view_offset[3], Float:hitOrigin[3], visibleCount = 0
entity_get_vector(id, EV_VEC_origin, origin)
entity_get_vector(id, EV_VEC_view_ofs, view_offset)
origin[0] += view_offset[0]
origin[1] += view_offset[1]
origin[2] += view_offset[2]
new Float:viewangles[3]
entity_get_vector(id, EV_VEC_v_angle, viewangles)
for(new i = 1; i <= g_MAXPLAYERS; i++) {
if (!is_user_connected(i) || !is_user_alive(i) || team == get_user_team(i))
continue
entity_get_vector(i, EV_VEC_origin, targetOrigin)
hitIndex = trace_line(id, origin, targetOrigin, hitOrigin)
if (hitIndex != i)
continue
// Find out if i is within id's scope.
// Get angle to target.
new Float:x = hitOrigin[0] - origin[0]
new Float:z = hitOrigin[1] - origin[1]
new Float:radians = floatatan(z/x, radian) // div by 0? :-P
new Float:degreeeeees = radians * g_ONEEIGHTYTHROUGHPI
if (origin[0] > hitOrigin[0]) {
if (origin[1] < hitOrigin[1])
degreeeeees += 180.0
else if (origin[1] > hitOrigin[1])
degreeeeees -= 180.0
}
new Float:difference = viewangles[1] - degreeeeees
//new bool:visible = false
if (difference >= -VIEWSPAN && difference <= VIEWSPAN) {
//visible = true
visibleCount++
}
//client_print(id, print_chat, "%s angle from %d to %d is %f, your angles: %f %f %f, difference: %f^n", visible ? "YES" : "NO", id, i, degreeeeees, viewangles[0], viewangles[1], viewangles[2], difference)
}
return visibleCount
}
public message_TextMsg(msg_id, msg_dest, index) {
if (get_msg_args() != 5 || get_msg_argtype(5) != ARG_STRING)
return PLUGIN_CONTINUE
new argument[64]
get_msg_arg_string(5, argument, 63)
if (!equal("#Enemy_spotted", argument))
return PLUGIN_CONTINUE
new id_sz[10]
get_msg_arg_string(2, id_sz, 9)
new visible = visible_enemies(str_to_num(id_sz))
new visibleString[32]
getnumbers(visible, visibleString, 31)
/*
new name[128]
get_msg_arg_string(4, name, 127)
format(name, 127, "%s (%d %s)", name, visible, visible == 1 ? "enemy" : "enemies")
set_msg_arg_string(4, name)
*/
format(argument, 63, "%c%s %s spotted.", visibleString[0] - 32, visibleString[1], visible == 1 ? "enemy" : "enemies")
set_msg_arg_string(5, argument)
return PLUGIN_CONTINUE
}
stock getnumbers(number, wordnumbers[], length) {
if (number < 0) {
format(wordnumbers, length, "error")
return
}
else if (number == 0) {
format(wordnumbers, length, "zero")
}
new numberstr[20]
num_to_str(number, numberstr, 19)
new stlen = strlen(numberstr), bool:getzero = false, bool:jumpnext = false
if (stlen == 1)
getzero = true
do {
if (jumpnext)
jumpnext = false
else if (numberstr[0] != '0') {
switch (stlen) {
case 9: {
if (getsingledigit(numberstr[0], wordnumbers, length))
format(wordnumbers, length, "%s hundred%s", wordnumbers, numberstr[1] == '0' && numberstr[2] == '0' ? " million" : "")
}
case 8: {
jumpnext = gettens(wordnumbers, length, numberstr)
if (jumpnext)
format(wordnumbers, length, "%s million", wordnumbers)
}
case 7: {
getsingledigit(numberstr[0], wordnumbers, length)
format(wordnumbers, length, "%s million", wordnumbers)
}
case 6: {
if (getsingledigit(numberstr[0], wordnumbers, length))
format(wordnumbers, length, "%s hundred%s", wordnumbers, numberstr[1] == '0' && numberstr[2] == '0' ? " thousand" : "")
}
case 5: {
jumpnext = gettens(wordnumbers, length, numberstr)
if (numberstr[0] == '1' || numberstr[1] == '0')
format(wordnumbers, length, "%s thousand", wordnumbers)
}
case 4: {
getsingledigit(numberstr[0], wordnumbers, length)
format(wordnumbers, length, "%s thousand", wordnumbers)
}
case 3: {
getsingledigit(numberstr[0], wordnumbers, length)
format(wordnumbers, length, "%s hundred", wordnumbers)
}
case 2: jumpnext = gettens(wordnumbers, length, numberstr)
case 1: {
getsingledigit(numberstr[0], wordnumbers, length, getzero)
break // could've trimmed, but of no use here
}
default: {
format(wordnumbers, length, "%s TOO LONG", wordnumbers)
break
}
}
}
jghg_trim(numberstr, length, 1)
stlen = strlen(numberstr)
}
while (stlen > 0)
// Trim a char from left if first char is a space (very likely)
if (wordnumbers[0] == ' ')
jghg_trim(wordnumbers, length, 1)
}
// Returns true if next char should be jumped
stock bool:gettens(wordnumbers[], length, numberstr[]) {
new digitstr[11], bool:dont = false, bool:jumpnext = false
switch (numberstr[0]) {
case '1': {
jumpnext = true
switch (numberstr[1]) {
case '0': digitstr = "ten"
case '1': digitstr = "eleven"
case '2': digitstr = "twelve"
case '3': digitstr = "thirteen"
case '4': digitstr = "fourteen"
case '5': digitstr = "fifteen"
case '6': digitstr = "sixteen"
case '7': digitstr = "seventeen"
case '8': digitstr = "eighteen"
case '9': digitstr = "nineteen"
default: digitstr = "TEENSERROR"
}
}
case '2': digitstr = "twenty"
case '3': digitstr = "thirty"
case '4': digitstr = "fourty"
case '5': digitstr = "fifty"
case '6': digitstr = "sixty"
case '7': digitstr = "seventy"
case '8': digitstr = "eighty"
case '9': digitstr = "ninety"
case '0': dont = true // do nothing
default : digitstr = "TENSERROR"
}
if (!dont)
format(wordnumbers, length, "%s %s", wordnumbers, digitstr)
return jumpnext
}
// Returns true when sets, else false
stock getsingledigit(digit[], numbers[], length, bool:getzero = false) {
new digitstr[11]
switch (digit[0]) {
case '1': digitstr = "one"
case '2': digitstr = "two"
case '3': digitstr = "three"
case '4': digitstr = "four"
case '5': digitstr = "five"
case '6': digitstr = "six"
case '7': digitstr = "seven"
case '8': digitstr = "eight"
case '9': digitstr = "nine"
case '0': {
if (getzero)
digitstr = "zero"
else
return false
}
default : digitstr = "digiterror"
}
format(numbers, length, "%s %s", numbers, digitstr)
return true
}
stock jghg_trim(stringtotrim[], len, charstotrim, bool:fromleft = true) {
if (charstotrim <= 0)
return
if (fromleft) {
new maxlen = strlen(stringtotrim)
if (charstotrim > maxlen)
charstotrim = maxlen
format(stringtotrim, len, "%s", stringtotrim[charstotrim])
}
else {
new maxlen = strlen(stringtotrim) - charstotrim
if (maxlen < 0)
maxlen = 0
format(stringtotrim, maxlen, "%s", stringtotrim)
}
}
public plugin_init() {
register_plugin(PLUGINNAME, VERSION, AUTHOR)
//register_event("SendAudio", "event_enemyspotted", "b", "2=%!MRAD_ENEMYSPOT")
//register_event("TextMsg", "event_enemyspotted", "b", "5=#Enemy_spotted")
register_message(get_user_msgid("TextMsg"), "message_TextMsg")
g_MAXPLAYERS = get_maxplayers()
g_ONEEIGHTYTHROUGHPI = 180.0 / PI
}
/*
L 02/04/2005 - 09:47:33: [msglogging.amxx] MessageBegin ShowMenu(96) Arguments=4
Destination=One(1) Origin={0.000000 0.000000 0.000000} Entity=1 Classname=playe
r Netname=Johnny got his gun
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 1 (Short): 1023
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 2 (Char): -1
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 3 (Byte): 0
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 4 (String): #RadioC
L 02/04/2005 - 09:47:33: [msglogging.amxx] MessageEnd ShowMenu(96)
L 02/04/2005 - 09:47:33: [msglogging.amxx] MessageBegin SendAudio(100) Arguments
=3 Destination=One(1) Origin={0.000000 0.000000 0.000000} Entity=1 Classname=pla
yer Netname=Johnny got his gun
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 1 (Byte): 1
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 2 (String): %!MRAD_ENEMYSPOT
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 3 (Short): 100
L 02/04/2005 - 09:47:33: [msglogging.amxx] MessageEnd SendAudio(100)
L 02/04/2005 - 09:47:33: [msglogging.amxx] MessageBegin TextMsg(77) Arguments=5
Destination=One(1) Origin={0.000000 0.000000 0.000000} Entity=1 Classname=player
Netname=Johnny got his gun
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 1 (Byte): 5
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 2 (String): 1
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 3 (String): #Game_radio
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 4 (String): Johnny got his gun
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 5 (String): #Enemy_spotted
L 02/04/2005 - 09:47:33: [msglogging.amxx] MessageEnd TextMsg(77)
L 02/04/2005 - 09:47:33: [msglogging.amxx] MessageBegin tempentity?(23) Argument
s=5 Destination=One(1) Origin={0.000000 0.000000 0.000000} Entity=1 Classname=pl
ayer Netname=Johnny got his gun
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 1 (Byte): 124
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 2 (Byte): 1
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 3 (Coord): 35.000000
L 02/04/2005 - 09:47:33: [msglogging.amxx] Arg 4 (Short): 96
L 02/04/2005 - 09:47:34: [msglogging.amxx] Arg 5 (Short): 15
L 02/04/2005 - 09:47:34: [msglogging.amxx] MessageEnd tempentity?(23)
L 02/04/2005 - 09:47:36: [msglogging.amxx] Stopped logging of all messages
*/
-
Siska - Форум Модератор
- Предупреждения: 0
- Мнения: 531
- Регистриран на: 15 Окт 2016, 04:12
- Име в игра: Siska
7 мнения
• Страница 1 от 1
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 0 госта