Member
Join Date: May 2020
Location: Brazil, Curitiba, PR
|
07-18-2020
, 13:59
define ADMIN_LEVEL
|
#1
|
Hi guys,
I cannot define that, to use this command, you need administrator access.
I already put the command #define.
Can someone help me?
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "CS Revo: Camera New"
#define VERSION "1.0"
#define AUTHOR "Nani | Wilian M."
#define PREFIX "\r[\dTK'CLAN\r]"
#define PREFIXCHAT "!t[!gTK'CLAN!t]"
#define CAMERA_OWNER EV_INT_iuser1
#define CAMERA_CLASSNAME "trigger_camera"
#define CAMERA_MODEL "models/rpgrocket.mdl"
#define ADMIN_KICK
new cvar_camera_distance
new bool:g_inthird_person[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_say("/cam", "camera_menu")
register_say("cam", "camera_menu")
register_say("/camera", "camera_menu")
register_say("camera", "camera_menu")
RegisterHam(Ham_Spawn, "player", "fw_player_spawn_post", true)
register_think(CAMERA_CLASSNAME, "fw_camera_think")
cvar_camera_distance = register_cvar("cam_distance", "150")
}
public camera_menu(id)
{
new szmenu[300]
formatex(szmenu, 299, "%s \wCamera Menu", PREFIX)
new menu = menu_create(szmenu, "_camera_menu")
menu_additem(menu, g_inthird_person[id] ? "Terceira Pessoa \r[Ativado]" : "Terceira Pessoa")
menu_additem(menu, !g_inthird_person[id] ? "Normal \r[Ativado]" : "Normal")
menu_setprop(menu, MPROP_EXITNAME, "Sair")
menu_display(id, menu, 0)
}
public _camera_menu(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
switch(item)
{
case 0:
{
if(g_inthird_person[id])
{
client_print_color(id, "%s !yVoce ja esta com a camera em !tTerceira Pessoa!y.", PREFIXCHAT)
return PLUGIN_HANDLED
}
else set_cam_ent(id)
}
case 1:
{
remove_cam_ent(id, 1)
}
}
return PLUGIN_HANDLED
}
public plugin_precache() precache_model(CAMERA_MODEL)
public client_disconnect(id) remove_cam_ent(id, 0)
public fw_camera_think(ient)
{
new iowner = entity_get_int(ient, CAMERA_OWNER)
if(!is_user_alive(iowner) || is_user_bot(iowner))
return
if(!is_valid_ent(ient))
return
new Float:fplayerorigin[3], Float:fcameraorigin[3], Float:vangles[3], Float:vback[3]
entity_get_vector(iowner, EV_VEC_origin, fplayerorigin)
entity_get_vector(iowner, EV_VEC_view_ofs, vangles)
fplayerorigin[2] += vangles[2];
entity_get_vector(iowner, EV_VEC_v_angle, vangles)
angle_vector(vangles, ANGLEVECTOR_FORWARD, vback)
fcameraorigin[0] = fplayerorigin[0] + (-vback[0] * float(get_pcvar_num(cvar_camera_distance)))
fcameraorigin[1] = fplayerorigin[1] + (-vback[1] * float(get_pcvar_num(cvar_camera_distance)))
fcameraorigin[2] = fplayerorigin[2] + (-vback[2] * float(get_pcvar_num(cvar_camera_distance)))
engfunc(EngFunc_TraceLine, fplayerorigin, fcameraorigin, IGNORE_MONSTERS, iowner, 0)
new Float:flFraction; get_tr2(0, TR_flFraction, flFraction)
if(flFraction != 1.0)
{
flFraction *= get_pcvar_float(cvar_camera_distance)
fcameraorigin[0] = fplayerorigin[0] + (-vback[0] * flFraction)
fcameraorigin[1] = fplayerorigin[1] + (-vback[1] * flFraction)
fcameraorigin[2] = fplayerorigin[2] + (-vback[2] * flFraction)
}
entity_set_vector(ient, EV_VEC_origin, fcameraorigin)
entity_set_vector(ient, EV_VEC_angles, vangles)
entity_set_float(ient, EV_FL_nextthink, get_gametime())
}
public fw_player_spawn_post(id)
{
if(!is_user_alive(id))
return HAM_IGNORED
if(g_inthird_person[id])
set_cam_ent(id)
return HAM_HANDLED
}
public set_cam_ent(id)
{
new ient = create_entity(CAMERA_CLASSNAME)
if(!is_valid_ent(ient))
return
entity_set_model(ient, CAMERA_MODEL)
entity_set_int(ient, CAMERA_OWNER, id)
entity_set_string(ient, EV_SZ_classname, CAMERA_CLASSNAME)
entity_set_int(ient, EV_INT_solid, SOLID_NOT)
entity_set_int(ient, EV_INT_movetype, MOVETYPE_FLY)
entity_set_int(ient, EV_INT_rendermode, kRenderTransTexture)
attach_view(id, ient)
g_inthird_person[id] = true
entity_set_float(ient, EV_FL_nextthink, get_gametime())
}
public remove_cam_ent(id, attachview)
{
if(attachview) attach_view(id, id)
new ient = -1
while((ient = find_ent_by_class(ient, CAMERA_CLASSNAME)))
{
if(!is_valid_ent(ient))
continue
if(entity_get_int(ient, CAMERA_OWNER) == id)
{
g_inthird_person[id] = false
entity_set_int(ient, EV_INT_flags, FL_KILLME)
dllfunc(DLLFunc_Think, ient)
}
}
}
stock client_print_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "!t2", "^0")
if (id) players[0] = id; else get_players(players, count, "ch")
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
stock register_say(szsay[], szfunction[])
{
new sztemp[64]
formatex(sztemp, 63 , "say /%s", szsay)
register_clcmd(sztemp, szfunction)
formatex(sztemp, 63 , "say .%s", szsay)
register_clcmd(sztemp, szfunction)
formatex(sztemp, 63 , "say_team /%s", szsay)
register_clcmd(sztemp, szfunction )
formatex(sztemp, 63 , "say_team .%s", szsay)
register_clcmd(sztemp, szfunction)
}
__________________
Last edited by artYY; 07-19-2020 at 11:30.
|
|