AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   ChipMod ( private ) HELP PLS :) (https://forums.alliedmods.net/showthread.php?t=153919)

HBxander 03-31-2011 10:48

ChipMod ( private ) HELP PLS :)
 
Hey guys.. I've made this ChipMod for JumpGround servers, and i want to set the users Chips, in Money Bar ( normal show money there )

i know how to make it, but it set it back at all round starts?

ill use

PHP Code:

public CmdSetMoney iPlayer )
{
             new 
chips iPlayerChips iPlayer ]
             
cs_set_user_money iPlayerchips)


but its not working ?

and in eventNewRound, ill use

PHP Code:

public eventNewRound iPlayer )
{
set_task 2.0"CmdSetMoney"iPlayer )


what is wrong ? :s

hornet 03-31-2011 10:57

Re: ChipMod ( private ) HELP PLS :)
 
Round start functions don't have a user id argument. Instead, you need to loop through all player ID's and set task for each one. Like so:

PHP Code:

public plugin_init() 
{
    
register_event"HLTV""eventNewRound""a""1=0""2=0" );
}

public 
eventNewRound()
{
    new 
players32 ], playernum;
    
get_playersplayersnum );
    
    for( new 
num ++ )
    {
        
player players];
        if( 
is_user_aliveplayer ) )
            
set_task 2.0"CmdSetMoney"player );
    }



HBxander 03-31-2011 10:58

Re: ChipMod ( private ) HELP PLS :)
 
+1 for helping :-)

Was just wondering why it didnt work but yea. xD

Ty :-)

I started scripting for about 2 months ago, so i have to pracc it alot bfore i can go make my own plugins 100% non buggy xD

its working and just try join us on our server - ill give +1k chips for helping :-)

IP : 178.236.68.147:27015


HBxander 03-31-2011 11:03

Re: ChipMod ( private ) HELP PLS :)
 
can i make an AutoUpdater for it ? so i dont have to make the CmdUpdateMoney ( iPlayer )
after all the time i get / lose chips ? :b

like
command for if it changes value then update cs_set_user_money ( iPlayer, chips, 1 )
?

matsi 03-31-2011 12:16

Re: ChipMod ( private ) HELP PLS :)
 
Code:
register_message( get_user_msgid( "Money" ), "MessageMoney" ); ... public MessageMoney( iMsgId, iDest, iPlayer ) {         // update chips? ;o }


All times are GMT -4. The time now is 14:40.

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