Try this, made comments for you.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Invisibility on Experience"
#define VERSION "1.0.0"
#define AUTHOR "Kia"
// !!!
// ===============================================================================
// WARNING! THIS PLUGIN IS UNTESTED! USE ON OWN RISK!
// ===============================================================================
// !!!
// ===============================================================================
// Editing begins here
// ===============================================================================
// Multiplicator for getting more time - In this case 1.5, means if I'm level 5 (Invis. Time = 5 * INVIS_MULTI = 7,5 [seconds])
#define INVIS_MULTI 1.5
// ===============================================================================
// and stops here. DO NOT MODIFY BELOW UNLESS YOU KNOW WHAT YOU'RE DOING
// ===============================================================================
// ===============================================================================
// Variables
// ===============================================================================
/* Defines */
// Random Number for creating our task
#define TASK_ID_INVIS 8918
/* Integer */
// Saving our Level here
new g_iLevel[33]
// ===============================================================================
// plugin_init
// ===============================================================================
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
/* ClCmds */
// Our test command for getting invisible
register_clcmd("say invis", "ClCmd_Invis")
}
// ===============================================================================
// ClCmd_Invis - Called when someone typed invis in the console
// ===============================================================================
public ClCmd_Invis(id)
{
// Calculating the Time we have here
new Float:flInvisTime = g_iLevel[id] * INVIS_MULTI
// Making the player invisible
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
// Creating a task with our calculated time to make him visible again
set_task(flInvisTime, "MakePlayerVisible", TASK_ID_INVIS + id)
}
// ===============================================================================
// MakePlayerVisible - Makes the player visible again
// ===============================================================================
public MakePlayerVisible(id)
{
// Reducing TASK_ID_INVIS to get the actual player
id -= TASK_ID_INVIS
// Make the player Visible
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255)
}
__________________