Raised This Month: $32 Target: $400
 8% 

Action Script for XP Block


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 12-05-2009 , 01:20   Action Script for XP Block
Reply With Quote #1

This is the action needed to make an xp block into blockmaker to work with exolents hns xp mod

PHP Code:
action_XPBLOCK(idOverrideTimerent)
{
    new 
Float:fTime halflife_time();
    if (
fTime >= gfXPNextUse[id] || OverrideTimer)
    {
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            new 
szProperty1[33];
            
Get_BlockProperty(ent1szProperty1);
            
            
hnsxp_add_user_xpidstr_to_num(szProperty1) );
            
gfXPNextUse[id] = fTime 170;
            
set_hudmessage(gHudRedgHudGreengHudBluegfTextXgfTextYgHudEffectsgfHudFxTimegfHudHoldTimegfHudFadeInTimegfHudFadeOutTimegHudChannel);
            
show_hudmessage(id"YOU GOT A FEW MORE XP!");
        }
    }

Also, to use this you need to use his API thing, im using this on my server so dont say this dont work.

Tested On: FSCM ( Flaxans Course Maker )(a remake of bunnyhop course maker and blockmaker ).

Oh, and another thing.. if u look into this code you can see "( id, str_to_num(szProperty1) );" wich means you need a blockmaker that has "Set Properties" item in the menu.

For an example: i belive BCM5 has it
NiQu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-05-2009 , 01:40   Re: Action Script for XP Block
Reply With Quote #2

As of a new update, hnsxp_add_user_xp() was removed since it was obvious how to work it.
You need to do one of these:
Code:
#define hnsxp_add_user_xp(%1,%2) hnsxp_set_user_xp(%1, hnsxp_get_user_xp(%1) + %2)
or
Code:
// change hnsxp_add_user_xp(id, xp) // to hnsxp_set_user_xp(id, hnsxp_get_user_xp(id) + xp)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 12-05-2009 , 01:57   Re: Action Script for XP Block
Reply With Quote #3

Yeh okay thanks for that, however i wont bother changing to the new one anyway
NiQu is offline
mannyeon
Junior Member
Join Date: Jan 2010
Old 02-07-2010 , 06:21   Re: Action Script for XP Block
Reply With Quote #4

when i compile i .sma, one errors occures:
"hnsxp_set_user_xp"
it says like its has no meaning and like the command doesnt exist... what should i do?
mannyeon is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 02-08-2010 , 19:14   Re: Action Script for XP Block
Reply With Quote #5

Mannyeon, use exolents API and it shud work.
NiQu is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 02-09-2010 , 07:02   Re: Action Script for XP Block
Reply With Quote #6

fail action code
lazarev is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 02-10-2010 , 02:10   Re: Action Script for XP Block
Reply With Quote #7

lazarev its not fail, it works 100%.. just outdated.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 02-10-2010 , 11:54   Re: Action Script for XP Block
Reply With Quote #8

I use this one ^__^
PHP Code:
actionXP(idOverrideTimer)
{
    
//get game time
    
new Float:fTime halflife_time();
    
    if (
fTime >= gfXPNextUse[id] || OverrideTimer)
    {
        if ( 
cs_get_user_team id ) == CS_TEAM_T )
        {
            new 
xp_give get_pcvar_num(bm_xp_givexp)
            
hnsxp_add_user_xp(idxp_give);
            new 
szName33 ];
            
get_user_nameidszName32 );
            
ColorChat(0GREEN"%s^x03 [ %s ]^x01 is now got^x03 [%d]^x01 XP!"gszPrefixszNamexp_give);
            
gfXPNextUse[id] = fTime get_cvar_float("bm_xpcooldown");
        }
    }
    else
    {
        
set_hudmessage(gHudRedgHudGreengHudBluegfTextXgfTextYgHudEffectsgfHudFxTimegfHudHoldTimegfHudFadeInTimegfHudFadeOutTimegHudChannel);
        if( 
get_cvar_float("bm_xpcooldown") >= 600.0 
            
show_hudmessage(id"XP next use: new round"gfXPNextUse[id] - fTime);
            
        else     
show_hudmessage(id"XP next use: %.1f"gfXPNextUse[id] - fTime);
    }

lazarev is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 02-11-2010 , 13:59   Re: Action Script for XP Block
Reply With Quote #9

that probably works too.. but mine doesnt work for all blockmakers.. so who cares, i dont mind if someoen removed this thread.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
mannyeon
Junior Member
Join Date: Jan 2010
Old 02-13-2010 , 09:55   Re: Action Script for XP Block
Reply With Quote #10

API?
mannyeon 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 19:30.


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