Raised This Month: $51 Target: $400
 12% 

Suggestion / Subplugin Request [REQ][Addon] Radar for Nem & Sur


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
M@RSH@L
Member
Join Date: Jan 2012
Old 08-14-2015 , 13:54   [REQ][Addon] Radar for Nem & Sur
Reply With Quote #1

Hello everyone

I want to request an addon to give free radar scanner to nemesis and survivor to find humans and zombies for ZP 5.0.8.

Maybe this plugin can help in coding : [Extra Items] Radar Scanner

but this plugin doesn't work for ZP 5.0.8.

Here is the Edited Version for ZP 5 by InFiNiTi-Gamer ( Only work for Humans ):

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <zp50_items>
#include <zp50_core>
#include <zp50_class_survivor>
#include <zp50_class_nemesis>
#include <cstrike>

#define ITEM_COST 10
#define ITEM_NAME "Radar"

#define PLUGIN "Zombie Plague extra item - Radar"
#define VERSION "1.4"
#define AUTHOR "Sonic Son'edited Cold-Sky"

new g_msgHostageAddg_msgHostageDelg_maxplayersg_ItemID;

new 
player_has_radar[33];
new 
zp_radar_beep;
new 
zp_radar_show_dead;

new 
cvar_zp_radar_beep;
new 
cvar_zp_radar_single_round;
new 
cvar_zp_radar_show_dead;

new const 
sound_radar_beep[] = "zombie_plague/nes_8bit_alien3_radar_beep1.wav"


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a")
    
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")

    
g_msgHostageAdd get_user_msgid("HostagePos")
    
g_msgHostageDel get_user_msgid("HostageK")
    
    
cvar_zp_radar_beep register_cvar("zp_radar_beep""1")
    
cvar_zp_radar_single_round register_cvar("zp_radar_single_round""0")
    
cvar_zp_radar_show_dead register_cvar("zp_radar_show_dead""0")
    
    
g_maxplayers get_maxplayers()

    
g_ItemID zp_items_register(ITEM_NAMEITEM_COST)
    
    for (new 
1i<=g_maxplayers;i++) player_has_radar[i] = false;    
    
    
set_task (2.0,"radar_scan",_,_,_,"b");
}

public 
plugin_precache()
{
    
precache_sound(sound_radar_beep)
}

public 
plugin_cfg()
{
    new 
cfgdir[32]
    
get_localinfo("amxx_configsdir",cfgdir,sizeof cfgdir)
    
server_cmd("exec %s/zp_radar.cfg"cfgdir)
}

public 
event_round_start()
{
    if (
get_pcvar_num(cvar_zp_radar_beep) == 1)
        
zp_radar_beep=true;
    else
        
zp_radar_beep=false;
    
    if (
get_pcvar_num(cvar_zp_radar_show_dead) == 1)
        
zp_radar_show_dead=true;
    else
        
zp_radar_show_dead=false;
}

public 
zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_ItemIDplayer_has_radar[player] = true;
}

public 
radar_scan()
{    
    new 
zombie_count 0;
    new 
zombie_list[32];
    new 
ZombieCoords[3];
    new 
idi;
    
    for (new 
id=1id<=g_maxplayersid++)
    {
        if (
zp_radar_show_dead)
        {
            if (
zp_core_is_zombie(id))
            {
                
zombie_count++;
                
zombie_list[zombie_count]=id;
            }
        }
        else
        {
            if ((
is_user_connected(id)) && (zp_core_is_zombie(id)))
            {
                
zombie_count++;
                
zombie_list[zombie_count]=id;
            }
        }
    }
    
    for (
id=1id<=g_maxplayersid++)
    {
        if ((!
is_user_alive(id))||(!player_has_radar[id])) continue;
        
        for (
i=1;i<=zombie_count;i++)
        {            
            
get_user_origin(zombie_list[i], ZombieCoords)
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageAdd, {0,0,0}, id)
            
write_byte(id)
            
write_byte(i)        
            
write_coord(ZombieCoords[0])
            
write_coord(ZombieCoords[1])
            
write_coord(ZombieCoords[2])
            
message_end()
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageDel, {0,0,0}, id)
            
write_byte(i)
            
message_end()
        }
        if (
zp_radar_beepemit_sound(idCHAN_ITEMsound_radar_beep1.0ATTN_NORM0PITCH_NORM);
    }
}

public 
zp_user_infected_post(idinfector)
{
    
player_has_radar[id] = false;
}

public 
fw_PlayerKilled(victimattackershouldgib)
{    
    
player_has_radar[victim] = false;
}

