AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   HNS XP Mod - How to make ability (https://forums.alliedmods.net/showthread.php?t=231937)

b0rN 12-22-2013 15:42

HNS XP Mod - How to make ability
 
Hi,
How to remake Invisible ability to work like that:

Invisible will be for BIND and when player use it, a man will be invisible for time base on which lvl player have.
Can someone say how to do it?

Kia 12-23-2013 04:36

Re: HNS XP Mod - How to make ability
 
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(PLUGINVERSIONAUTHOR)
    
    
/* 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(idkRenderFxNone000kRenderTransAlpha0)
    
    
// 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(idkRenderFxNone000kRenderTransAlpha255




All times are GMT -4. The time now is 20:28.

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