Raised This Month: $ Target: $400
 0% 

[HELP] Spray Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-13-2014 , 15:07   [HELP] Spray Menu
Reply With Quote #1

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

Last edited by Fuck For Fun; 07-13-2014 at 15:54. Reason: Edited
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-13-2014 , 15:22   Re: [HELP] Spray Menu
Reply With Quote #2

Where are you changing the value of the array?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-13-2014 , 15:28   Re: [HELP] Spray Menu
Reply With Quote #3

It is that I just started, so to some explanation here and how exactly to do it.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-13-2014 , 15:44   Re: [HELP] Spray Menu
Reply With Quote #4

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.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 07-13-2014 , 15:49   Re: [HELP] Spray Menu
Reply With Quote #5

You must increment Sprayed with 1, each time the player sprays.
SpeeDeeR is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-13-2014 , 16:01   Re: [HELP] Spray Menu
Reply With Quote #6

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;
}
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-14-2014 , 12:58   Re: [HELP] Spray Menu
Reply With Quote #7

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.
HamletEagle is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-14-2014 , 18:46   Re: [HELP] Spray Menu
Reply With Quote #8

Quote:
Originally Posted by HamletEagle View Post
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

Last edited by Fuck For Fun; 07-14-2014 at 18:47.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Old 03-02-2015, 11:15
Snitch
This message has been deleted by Snitch. Reason: wrong section
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 21:06.


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