public 
zp_round_ended(winteam)
{
    if (
get_pcvar_num(cvar_zp_radar_single_round)==1
        for (new 
id=1id<=g_maxplayersid++)
            
player_has_radar[id] = false;
}

public 
zp_fw_items_select_pre(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
        return 
ZP_ITEM_AVAILABLE;
    
    
// Radar only available to humans
    
if (zp_core_is_zombie(id))
        return 
ZP_ITEM_DONT_SHOW;
    
    
// Player already has Radar
    
if (cs_get_user_nvg(id))
        return 
ZP_ITEM_DONT_SHOW;
    
    return 
ZP_ITEM_AVAILABLE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 
Can anyone help ?

And im Sorry for Bad English
__________________
M@RSH@L is offline
Send a message via Yahoo to M@RSH@L Send a message via Skype™ to M@RSH@L
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-17-2015 , 09:50   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #2

try

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zp50_items>
#include <zp50_core>
#include <zp50_class_survivor>
#include <zp50_class_nemesis>
#include <cstrike>

#define ITEM_COST 10
#define ITEM_NAME "Radar"

#define PLUGIN "Zombie Plague extra item - Radar"
#define VERSION "1.4"
#define AUTHOR "Sonic Son'edited Cold-Sky"

new g_msgHostageAddg_msgHostageDelg_maxplayersg_ItemID;

new 
player_has_radar[33];
new 
zp_radar_beep;
new 
zp_radar_show_dead;

new 
cvar_zp_radar_beep;
new 
cvar_zp_radar_single_round;

new const 
sound_radar_beep[] = "zombie_plague/nes_8bit_alien3_radar_beep1.wav"


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a")
    
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")

    
g_msgHostageAdd get_user_msgid("HostagePos")
    
g_msgHostageDel get_user_msgid("HostageK")
    
    
cvar_zp_radar_beep register_cvar("zp_radar_beep""1")
    
cvar_zp_radar_single_round register_cvar("zp_radar_single_round""0")
    
    
g_maxplayers get_maxplayers()

    
g_ItemID zp_items_register(ITEM_NAMEITEM_COST)
    
    for (new 
1i<=g_maxplayers;i++) player_has_radar[i] = false;    
    
    
set_task (2.0,"radar_scan",_,_,_,"b");
}

public 
plugin_precache()
{
    
precache_sound(sound_radar_beep)
}

public 
plugin_cfg()
{
    new 
cfgdir[32]
    
get_localinfo("amxx_configsdir",cfgdir,sizeof cfgdir)
    
server_cmd("exec %s/zp_radar.cfg"cfgdir)
}

public 
event_round_start()
{
    if (
get_pcvar_num(cvar_zp_radar_beep) == 1)
        
zp_radar_beep=true;
    else
        
zp_radar_beep=false;
    
    if (
get_pcvar_num(cvar_zp_radar_show_dead) == 1)
        
zp_radar_show_dead=true;
    else
        
zp_radar_show_dead=false;
}

public 
zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_ItemIDplayer_has_radar[player] = true;
}

public 
radar_scan()
{    
    new 
zombie_count 0;
    new 
human_count 0;
    new 
human_list[32];
    new 
zombie_list[32];
    new 
ZombieCoords[3];
    new 
HumanCoords[3];
    new 
idi;
    
    for (new 
id=1id<=g_maxplayersid++)
    {
            if ((
is_user_connected(id))
            {
            if(!
zp_core_is_zombie(id) && zp_class_survivor_get(id))
        {
            
zombie_count++;
            
zombie_list[zombie_count]=id;
        }
        if(
zp_core_is_zombie(id) && zp_class_nemesis_get(id))
        {
            
human_count++;
            
human_list[human_count]=id;
        }
            }
        
        }
    }
    
    for (
id=1id<=g_maxplayersid++)
    {
        if ((!
is_user_alive(id))||(!player_has_radar[id])) continue;
        
    if(!
zp_core_is_zombie(id) && zp_class_survivor_get(id))
    {
        for (
i=1;i<=zombie_count;i++)
        {            
            
get_user_origin(zombie_list[i], ZombieCoords)
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageAdd, {0,0,0}, id)
            
write_byte(id)
            
write_byte(i)        
            
write_coord(ZombieCoords[0])
            
write_coord(ZombieCoords[1])
            
write_coord(ZombieCoords[2])
            
message_end()
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageDel, {0,0,0}, id)
            
write_byte(i)
            
message_end()
        }
    }
    if(
zp_core_is_zombie(id) && zp_class_nemesis_get(id))
    {
        for (
i=1;i<=human_count;i++)
        {            
            
get_user_origin(human_list[i], HumanCoords)
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageAdd, {0,0,0}, id)
            
write_byte(id)
            
write_byte(i)        
            
write_coord(HumanCoords[0])
            
write_coord(HumanCoords[1])
            
write_coord(HumanCoords[2])
            
message_end()
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageDel, {0,0,0}, id)
            
write_byte(i)
            
message_end()
        }
    }
        if (
zp_radar_beepemit_sound(idCHAN_ITEMsound_radar_beep1.0ATTN_NORM0PITCH_NORM);
    }
}

