Raised This Month: $ Target: $400
 0% 

Error with set_user


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shogo
New Member
Join Date: Apr 2024
Old 04-18-2024 , 03:51   Error with set_user
Reply With Quote #1

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN_VERSION "1.0"

new Float:g_fPlayerSpeed[33];
new Float:g_fPlayerJump[33];
new Float:g_fPlayerInvisibility[33];

public plugin_init() {
register_plugin("Buff Knife", PLUGIN_VERSION, "shogo");

register_event("CurWeapon", "event_curweapon", "be", "1=1");
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
register_forward(FM_PlayerPostThink, "fw_PlayerPostThink");
RegisterHam(Ham_TakeDamage, "player", "fw_PlayerTakeDamage");

register_menu("Special Knives", ADMIN_LEVEL_A, "menu_special_knives");
}

public menu_special_knives(id, level, cid) {
if (level >= ADMIN_LEVEL_A) {
new menu = menu_create("Special Knives", "menu_handler");

menu_additem(menu, "Regeneration");
menu_additem(menu, "Speed");
menu_additem(menu, "High Jump");
menu_additem(menu, "Partial Invisibility");

menu_display(id, menu, 0);
}
}

public menu_handler(id, menu, item) {
if (item != MENU_EXIT) {
switch (item) {
case 0: {
g_fPlayerSpeed[id] = 250.0;
g_fPlayerJump[id] = 300.0;
g_fPlayerInvisibility[id] = 0.5;
client_print(id, print_center, "You have equipped the Regeneration knife!");
}
case 1: {
g_fPlayerSpeed[id] = 300.0;
g_fPlayerJump[id] = 200.0;
g_fPlayerInvisibility[id] = 0.7;
client_print(id, print_center, "You have equipped the Speed knife!");
}
case 2: {
g_fPlayerSpeed[id] = 220.0;
g_fPlayerJump[id] = 400.0;
g_fPlayerInvisibility[id] = 0.6;
client_print(id, print_center, "You have equipped the High Jump knife!");
}
case 3: {
g_fPlayerSpeed[id] = 230.0;
g_fPlayerJump[id] = 250.0;
g_fPlayerInvisibility[id] = 0.4;
client_print(id, print_center, "You have equipped the Partial Invisibility knife!");
}
}
}

menu_destroy(menu);
}

public event_curweapon(id) {
static weapon;
get_user_weapon(id, weapon, _);

if (weapon == CSW_KNIFE) {
set_user_maxspeed(id, g_fPlayerSpeed[id]);
set_user_gravity(id, g_fPlayerJump[id] / 800.0);
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, floatround(g_fPlayerInvisibility[id] * 255.0));
} else {
set_user_maxspeed(id, 250.0);
set_user_gravity(id, 1.0);
set_user_rendering(id);
}
}

public fw_PlayerPreThink(id) {
if (is_user_alive(id) && get_user_weapon(id) == CSW_KNIFE) {
health_regenerate(id);
}
}

public fw_PlayerPostThink(id) {
if (is_user_alive(id) && get_user_weapon(id) == CSW_KNIFE) {
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, floatround(g_fPlayerInvisibility[id] * 255.0));
}
}

public fw_PlayerTakeDamage(victim, inflictor, attacker, Float:damage, damagebits) {
if (is_user_alive(victim) && get_user_weapon(victim) == CSW_KNIFE) {
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}

stock health_regenerate(id) {
static Float:health;
health = float(get_user_health(id));

if (health < 100.0) {
set_user_health(id, floatround(health + 0.5));
}
}

I'm getting errors

Error: Undefined symbol "set_user_maxspeed" on line 74
Error: Undefined symbol "set_user_gravity" on line 75
Error: Undefined symbol "set_user_rendering" on line 76
Error: Undefined symbol "set_user_maxspeed" on line 78
Error: Undefined symbol "set_user_gravity" on line 79
Error: Undefined symbol "set_user_rendering" on line 80
Error: Undefined symbol "set_user_rendering" on line 92
Error: Undefined symbol "set_user_health" on line 108
shogo is offline
tedaimlocks
Member
Join Date: Jan 2024
Old 04-18-2024 , 03:56   Re: Error with set_user
Reply With Quote #2

Write this at the top of the plugin

#include <fun>
tedaimlocks is offline
shogo
New Member
Join Date: Apr 2024
Old 04-18-2024 , 04:00   Re: Error with set_user
Reply With Quote #3

Quote:
Originally Posted by tedaimlocks View Post
Write this at the top of the plugin

#include <fun>
Thank you very much, I’m still sleepy and dumb)
shogo is offline
shogo
New Member
Join Date: Apr 2024
Old 04-18-2024 , 04:02   Re: Error with set_user
Reply With Quote #4

How to close topic?
shogo is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2024 , 21:03   Re: Error with set_user
Reply With Quote #5

Quote:
Originally Posted by shogo View Post
How to close topic?
Just stop posting.
__________________
fysiks 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 14:12.


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