AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with Moneymod and Blockmaker by Necro (https://forums.alliedmods.net/showthread.php?t=184904)

h0ppetau 05-10-2012 09:00

Problem with Moneymod and Blockmaker by Necro
 
Hi guys,

I have a few problems. I know there's like 10000 threads regarding Blockmaker, Custom Models and stuff.

But I didn't find anyone that could fit for my problem, so I decided to create a new thread instead.



I am using hideNseek by Ex0lent, Blockmaker 4.01 by Necro, and MoneyMod by funfel. My problem is that I want the moneyblock I created to give me money which shows in MoneyMod. Like, if you kill someone, it says "You just got 80 money for killing an enemy" etc. And if you type /mymoney or /mm is shows your current amount of money. I want the MoneyBlock i created to do have the same function when you stand on it. "You just got xx money"

/****** BLOCK ACTIONS *****/
PHP Code:

actionMoney(idOverrideTimer)
{
    if(
gMoneyUsed[id])
    {
        static 
property[5];
        new 
AddValueplayerMoney;
        
GetProperty(ent1property);
        
playerMoney mm_get_user_money(id);
        
AddValue str_to_num(property) + playerMoney;  
        
mm_set_user_money(idAddValue);
        
g_money_used[id] = false;
        
SCM_Print(id"You have been given %s $!"property);
    }
    else{
        
set_hudmessage(025500.010.1800.01.00.250.252);
        
show_hudmessage(id"%s %s^nNext Use: Next Round"PLUGIN_PREFIXPLUGIN_VERSION);
    }



PHP Code:

// global floats
new Float:gfSnappingGap[33];
new 
Float:gfOldMaxSpeed[33];
new 
Float:gfGrablength[33];
new 
Float:gfNextHealTime[33];
new 
Float:gfNextDamageTime[33];
new 
Float:gfInvincibleNextUse[33];
new 
Float:gfInvincibleTimeOut[33];
new 
Float:gfStealthNextUse[33];
new 
Float:gfStealthTimeOut[33];
new 
Float:gfTrampolineTimeout[33];
new 
Float:gfSpeedBoostTimeOut[33];
new 
Float:gfNukeNextUse[33];
new 
Float:gfCamouflageNextUse[33];
new 
Float:gfCamouflageTimeOut[33];
new 
Float:gfRandomNextUse[33];
new 
Float:gfBootsOfSpeedTimeOut[33];
new 
Float:gfBootsOfSpeedNextUse[33];
new 
Float:gfAutoBhopTimeOut[33];
new 
Float:gfAutoBhopNextUse[33];
new 
Float:gfMoneyNextUse[33]; 


PHP Code:

// global booleans
new bool:gbMeasureToolEnabled[33];
new 
bool:gbSnapping[33];
new 
bool:gbNoFallDamage[33];
new 
bool:gbOnIce[33];
new 
bool:gbNoSlowDown[33];
new 
bool:gbLowGravity[33];
new 
bool:gbOnFire[33];
new 
bool:gbAutoBhop[33];
new 
bool:gbJustDeleted[33];
new 
bool:gbAdminGodmode[33];
new 
bool:gbAdminNoclip[33];
new 
bool:gMoneyUsed[33]; 

Need some help here.

PS: I prefer staying with the original one, and not a copycat's release.


Best Regards,

h0ppetau.

Erox902 05-10-2012 17:54

Re: Problem with Moneymod and Blockmaker by Necro
 
This action code is for blockmakers with properties...

h0ppetau 05-11-2012 06:08

Re: Problem with Moneymod and Blockmaker by Necro
 
How about this actioncode then?

PHP Code:

actionMoney(idOverrideTimer)
{
    
//get game time
    
new Float:fTime halflife_time();
 
    
//make sure player is alive
    
if (fTime >= gfMoneyNextUse[id] || OverrideTimer)
    {
        
cs_set_user_money(idcs_get_user_money (id) + 5000) ;
        {
            
//omg
        
}
 
        
//set the time when the player can use the nuke again (someone might have been invincible)
        
gfMoneyNextUse[id] = fTime get_cvar_float("bm_moneycooldown");
 
        
//setup hud message to show who nuked what team
        
set_hudmessage(2552550, -1.00.3506.010.01.01.0);
 
    }
    else
    {
        
set_hudmessage(gHudRedgHudGreengHudBluegfTextXgfTextYgHudEffectsgfHudFxTimegfHudHoldTimegfHudFadeInTimegfHudFadeOutTimegHudChannel);
        
show_hudmessage(id"MONEY NEXT USE AFTER 1 ROUND"gfMoneyNextUse[id] - fTime);
    }



h0ppetau 05-11-2012 08:53

Re: Problem with Moneymod and Blockmaker by Necro
 
I sorted it out by adding:



PHP Code:

native mm_get_money(client);

native mm_set_money(clientmoney);

stock mm_add_money(clientmoney)
{
    return 
mm_set_money(clientmm_get_money(client) + money);


PHP Code:

actionMoney(idOverrideTimer)
{
    new 
Float:fTime halflife_time();
    
    if (
fTime >= g_money_next_use[id] || OverrideTimer)
    {
    if ( 
get_user_team id ) == )
    {
        
mm_add_money(id75);
        
ColorChat(idGREEN"[%s]^x03 You have been given^x04 75 Money^x03!"g_prefix);
    }
    
        
g_money_next_use[id] = fTime get_cvar_float("bm_moneycooldown");
            
    }
    else
    {
        
set_hudmessage(g_hud_redg_hud_greeng_hud_blueg_text_xg_text_yg_hud_effectsg_hud_fx_timeg_hud_hold_timeg_hud_fade_in_timeg_hud_fade_out_timeg_hud_channel);
        
show_hudmessage(id"[%s]^nWait Time: One Round"g_prefixg_money_next_use[id] - fTime);
    }
    return 
PLUGIN_HANDLED;



This thread can be closed :-)


All times are GMT -4. The time now is 00:24.

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