public 
zp_user_infected_post(idinfector)
{
    if(
zp_class_nemesis_get(id))
    {
        
player_has_radar[id] = true;
    }
    else
    {
        
player_has_radar[id] = false;
    }
}

public 
zp_fw_core_cure_post(id)
{
    if(
zp_class_survivor_get(id))
    {
        
player_has_radar[id] = true;
    }
    else
    {
        
player_has_radar[id] = false;
    }
}

public 
fw_PlayerKilled(victimattackershouldgib)
{    
    
player_has_radar[victim] = false;
}

public 
zp_round_ended(winteam)
{
    if (
get_pcvar_num(cvar_zp_radar_single_round)==1
        for (new 
id=1id<=g_maxplayersid++)
            
player_has_radar[id] = false;
}

public 
zp_fw_items_select_pre(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
        return 
ZP_ITEM_AVAILABLE;
    
    
// Radar only available to humans
    
if (zp_core_is_zombie(id))
        return 
ZP_ITEM_DONT_SHOW;
    
    
// Player already has Radar
    
if (cs_get_user_nvg(id))
        return 
ZP_ITEM_DONT_SHOW;
    
    return 
ZP_ITEM_AVAILABLE;


Last edited by Depresie; 08-17-2015 at 09:52.
Depresie is offline
M@RSH@L
Member
Join Date: Jan 2012
Old 08-17-2015 , 12:15   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #3

Quote:
Originally Posted by Depresie View Post
try

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zp50_items>
#include <zp50_core>
#include <zp50_class_survivor>
#include <zp50_class_nemesis>
#include <cstrike>

#define ITEM_COST 10
#define ITEM_NAME "Radar"

#define PLUGIN "Zombie Plague extra item - Radar"
#define VERSION "1.4"
#define AUTHOR "Sonic Son'edited Cold-Sky"

new g_msgHostageAddg_msgHostageDelg_maxplayersg_ItemID;

new 
player_has_radar[33];
new 
zp_radar_beep;
new 
zp_radar_show_dead;

new 
cvar_zp_radar_beep;
new 
cvar_zp_radar_single_round;

new const 
sound_radar_beep[] = "zombie_plague/nes_8bit_alien3_radar_beep1.wav"


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a")
    
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")

    
g_msgHostageAdd get_user_msgid("HostagePos")
    
g_msgHostageDel get_user_msgid("HostageK")
    
    
cvar_zp_radar_beep register_cvar("zp_radar_beep""1")
    
cvar_zp_radar_single_round register_cvar("zp_radar_single_round""0")
    
    
g_maxplayers get_maxplayers()

    
g_ItemID zp_items_register(ITEM_NAMEITEM_COST)
    
    for (new 
1i<=g_maxplayers;i++) player_has_radar[i] = false;    
    
    
set_task (2.0,"radar_scan",_,_,_,"b");
}

public 
plugin_precache()
{
    
precache_sound(sound_radar_beep)
}

public 
plugin_cfg()
{
    new 
cfgdir[32]
    
get_localinfo("amxx_configsdir",cfgdir,sizeof cfgdir)
    
server_cmd("exec %s/zp_radar.cfg"cfgdir)
}

public 
event_round_start()
{
    if (
get_pcvar_num(cvar_zp_radar_beep) == 1)
        
zp_radar_beep=true;
    else
        
zp_radar_beep=false;
    
    if (
get_pcvar_num(cvar_zp_radar_show_dead) == 1)
        
zp_radar_show_dead=true;
    else
        
zp_radar_show_dead=false;
}

public 
zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_ItemIDplayer_has_radar[player] = true;
}

public 
radar_scan()
{    
    new 
zombie_count 0;
    new 
human_count 0;
    new 
human_list[32];
    new 
zombie_list[32];
    new 
ZombieCoords[3];
    new 
HumanCoords[3];
    new 
idi;
    
    for (new 
id=1id<=g_maxplayersid++)
    {
            if ((
is_user_connected(id))
            {
            if(!
zp_core_is_zombie(id) && zp_class_survivor_get(id))
        {
            
zombie_count++;
            
zombie_list[zombie_count]=id;
        }
        if(
zp_core_is_zombie(id) && zp_class_nemesis_get(id))
        {
            
human_count++;
            
human_list[human_count]=id;
        }
            }
        
        }
    }
    
    for (
id=1id<=g_maxplayersid++)
    {
        if ((!
is_user_alive(id))||(!player_has_radar[id])) continue;
        
    if(!
zp_core_is_zombie(id) && zp_class_survivor_get(id))
    {
        for (
i=1;i<=zombie_count;i++)
        {            
            
get_user_origin(zombie_list[i], ZombieCoords)
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageAdd, {0,0,0}, id)
            
write_byte(id)
            
write_byte(i)        
            
write_coord(ZombieCoords[0])
            
write_coord(ZombieCoords[1])
            
write_coord(ZombieCoords[2])
            
message_end()
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageDel, {0,0,0}, id)
            
write_byte(i)
            
message_end()
        }
    }
    if(
zp_core_is_zombie(id) && zp_class_nemesis_get(id))
    {
        for (
i=1;i<=human_count;i++)
        {            
            
get_user_origin(human_list[i], HumanCoords)
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageAdd, {0,0,0}, id)
            
write_byte(id)
            
write_byte(i)        
            
write_coord(HumanCoords[0])
            
write_coord(HumanCoords[1])
            
write_coord(HumanCoords[2])
            
message_end()
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgHostageDel, {0,0,0}, id)
            
