Raised This Month: $ Target: $400
 0% 

[HELP] Points


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extream87
Senior Member
Join Date: Aug 2011
Old 03-02-2014 , 15:02   [HELP] Points
Reply With Quote #1

This is a menu to give points.
The admin type /givefreepts and the menu appears. The problem is if you choose a player "nelito" from the list for add points the points go to you and not for "nelito.

What is wrong with this?
Code:
#define VNS              ADMIN_CVAR new givecem, givequinhentos, givemil; public plugin_init() {       register_plugin(Plugin, Version, Author);           givecem = register_cvar("dot_give_cem_points", "100");     givequinhentos = register_cvar("dot_give_quinhentos_points", "500");     givemil = register_cvar("dot_give_mil_points", "1000");           register_clcmd("say /givefreepts", "give_ptsfree", VNS)     register_clcmd("say_team /givefreepts", "give_ptsfree", VNS)         } public give_ptsfree(id)  {     if(get_user_flags(id) & VNS)     {     new menu = menu_create( "\rSeleciona o numero de pontos:", "menu_handlerm" );     menu_additem( menu, "\w100 Pontos", "", 0 );     menu_additem( menu, "\w500 Pontos", "", 0 );     menu_additem( menu, "\w1000 Pontos", "", 0 );     menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );     menu_display( id, menu, 0 );     }     else     ColorChat(id, GREEN, "%s^4 ^1Nao tens acesso a este comando!", gTAG)  }  public menu_handlerm( id, menu, item ) {     switch( item )     {         case 0:         {           nv1(id)         }                 case 1:         {           nv2(id)         }                 case 2:         {           nv3(id)         }     }     menu_destroy( menu );     return PLUGIN_HANDLED; } public nv1(id)  {     new menu = menu_create( "\rSeleciona o jogador:", "menu_handler1" );     new players[32], pnum, tempid;     new szName[32], szUserId[32];     get_players( players, pnum, "a" );     for ( new i; i<pnum; i++ )     {         tempid = players[i];         get_user_name( tempid, szName, charsmax( szName ) );         formatex( szUserId, charsmax( szUserId ), "%d", get_user_userid( tempid ) );         menu_additem( menu, szName, szUserId, 0 );     }     menu_display( id, menu, 0 );  }  public menu_handler1( id, menu, item )  {     if ( item == MENU_EXIT )     {         menu_destroy( menu );         return PLUGIN_HANDLED;     }     new szData[6], szName[64];     new item_access, item_callback;     menu_item_getinfo( menu,item, item_access, szData,charsmax( szData ), szName,charsmax( szName ), item_callback );     new userid = str_to_num( szData );     new player = find_player( "k", userid );     if ( player && is_user_alive( player ) )     {         points[id] += get_pcvar_num(givecem)         points_in_name(id)         save_points(id)         ColorChat(id, GREEN, "%s^4 ^1Deram-te ^x03%d ^x01skillpoints.", gTAG, get_pcvar_num(givecem))     }     menu_destroy( menu );     return PLUGIN_HANDLED;  }

Last edited by extream87; 03-02-2014 at 16:02.
extream87 is offline
preetham
Member
Join Date: Sep 2012
Location: India
Old 03-03-2014 , 09:33   Re: [HELP] Points
Reply With Quote #2

https://forums.alliedmods.net/showth...=236305&page=2
Dont repost the same.
__________________
preetham 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 02:47.


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