ワンクリックで
amxx-modding-kit-api-player-effects
Guide for Player Effects API enabling timed effects with invoke/revoke lifecycle and state management.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Guide for Player Effects API enabling timed effects with invoke/revoke lifecycle and state management.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Guide for implementing custom weapons using OOP-style patterns in AMX Mod X. Use when creating new weapons or extending existing ones with the Custom Weapons API.
This skill is describing how to use AMXX Modding Kit for AMX Mod X plugin development.
Helps with AMX Mod X (Pawn) coding conventions and best practices.
Best practices for organizing large AMX Mod X projects with multiple plugins sharing entities, weapons, events, and other definitions. Use when creating mod-scale projects that need consistent namespace patterns and shared constants.
Guide for Assets API usage managing models, sounds, and resources from JSON configuration files.
Guide for implementing custom entities using OOP-style patterns in AMX Mod X. Use when creating projectiles, pickups, NPCs, or any custom game entity with the Custom Entities API.
| name | amxx-modding-kit-api-player-effects |
| description | Guide for Player Effects API enabling timed effects with invoke/revoke lifecycle and state management. |
Timed player effects system with registration, invoke/revoke callbacks, and automatic expiration.
For complete API documentation, see README.md.
Register effects in plugin_init:
#define EFFECT_SPEED_BOOST "speed-boost"
#define EFFECT_INVINCIBILITY "invincibility"
public plugin_init() {
register_plugin("Player Effects", "1.0", "Author");
// Register with invoke and revoke callbacks
PlayerEffect_Register(
EFFECT_SPEED_BOOST,
"Callback_Effect_SpeedBoost_Invoke",
"Callback_Effect_SpeedBoost_Revoke",
"icon_speed", // Optional icon
{0, 255, 0} // Optional color (RGB)
);
PlayerEffect_Register(
EFFECT_INVINCIBILITY,
"Callback_Effect_Invincibility_Invoke",
"Callback_Effect_Invincibility_Revoke"
);
}
public Callback_Effect_SpeedBoost_Invoke(const pPlayer) {
set_pev(pPlayer, pev_maxspeed, 400.0);
client_print(pPlayer, print_chat, "Speed boost activated!");
}
public Callback_Effect_SpeedBoost_Revoke(const pPlayer) {
set_pev(pPlayer, pev_maxspeed, 250.0);
client_print(pPlayer, print_chat, "Speed boost expired.");
}
public Callback_Effect_Invincibility_Invoke(const pPlayer) {
set_pev(pPlayer, pev_takedamage, DAMAGE_NO);
client_print(pPlayer, print_chat, "Invincibility activated!");
}
public Callback_Effect_Invincibility_Revoke(const pPlayer) {
set_pev(pPlayer, pev_takedamage, DAMAGE_AIM);
client_print(pPlayer, print_chat, "Invincibility expired.");
}
// Apply effect with duration (seconds)
PlayerEffect_Set(pPlayer, EFFECT_SPEED_BOOST, true, 10.0);
// Apply effect permanently (no auto-expire)
PlayerEffect_Set(pPlayer, EFFECT_INVINCIBILITY, true, 0.0);
// Remove effect immediately
PlayerEffect_Set(pPlayer, EFFECT_SPEED_BOOST, false);
// Check if effect is active
if (PlayerEffect_Get(pPlayer, EFFECT_SPEED_BOOST)) {
// Effect is active
}
// Get effect end time
new Float:flEndTime = PlayerEffect_GetEndtime(pPlayer, EFFECT_SPEED_BOOST);
// Get effect duration
new Float:flDuration = PlayerEffect_GetDuration(pPlayer, EFFECT_SPEED_BOOST);
// Calculate remaining time
new Float:flRemaining = flEndTime - get_gametime();
#define EFFECT_MOONGRAVITY "moongravity"
#define MOON_GRAVITY 0.165
public plugin_init() {
PlayerEffect_Register(EFFECT_MOONGRAVITY, "Callback_Effect_Moon_Invoke", "Callback_Effect_Moon_Revoke", "icon_moon", {64, 64, 255});
register_clcmd("say /moon", "Command_MoonGravity");
}
public Callback_Effect_Moon_Invoke(const pPlayer) {
set_pev(pPlayer, pev_gravity, MOON_GRAVITY);
client_print(pPlayer, print_chat, "Moon gravity activated!");
}
public Callback_Effect_Moon_Revoke(const pPlayer) {
set_pev(pPlayer, pev_gravity, 1.0);
client_print(pPlayer, print_chat, "Gravity normalized.");
}
public Command_MoonGravity(const pPlayer) {
PlayerEffect_Set(pPlayer, EFFECT_MOONGRAVITY, true, 10.0);
return PLUGIN_HANDLED;
}
// Check if already has effect before applying
if (!PlayerEffect_Get(pPlayer, EFFECT_SPEED_BOOST)) {
PlayerEffect_Set(pPlayer, EFFECT_SPEED_BOOST, true, 5.0);
} else {
// Extend duration by getting current end time and adding more
new Float:flCurrentEnd = PlayerEffect_GetEndtime(pPlayer, EFFECT_SPEED_BOOST);
new Float:flNewDuration = (flCurrentEnd - get_gametime()) + 5.0;
PlayerEffect_Set(pPlayer, EFFECT_SPEED_BOOST, true, flNewDuration);
}