write_byte(i)
            
message_end()
        }
    }
        if (
zp_radar_beepemit_sound(idCHAN_ITEMsound_radar_beep1.0ATTN_NORM0PITCH_NORM);
    }
}

public 
zp_user_infected_post(idinfector)
{
    if(
zp_class_nemesis_get(id))
    {
        
player_has_radar[id] = true;
    }
    else
    {
        
player_has_radar[id] = false;
    }
}

public 
zp_fw_core_cure_post(id)
{
    if(
zp_class_survivor_get(id))
    {
        
player_has_radar[id] = true;
    }
    else
    {
        
player_has_radar[id] = false;
    }
}

public 
fw_PlayerKilled(victimattackershouldgib)
{    
    
player_has_radar[victim] = false;
}

public 
zp_round_ended(winteam)
{
    if (
get_pcvar_num(cvar_zp_radar_single_round)==1
        for (new 
id=1id<=g_maxplayersid++)
            
player_has_radar[id] = false;
}

public 
zp_fw_items_select_pre(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
        return 
ZP_ITEM_AVAILABLE;
    
    
// Radar only available to humans
    
if (zp_core_is_zombie(id))
        return 
ZP_ITEM_DONT_SHOW;
    
    
// Player already has Radar
    
if (cs_get_user_nvg(id))
        return 
ZP_ITEM_DONT_SHOW;
    
    return 
ZP_ITEM_AVAILABLE;

I appreciate for your help.

i got these errors when try to compile:

PHP Code:
//// zp_addon_radar.sma
// zp_addon_radar.sma(70) : error 017: undefined symbol "cvar_zp_radar_show_dead"
// zp_addon_radar.sma(94) : error 028: invalid subscript (not an array or too many subscripts): "is_user_connected"
// zp_addon_radar.sma(95) : error 001: expected token: "}", but found "if"
// zp_addon_radar.sma(100) : warning 217: loose indentation
// zp_addon_radar.sma(107) : warning 203: symbol is never used: "i"
// zp_addon_radar.sma(107) : warning 203: symbol is never used: "id"
// zp_addon_radar.sma(107) : warning 204: symbol is assigned a value that is never used: "HumanCoords"
// zp_addon_radar.sma(107) : warning 204: symbol is assigned a value that is never used: "ZombieCoords"
// zp_addon_radar.sma(108) : error 054: unmatched closing brace
// zp_addon_radar.sma(110) : error 010: invalid function or declaration
// zp_addon_radar.sma(112) : error 010: invalid function or declaration
// zp_addon_radar.sma(114) : error 010: invalid function or declaration
// zp_addon_radar.sma(116) : error 010: invalid function or declaration
// zp_addon_radar.sma(120) : error 021: symbol already defined: "message_begin"
// zp_addon_radar.sma(128) : error 021: symbol already defined: "message_begin"
// zp_addon_radar.sma(133) : error 010: invalid function or declaration
// zp_addon_radar.sma(135) : error 010: invalid function or declaration
// zp_addon_radar.sma(139) : error 021: symbol already defined: "message_begin"
// zp_addon_radar.sma(147) : error 021: symbol already defined: "message_begin"
// zp_addon_radar.sma(152) : error 010: invalid function or declaration
// zp_addon_radar.sma(207) : warning 204: symbol is assigned a value that is never used: "g_msgHostageAdd"
// zp_addon_radar.sma(207) : warning 204: symbol is assigned a value that is never used: "g_msgHostageDel"
// zp_addon_radar.sma(207) : warning 204: symbol is assigned a value that is never used: "zp_radar_beep"
// zp_addon_radar.sma(207) : warning 204: symbol is assigned a value that is never used: "zp_radar_show_dead"
//
// 15 Errors. 
__________________
M@RSH@L is offline
Send a message via Yahoo to M@RSH@L Send a message via Skype™ to M@RSH@L
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-18-2015 , 12:42   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #4

Code:
#include <amxmodx>
#include <hamsandwich>
#include <zp50_items>
#include <zp50_core>
#include <zp50_class_survivor>
#include <zp50_class_nemesis>
#include <cstrike>

#define ITEM_COST 10
#define ITEM_NAME "Radar"

#define PLUGIN "Zombie Plague extra item - Radar"
#define VERSION "1.4"
#define AUTHOR "Sonic Son'edited Cold-Sky"

new g_msgHostageAdd, g_msgHostageDel, g_maxplayers, g_ItemID;

new player_has_radar[33];
new zp_radar_beep;
new zp_radar_show_dead;

new cvar_zp_radar_beep;
new cvar_zp_radar_single_round;

new const sound_radar_beep[] = "zombie_plague/nes_8bit_alien3_radar_beep1.wav"


public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("HLTV", "event_round_start", "a")
    
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")

    g_msgHostageAdd = get_user_msgid("HostagePos")
    g_msgHostageDel = get_user_msgid("HostageK")
    
    cvar_zp_radar_beep = register_cvar("zp_radar_beep", "1")
    cvar_zp_radar_single_round = register_cvar("zp_radar_single_round", "0")
    
    g_maxplayers = get_maxplayers()

    g_ItemID = zp_items_register(ITEM_NAME, ITEM_COST)
    
    for (new i = 1; i<=g_maxplayers;i++) player_has_radar[i] = false;    
    
    set_task (2.0,"radar_scan",_,_,_,"b");
}

public plugin_precache()
{
    precache_sound(sound_radar_beep)
}

public plugin_cfg()
{
    new cfgdir[32]
    get_localinfo("amxx_configsdir",cfgdir,sizeof cfgdir)
    server_cmd("exec %s/zp_radar.cfg", cfgdir)
}

public event_round_start()
{
    if (get_pcvar_num(cvar_zp_radar_beep) == 1)
        zp_radar_beep=true;
    else
        zp_radar_beep=false;
    
    if (get_pcvar_num(cvar_zp_radar_show_dead) == 1)
        zp_radar_show_dead=true;
    else
        zp_radar_show_dead=false;
}

public zp_extra_item_selected(player, itemid)
{
    if (itemid == g_ItemID) player_has_radar[player] = true;
}

public radar_scan()
{    
    new zombie_count = 0;
    new human_count = 0;
    new human_list[32];
    new zombie_list[32];
    new ZombieCoords[3];
    new HumanCoords[3];
    new id, i;
    
    for (new id=1; id<=g_maxplayers; id++)
    {
            if ((is_user_connected(id))
            {
        if(!zp_core_is_zombie(id) && zp_class_survivor_get(id))
        {
            zombie_count++;
            zombie_list[zombie_count]=id;
        }
        if(zp_core_is_zombie(id) && zp_class_nemesis_get(id))
        {
        human_count++;
        human_list[human_count]=id;
        }
            }
        
     }

    
    for (id=1; id<=g_maxplayers; id++)
    {
        
    if ((!is_user_alive(id))||(!player_has_radar[id])) continue;
        
    if(!zp_core_is_zombie(id) && zp_class_survivor_get(id))
    {
        for (i=1;i<=zombie_count;i++)
        {            
            get_user_origin(zombie_list[i], ZombieCoords)
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
            write_byte(id)
            write_byte(i)        
            write_coord(ZombieCoords[0])
            write_coord(ZombieCoords[1])
            write_coord(ZombieCoords[2])
            message_end()
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
            write_byte(i)
            message_end()
        }
    }
    if(zp_core_is_zombie(id) && zp_class_nemesis_get(id))
    {
        for (i=1;i<=human_count;i++)
        {            
            get_user_origin(human_list[i], HumanCoords)
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
            write_byte(id)
            write_byte(i)        
            write_coord(HumanCoords[0])
            write_coord(HumanCoords[1])
            write_coord(HumanCoords[2])
            message_end()
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
            write_byte(i)
            message_end()
        }
    }
        if (zp_radar_beep) emit_sound(id, CHAN_ITEM, sound_radar_beep, 1.0, ATTN_NORM, 0, PITCH_NORM);
    }
}

public zp_user_infected_post(id, infector)
{
    if(zp_class_nemesis_get(id))
    {
        player_has_radar[id] = true;
    }
    else
    {
        player_has_radar[id] = false;
    }
}

public zp_fw_core_cure_post(id)
{
    if(zp_class_survivor_get(id))
    {
        player_has_radar[id] = true;
    }
    else
    {
        player_has_radar[id] = false;
    }
}

public fw_PlayerKilled(victim, attacker, shouldgib)
{    
    player_has_radar[victim] = false;
}

public zp_round_ended(winteam)
{
    if (get_pcvar_num(cvar_zp_radar_single_round)==1) 
        for (new id=1; id<=g_maxplayers; id++)
            player_has_radar[id] = false;
}

public zp_fw_items_select_pre(id, itemid, ignorecost)
{
    // This is not our item
    if (itemid != g_ItemID)
        return ZP_ITEM_AVAILABLE;
    
    // Radar only available to humans
    if (zp_core_is_zombie(id))
        return ZP_ITEM_DONT_SHOW;
    
    // Player already has Radar
    if (cs_get_user_nvg(id))
        return ZP_ITEM_DONT_SHOW;
    
    return ZP_ITEM_AVAILABLE;
}
Depresie is offline
M@RSH@L
Member
Join Date: Jan 2012
Old 08-18-2015 , 15:28   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #5

Quote:
Originally Posted by Depresie View Post
Code:
#include <amxmodx>
#include <hamsandwich>
#include <zp50_items>
#include <zp50_core>
#include <zp50_class_survivor>
#include <zp50_class_nemesis>
#include <cstrike>

#define ITEM_COST 10
#define ITEM_NAME "Radar"

#define PLUGIN "Zombie Plague extra item - Radar"
#define VERSION "1.4"
#define AUTHOR "Sonic Son'edited Cold-Sky"

new g_msgHostageAdd, g_msgHostageDel, g_maxplayers, g_ItemID;

new player_has_radar[33];
new zp_radar_beep;
new zp_radar_show_dead;

new cvar_zp_radar_beep;
new cvar_zp_radar_single_round;

new const sound_radar_beep[] = "zombie_plague/nes_8bit_alien3_radar_beep1.wav"


public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("HLTV", "event_round_start", "a")
    
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")

    g_msgHostageAdd = get_user_msgid("HostagePos")
    g_msgHostageDel = get_user_msgid("HostageK")
    
    cvar_zp_radar_beep = register_cvar("zp_radar_beep", "1")
    cvar_zp_radar_single_round = register_cvar("zp_radar_single_round", "0")
    
    g_maxplayers = get_maxplayers()

    g_ItemID = zp_items_register(ITEM_NAME, ITEM_COST)
    
    for (new i = 1; i<=g_maxplayers;i++) player_has_radar[i] = false;    
    
    set_task (2.0,"radar_scan",_,_,_,"b");
}

public plugin_precache()
{
    precache_sound(sound_radar_beep)
}

public plugin_cfg()
{
    new cfgdir[32]
    get_localinfo("amxx_configsdir",cfgdir,sizeof cfgdir)
    server_cmd("exec %s/zp_radar.cfg", cfgdir)
}

public event_round_start()
{
    if (get_pcvar_num(cvar_zp_radar_beep) == 1)
        zp_radar_beep=true;
    else
        zp_radar_beep=false;
    
    if (get_pcvar_num(cvar_zp_radar_show_dead) == 1)
        zp_radar_show_dead=true;
    else
        zp_radar_show_dead=false;
}

public zp_extra_item_selected(player, itemid)
{
    if (itemid == g_ItemID) player_has_radar[player] = true;
}

public radar_scan()
{    
    new zombie_count = 0;
    new human_count = 0;
    new human_list[32];
    new zombie_list[32];
    new ZombieCoords[3];
    new HumanCoords[3];
    new id, i;
    
    for (new id=1; id<=g_maxplayers; id++)
    {
            if ((is_user_connected(id))
            {
        if(!zp_core_is_zombie(id) && zp_class_survivor_get(id))
        {
            zombie_count++;
            zombie_list[zombie_count]=id;
        }
        if(zp_core_is_zombie(id) && zp_class_nemesis_get(id))
        {
        human_count++;
        human_list[human_count]=id;
        }
            }
        
     }

    
    for (id=1; id<=g_maxplayers; id++)
    {
        
    if ((!is_user_alive(id))||(!player_has_radar[id])) continue;
        
    if(!zp_core_is_zombie(id) && zp_class_survivor_get(id))
    {
        for (i=1;i<=zombie_count;i++)
        {            
            get_user_origin(zombie_list[i], ZombieCoords)
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
            write_byte(id)
            write_byte(i)        
            write_coord(ZombieCoords[0])
            write_coord(ZombieCoords[1])
            write_coord(ZombieCoords[2])
            message_end()
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
            write_byte(i)
            message_end()
        }
    }
    if(zp_core_is_zombie(id) && zp_class_nemesis_get(id))
    {
        for (i=1;i<=human_count;i++)
        {            
            get_user_origin(human_list[i], HumanCoords)
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
            write_byte(id)
            write_byte(i)        
            write_coord(HumanCoords[0])
            write_coord(HumanCoords[1])
            write_coord(HumanCoords[2])
            message_end()
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
            write_byte(i)
            message_end()
        }
    }
        if (zp_radar_beep) emit_sound(id, CHAN_ITEM, sound_radar_beep, 1.0, ATTN_NORM, 0, PITCH_NORM);
    }
}

public zp_user_infected_post(id, infector)
{
    if(zp_class_nemesis_get(id))
    {
        player_has_radar[id] = true;
    }
    else
    {
        player_has_radar[id] = false;
    }
}

public zp_fw_core_cure_post(id)
{
    if(zp_class_survivor_get(id))
    {
        player_has_radar[id] = true;
    }
    else
    {
        player_has_radar[id] = false;
    }
}

public fw_PlayerKilled(victim, attacker, shouldgib)
{    
    player_has_radar[victim] = false;
}

public zp_round_ended(winteam)
{
    if (get_pcvar_num(cvar_zp_radar_single_round)==1) 
        for (new id=1; id<=g_maxplayers; id++)
            player_has_radar[id] = false;
}

public zp_fw_items_select_pre(id, itemid, ignorecost)
{
    // This is not our item
    if (itemid != g_ItemID)
        return ZP_ITEM_AVAILABLE;
    
    // Radar only available to humans
    if (zp_core_is_zombie(id))
        return ZP_ITEM_DONT_SHOW;
    
    // Player already has Radar
    if (cs_get_user_nvg(id))
        return ZP_ITEM_DONT_SHOW;
    
    return ZP_ITEM_AVAILABLE;
}
PHP Code:
//// zp_addon_radar.sma
// zp_addon_radar.sma(70) : error 017: undefined symbol "cvar_zp_radar_show_dead"
// zp_addon_radar.sma(94) : error 028: invalid subscript (not an array or too many subscripts): "is_user_connected"
// zp_addon_radar.sma(95) : error 001: expected token: "}", but found "if"
// zp_addon_radar.sma(100) : warning 217: loose indentation
// zp_addon_radar.sma(107) : warning 203: symbol is never used: "i"
// zp_addon_radar.sma(107) : warning 203: symbol is never used: "id"
// zp_addon_radar.sma(107) : warning 204: symbol is assigned a value that is never used: "HumanCoords"
// zp_addon_radar.sma(107) : warning 204: symbol is assigned a value that is never used: "ZombieCoords"
// zp_addon_radar.sma(110) : error 010: invalid function or declaration
// zp_addon_radar.sma(113) : error 010: invalid function or declaration
// zp_addon_radar.sma(115) : error 010: invalid function or declaration
// zp_addon_radar.sma(117) : error 010: invalid function or declaration
// zp_addon_radar.sma(121) : error 021: symbol already defined: "message_begin"
// zp_addon_radar.sma(129) : error 021: symbol already defined: "message_begin"
// zp_addon_radar.sma(134) : error 010: invalid function or declaration
// zp_addon_radar.sma(136) : error 010: invalid function or declaration
// zp_addon_radar.sma(140) : error 021: symbol already defined: "message_begin"
// zp_addon_radar.sma(148) : error 021: symbol already defined: "message_begin"
// zp_addon_radar.sma(153) : error 010: invalid function or declaration
// zp_addon_radar.sma(208) : warning 204: symbol is assigned a value that is never used: "g_msgHostageAdd"
// zp_addon_radar.sma(208) : warning 204: symbol is assigned a value that is never used: "g_msgHostageDel"
// zp_addon_radar.sma(208) : warning 204: symbol is assigned a value that is never used: "zp_radar_beep"
// zp_addon_radar.sma(208) : warning 204: symbol is assigned a value that is never used: "zp_radar_show_dead"
//
// 14 Errors.
// Could not locate output file compiled\zp_addon_radar.amx (compile failed). 
__________________
M@RSH@L is offline
Send a message via Yahoo to M@RSH@L Send a message via Skype™ to M@RSH@L
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-19-2015 , 08:31   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #6

will come later with an edit, btw did you use this plugin before? are you sure it is working?

Last edited by Depresie; 08-19-2015 at 08:33.
Depresie is offline
M@RSH@L
Member
Join Date: Jan 2012
Old 08-19-2015 , 16:16   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #7

Thanks Bro.

Yes, works fine as extra
__________________
M@RSH@L is offline
Send a message via Yahoo to M@RSH@L Send a message via Skype™ to M@RSH@L
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-21-2015 , 07:44   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #8

it should compile now, ignore the loose indentation warning
test in game and tell me if it works as you want
sorry for being late, i was pretty busy these days

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <zp50_items>
#include <zp50_core>
#include <zp50_class_survivor>
#include <zp50_class_nemesis>
#include <cstrike>

#define ITEM_COST 10
#define ITEM_NAME "Radar"

#define PLUGIN "Zombie Plague extra item - Radar"
#define VERSION "1.4"
#define AUTHOR "Sonic Son'edited Cold-Sky"

new g_msgHostageAdd, g_msgHostageDel, g_maxplayers, g_ItemID;

new player_has_radar[33];
new zp_radar_beep;
new zp_radar_show_dead;

new cvar_zp_radar_beep;
new cvar_zp_radar_single_round;
new cvar_zp_radar_show_dead;

new const sound_radar_beep[] = "zombie_plague/nes_8bit_alien3_radar_beep1.wav"


public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("HLTV", "event_round_start", "a")
    
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")

    g_msgHostageAdd = get_user_msgid("HostagePos")
    g_msgHostageDel = get_user_msgid("HostageK")
    
    cvar_zp_radar_beep = register_cvar("zp_radar_beep", "1")
    cvar_zp_radar_single_round = register_cvar("zp_radar_single_round", "0")
    cvar_zp_radar_show_dead = register_cvar("zp_radar_show_dead", "0")
    
    g_maxplayers = get_maxplayers()

    g_ItemID = zp_items_register(ITEM_NAME, ITEM_COST)
    
    for (new i = 1; i<=g_maxplayers;i++) player_has_radar[i] = false;    
    
    set_task (2.0,"radar_scan",_,_,_,"b");
}

public plugin_precache()
{
    precache_sound(sound_radar_beep)
}

public plugin_cfg()
{
    new cfgdir[32]
    get_localinfo("amxx_configsdir",cfgdir,sizeof cfgdir)
    server_cmd("exec %s/zp_radar.cfg", cfgdir)
}

public event_round_start()
{
    if (get_pcvar_num(cvar_zp_radar_beep) == 1)
        zp_radar_beep=true;
    else
        zp_radar_beep=false;
    
    if (get_pcvar_num(cvar_zp_radar_show_dead) == 1)
        zp_radar_show_dead=true;
    else
        zp_radar_show_dead=false;
}

public zp_extra_item_selected(player, itemid)
{
    if (itemid == g_ItemID) player_has_radar[player] = true;
}

public radar_scan()
{    
    new zombie_count = 0;
    new human_count = 0;
    new zombie_list[32];
    new human_list[32];
    new ZombieCoords[3];
    new HumanCoords[3];
    new id, i;
    
    for (new id=1; id<=g_maxplayers; id++)
    {
        if (zp_radar_show_dead)
        {
            if (zp_core_is_zombie(id))
            {
                zombie_count++;
                zombie_list[zombie_count]=id;
            }
       else
       {
        human_count++;
        human_list[human_count]=id;
       }
        }
        else
        {
            if (is_user_connected(id))
            {
            if(zp_core_is_zombie(id))
        {
            zombie_count++;
            zombie_list[zombie_count]=id;
        }
        else
        {
            human_count++;
            human_list[human_count]=id;
        }
            }
        }
    }
    
    for (id=1; id<=g_maxplayers; id++)
    {
        if ((!is_user_alive(id))||(!player_has_radar[id])) continue;
    
    if(zp_core_is_zombie(id))
    {
        
        for (i=1;i<=zombie_count;i++)
        {            
            get_user_origin(zombie_list[i], ZombieCoords)
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
            write_byte(id)
            write_byte(i)        
            write_coord(ZombieCoords[0])
            write_coord(ZombieCoords[1])
            write_coord(ZombieCoords[2])
            message_end()
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
            write_byte(i)
            message_end()
        }
    }
    else
    {
        for (i=1;i<=human_count;i++)
        {            
            get_user_origin(human_list[i], HumanCoords)
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
            write_byte(id)
            write_byte(i)        
            write_coord(HumanCoords[0])
            write_coord(HumanCoords[1])
            write_coord(HumanCoords[2])
            message_end()
        
            message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
            write_byte(i)
            message_end()
        }
    }    
        
        if (zp_radar_beep) emit_sound(id, CHAN_ITEM, sound_radar_beep, 1.0, ATTN_NORM, 0, PITCH_NORM);
    }
}

public zp_fw_core_infect_post(id, infector)
{
    if(zp_class_nemesis_get(id))
    {
        player_has_radar[id] = false;
    }
    else
    {
        player_has_radar[id] = false;
    }
}

public zp_fw_core_cure_post(id)
{
    if(zp_class_survivor_get(id))
    {
        player_has_radar[id] = false;
    }
    else
    {
        player_has_radar[id] = false;
    }
}

public fw_PlayerKilled(victim, attacker, shouldgib)
{    
    player_has_radar[victim] = false;
}

public zp_round_ended(winteam)
{
    if (get_pcvar_num(cvar_zp_radar_single_round)==1) 
        for (new id=1; id<=g_maxplayers; id++)
            player_has_radar[id] = false;
}

public zp_fw_items_select_pre(id, itemid, ignorecost)
{
    // This is not our item
    if (itemid != g_ItemID)
        return ZP_ITEM_AVAILABLE;
    
    // Radar only available to humans
    if (zp_core_is_zombie(id))
        return ZP_ITEM_DONT_SHOW;
    
    // Player already has Radar
    if (cs_get_user_nvg(id))
        return ZP_ITEM_DONT_SHOW;
    
    return ZP_ITEM_AVAILABLE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/

Last edited by Depresie; 08-21-2015 at 07:44.
Depresie is offline
M@RSH@L
Member
Join Date: Jan 2012
Old 08-22-2015 , 07:12   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #9

Wow Nice , it compiled with no error.

i tested the plugin in my local server with podbot it does not show anything on radar when i was nem or sur
__________________
M@RSH@L is offline
Send a message via Yahoo to M@RSH@L Send a message via Skype™ to M@RSH@L
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-22-2015 , 07:55   Re: [REQ][Addon] Radar for Nem & Sur
Reply With Quote #10

try the version you gave me, and tell me if it was showing anything on the radar
if it does, turn yourself in survivor and one more player in survivor, see if it is showing anything on radar
Depresie is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode