AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Spray Menu (https://forums.alliedmods.net/showthread.php?t=244090)

Fuck For Fun 07-13-2014 15:07

[HELP] Spray Menu
 
What I do, the Spray did not come up in the menu.

Still remained 0/50.
Code:

new Sprayed[ 33 ]
Code:

    formatex( szMenu, charsmax(szMenu), "\wSpray - %d/50", Sprayed[ client ] );
    menu_additem( iMenu, szMenu, "0" );

This is what I have right now, I want you to explain to me how to get him to raise.
Stock should spray or something?


If you can help me also, how to set prisoner should kill 1000 Guards

YamiKaitou 07-13-2014 15:22

Re: [HELP] Spray Menu
 
Where are you changing the value of the array?

Fuck For Fun 07-13-2014 15:28

Re: [HELP] Spray Menu
 
It is that I just started, so to some explanation here and how exactly to do it.

Flick3rR 07-13-2014 15:44

Re: [HELP] Spray Menu
 
It seems just like the value of Sprayed is still 0 (you didn't change it anywhere and it still remains as created). Otherwise, answer YamiKaitou's question.

SpeeDeeR 07-13-2014 15:49

Re: [HELP] Spray Menu
 
You must increment Sprayed with 1, each time the player sprays.

Fuck For Fun 07-13-2014 16:01

Re: [HELP] Spray Menu
 
I did that now, after I do the spray appears to me 1/50 of

Tell me if it's okay, when a player finishes the 50/50 then it will be registered in chat it is finished and it will not keep him.
300 straight passes spray.

Thanks for the help


Code:

new Sprayed[ 33 ], Achievements[ 33 ];

public SprayMission( client )
{
    static szMenu[ 64 ], iMenu;
   
    formatex( szMenu, charsmax( szMenu ), "\ySprayMission \wMenu");
   
    iMenu = menu_create( szMenu, "CmdSprayHandler" );
   
    formatex( szMenu, charsmax(szMenu), "\wSpray \w(\d%d\w/\y50\w)", Sprayed[ client ] );
    menu_additem( iMenu, szMenu, "0" );
   
    formatex( szMenu, charsmax(szMenu), "\wSpray \w(\d%d\w/\y300\w)", Sprayed[ client ] );
    menu_additem( iMenu, szMenu, "1" );
   
    formatex( szMenu, charsmax(szMenu), "\wSpray \w(\d%d\w/\y1000\w)", Sprayed[ client ] );
    menu_additem( iMenu, szMenu, "2" );
   
    menu_display( client, iMenu );
   
    return PLUGIN_HANDLED;
}

public FwdSpray( )
{
    new id = read_data(2 );
   
    if ( !is_user_alive( id ) )    return PLUGIN_HANDLED;
   
    if ( Sprayed[ id ] >= 300 )    return PLUGIN_HANDLED;
   
    Sprayed[ id ] += 1;
   
    if ( Sprayed[ id ] == 50 )
    {
        LevelUp( id );
       
        Achievements[ id ] += 1;
       
        ColorChat( 0, GREEN, "[System] ^3%s^1 has earned the^4 Level 1 Spray^1 Achievement! (^4 %d/17^1 Achievements )", szName( id ), Achievements[ id ]  );
       
        //set_user_cash( id, get_user_cash( id ) + 500 );
    }
   
    if ( Sprayed[ id ] == 300 )
    {
       
        Achievements[ id ] += 1;
       
        ColorChat( 0, GREEN, "[System] ^3%s^1 has earned the^4 Level 2 Spray^1 Achievement! (^4 %d/17^1 Achievements )", szName( id ), Achievements[ id ]  );
       
        //set_user_cash( id, get_user_cash( id ) + 1000 );
    }
   
    if ( Sprayed[ id ] == 1000 )
    {
       
        Achievements[ id ] += 1;
       
        ColorChat( 0, GREEN, "[System] ^3%s^1 has earned the^4 Level 3 Spray^1 Achievement! (^4 %d/17^1 Achievements )", szName( id ), Achievements[ id ]  );
       
        //set_user_cash( id, get_user_cash( id ) + 3000 );
    }
   
    return PLUGIN_CONTINUE;
}


HamletEagle 07-14-2014 12:58

Re: [HELP] Spray Menu
 
Not sure that I understood very good,but:

PHP Code:

 if ( Sprayedid ] >= 300 )    return PLUGIN_HANDLED

You want 50 or 300 ?

PHP Code:

 if ( Sprayedid ] >= 300 )    {
    
    
client_print idprint_chat"You used all of your sprays" )
    return 
PLUGIN_HANDLED;



Here is how you would set a message in chat.

Fuck For Fun 07-14-2014 18:46

Re: [HELP] Spray Menu
 
Quote:

Originally Posted by HamletEagle (Post 2167527)
Not sure that I understood very good,but:

PHP Code:

 if ( Sprayedid ] >= 300 )    return PLUGIN_HANDLED

You want 50 or 300 ?

PHP Code:

 if ( Sprayedid ] >= 300 )    {
    
    
client_print idprint_chat"You used all of your sprays" )
    return 
PLUGIN_HANDLED;



Here is how you would set a message in chat.

First 50 next 300 and last 1000

read this and see the code:
https://forums.alliedmods.net/showpo...09&postcount=6


All times are GMT -4. The time now is 21:06.

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