Raised This Month: $ Target: $400
 0% 

Till player dies.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-27-2009 , 03:02   Till player dies.
Reply With Quote #1

How can i make that when people buy this be till he dies, becouse now it's for one round.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Unstoppable Fighter"
#define VERSION "1.0"
#define AUTHOR "DoviuX"

/*================================================================================
 [Const's]
=================================================================================*/
new const gUnstoppable[][] = { 
    
"sound/Unstoppable/Unstoppable1.wav",
    
"sound/Unstoppable/Unstoppable2.wav",
    
"sound/Unstoppable/Unstoppable3.wav"
}

new const 
gNoMoney[] = "sound/Unstoppable/NoMoney.wav"

new const Unstoppable_MDL[] = "models/player/Unstoppable/Unstoppable.mdl"

/*================================================================================
 [New Variables]
=================================================================================*/
//Unstoppable stuff...
new price
new health
new armor

//Guns...
new M4A1AMMO
new AK47AMMO
new AWPAMMO
new DEAGLEAMMO

/*================================================================================
 [Init and Precache]
=================================================================================*/

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );

    
register_logevent"TextInfo"2"1=Round_Start" );

    
register_clcmd"say /unst""CmdUnstoppable" )
    
register_clcmd"say_team /unst""CmdUnstoppable" )

    
price register_cvar"rm_cost""16000" )

    
health register_cvar"rm_health""1000" )
    
armor register_cvar"rm_armor""300" )

    
M4A1AMMO register_cvar("rm_m4a1""150" )
    
AK47AMMO register_cvar("rm_ak47""150" )
    
AWPAMMO register_cvar("rm_awp""60" )
    
DEAGLEAMMO register_cvar("rm_deagle""100" )
}

public 
plugin_precache()
{    
        for( new 
0sizeof gUnstoppablei++ )
        
precache_genericgUnstoppable] )
        
precache_soundgNoMoney )
    
precache_modelUnstoppable_MDL )
}

public 
plugin_cfg()
{
    
// Get configs dir
    
new cfgdir32 ]
    
get_configsdircfgdircharsmaxcfgdir ) )

    
// Execute config file (Unstoppable.cfg)
    
server_cmd"exec %s/Unstoppable.cfg"cfgdir )
}

/*================================================================================
 [Plugin Start]
=================================================================================*/

public TextInfo()
{
    
set_task(20.0"play_text")
    
set_task(50.0"play_text")
    
set_task(90.0"play_text")
}

public 
CmdUnstoppable(id)
{
    new 
Cost get_pcvar_numprice )
    new 
Money cs_get_user_moneyid )
            
    if (
Money Cost)
    {
        
set_hudmessage225225225, -1.00.2926.012.0 );
        
show_hudmessage0"You don't have enough money!" )
        
client_cmd0"spk %s"gNoMoney)
        return 
PLUGIN_HANDLED;
    } 
    else 
    {
        new 
name32 ]
        new 
Float:speed get_user_maxspeedid ) + 75.0
        
get_user_nameid,name,31 )
        
set_hudmessage225225225, -1.00.2926.012.0 )
        
show_hudmessage0"%s is now Unstoppable!"name )
        
cs_set_user_modelid"Unstoppable_MDL" )
        
set_user_healthidget_pcvar_numhealth ) )
        
set_user_maxspeedidspeed )
        
set_user_armoridget_pcvar_numarmor ) )
        
client_cmdid"spk %s"gUnstoppablerandom_num(0sizeof gUnstoppable ) ] )
    
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
        
strip_user_weaponsid )
        
give_itemid"weapon_knife" )
        
give_itemid"weapon_m4a1")
        
give_itemid"weapon_ak47")
        
give_itemid"weapon_awp")
        
give_itemid"weapon_deagle")
        
cs_set_user_bpammoidCSW_M4A1get_pcvar_num M4A1AMMO ) )
        
cs_set_user_bpammoidCSW_AK47get_pcvar_num AK47AMMO ) )
        
cs_set_user_bpammoidCSW_AWPget_pcvar_num AWPAMMO ) )
        
cs_set_user_bpammoidCSW_DEAGLEget_pcvar_num DEAGLEAMMO ) )

        
Money -= Cost;
    
        
cs_set_user_money(idMoney);    
    }
    return 
PLUGIN_HANDLED


public 
play_text(id)
{
    
client_printcolor(id"/wYou can buy Unstoppable by typing /g/rmb.")
}

stock client_printcolor(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg,190,input,3);
    
replace_all(msg,190,"/g","^4");// green txt
    
replace_all(msg,190,"/y","^1");// orange txt
    
replace_all(msg,190,"/ctr","^3");// team txt
    
replace_all(msg,190,"/w","^0");// team txt
    
if (idplayers[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_UNRELIABLEget_user_msgid("SayText"), _players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }

DoviuX is offline
Send a message via Skype™ to DoviuX
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-27-2009 , 03:39   Re: Till player dies.
Reply With Quote #2

Just hook Roundstart and reset the actions on the player, and remove the powers when he dies(hook Deathmsg or Ham_Killed for that).
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-27-2009 , 03:45   Re: Till player dies.
Reply With Quote #3

Can you show me example becouse iam not wery good scripting
DoviuX is offline
Send a message via Skype™ to DoviuX
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-27-2009 , 05:44   Re: Till player dies.
Reply With Quote #4

Quote:
Originally Posted by DoviuX View Post
Can you show me example becouse iam not wery good scripting
You suck at scripting. Can't you understand? You're too stupid to be involved into Pawn scripting. You should avoid it for a few more years IMO.

Good luck trying to find out what I said with translator.
__________________
hleV is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-27-2009 , 11:05   Re: Till player dies.
Reply With Quote #5

Omg i'am soooo scared f*** you i try to learn and if you can't help why do you write a reply go create a plugin or smth i dont care this is scripting help forum people help to script.

IMO ? You are joking right ? If you IMO and you tell other people are IMO it's not my foult. I'am not emo.
DoviuX is offline
Send a message via Skype™ to DoviuX
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-27-2009 , 11:19   Re: Till player dies.
Reply With Quote #6

IMO = In My Opinion
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-27-2009 , 11:46   Re: Till player dies.
Reply With Quote #7

ups srr
DoviuX is offline
Send a message via Skype™ to DoviuX
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 17:43.


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