Raised This Month: $12 Target: $400
 3% 

[Duda] Con el party


  
 
 
Thread Tools Display Modes
Author Message
wEEk
Senior Member
Join Date: Sep 2012
Old 06-16-2013 , 22:29   [Duda] Con el party
#1

Buenas noches, les quería preguntar algo sobre el party ¿como hago para que al finalizar la ronda le de la experiencia que se divide?

Por ej: Gano 6 XP y a los 2 nos va 3 de XP a cada uno

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define IsPlayer(%1)            ( 1 <= %1 <= g_iMaxPlayers )

const g_iMaxGroups 2;

new 
g_iMaxPlayers;

new 
g_iPlayerGroups33 ][ g_iMaxGroups ];
new 
g_iGroupIndex = -1;

new 
Is_User_in_Party[33];
new 
FriendName[33];
new 
PlayerInvitations[33];
new 
InvitatorName[33]

const 
KEYSMENU = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)

public 
plugin_init()
{
    
register_plugin"Sistema de Party""1.0""Sonny" )
    
    
register_menu"Menu De Party"KEYSMENU"HandlePartyMenu" )
    
register_menu"Invitaciones"KEYSMENU"HandleInvitations" )
    
    
register_clcmd"say /party""ShowPartyMenu" )
    
    
g_iMaxPlayers get_maxplayers()
}

public 
client_putinserverid )
{
    
Is_User_in_Party[id] = 0
    PlayerInvitations
[id] = 0
}

public 
ShowPartyMenuid )
{
    static 
Menu[250], iLen
    iLen 
0
    
    iLen 
+= formatex(Menu[iLen], sizeof Menu iLen"\yMenu de party^n^n")
    
    
iLen += formatex(Menu[iLen], sizeof Menu iLen"\w-------------------------^n")
    
    if(
Is_User_in_Party[id])
    {
        new 
Name[33]
        
get_user_name(idNamecharsmax(Name))
        
        
iLen += formatex(Menu[iLen], sizeof Menu iLen"\r - \y%s & %s^n"NameFriendName[id])
    }
    else
    {
        
iLen += formatex(Menu[iLen], sizeof Menu iLen"\r - \dNo estas en party^n")
    }
    
    
iLen += formatex(Menu[iLen], sizeof Menu iLen"\w-------------------------^n^n")
    
    
iLen += formatex(Menu[iLen], sizeof Menu iLen"\r[5]. \w%s^n"Is_User_in_Party[id] ?  "Salir del PARTY" "Invitar" )
    
    
iLen += formatex(Menu[iLen], sizeof Menu iLen"\r[6]. \w%s ^n^n^n"PlayerInvitations[id]=="Invitacion:" "No tienes ninguna invitacion" )
    
    
iLen += formatex(Menu[iLen], sizeof Menu iLen"^n\r[0]. \wSalir")
    
    
show_menu(idKEYSMENUMenu, -1"Menu De Party")
}

public 
HandlePartyMenuidkey )
{
    switch( 
key )
    {
        case 
4:
        {
            new 
szArg32 ] , id2;
            
            
read_argvszArg 31 );
            
            
id2 read_data(2
            
            if( !
Is_User_in_Party[id] )
            {
                new 
Targetbody
                get_user_aiming
(idTargetbody)
                
                if( 
Target != id2 || Target == id || !is_user_bot(id2) || !is_user_connected(id2) || !is_user_alive(id2) )
                {
                    
client_printid print_center "[PARTY] No estas apuntando a nadie!");
                    
ShowPartyMenuid )
                    
                    return 
PLUGIN_HANDLED;
                }
                
                for ( new 
<= g_iMaxPlayers i++ )
                {
                    for ( new 
g_iMaxGroups p++ )
                    {    
                        
get_user_nameid2 szArg 31 );
                        
                        if ( 
g_iPlayerGroups][ ] & ( << ( id2 31 ) ) )
                        {
                            switch(
PlayerInvitations[id] )
                            {
                                case 
1client_printid print_chat "[PARTY] %s Ya esta en un party!!" szArg );
                                case 
2client_printid print_chat "[PARTY] %s Ya tiene una invitacion" szArg );
                            }
                            
                            return 
PLUGIN_HANDLED;
                        }
                        else
                        {
                            
client_printid print_chat "[PARTY] Invitaste a %s a un party!!" szArg );
                            
                            new 
szName[32]
                            
get_user_name(idszName31 )
                            
                            
PlayerInvitations[id2] = 1
                            
                            copy
InvitatorName[id2], charsmaxInvitatorName ), szName 
                            return 
PLUGIN_HANDLED;
                        }
                    }
                }
                
                return 
PLUGIN_CONTINUE;
            }
             
            if( 
id2 == id )
                return 
PLUGIN_HANDLED;
            
            if( 
Is_User_in_Party[id] && Is_User_in_Party[id2] )
            {
                
Is_User_in_Party[id] = 0;
                
Is_User_in_Party[id2] = 0;
                
                
PlayerInvitations[id] = 0;
                
PlayerInvitations[id2] = 0;
                
                
client_printidprint_chat"[PARTY] El party ha sido disuelto." )
                
client_printid2print_chat"[PARTY] El party ha sido disuelto." )
                
                return 
PLUGIN_HANDLED;
            }
            
            return 
PLUGIN_HANDLED;
        }
        
        case 
5ShowInvitationsMenuid )
    }
    
    return 
PLUGIN_HANDLED;
}

public 
ShowInvitationsMenuid )
{
    static 
Menu[250], iLen
    iLen 
0
    
    iLen 
+= formatex(Menu[iLen], sizeof Menu iLen"\yMenu de Invitaciones^n^n")
    
    switch( 
PlayerInvitations[id] )
    {
        case 
0iLen += formatex(Menu[iLen], sizeof Menu iLen"\w No tenes ninguna invitacion^n" )
        case 
1iLen += formatex(Menu[iLen], sizeof Menu iLen"\r1. - \w Invitacion^n")
    }
    
    
iLen += formatex(Menu[iLen], sizeof Menu iLen"^n\r0. \wSalir")
    
    
show_menu(idKEYSMENUMenu, -1"Invitaciones")
}

public 
HandleInvitationsidkey )
{
    switch( 
key )
    {
        case 
0
        { 
            if( 
PlayerInvitations[id] == )
            {
                
PlayerInvitatorMenuid )
            }
        }
    }
}

public 
PlayerInvitatorMenuid )
{
    new 
iInviteSender], iMenu;
    new 
szMenuTitle55 ];
                    
    
formatexszMenuTitleget_user_nameid szMenuTitle charsmaxszMenuTitle ) ) ] , 55 " Te esta invitando a party!" );
    
iInviteSender] = id;
            
    
iMenu menu_createszMenuTitle "InviteHandler");
    
menu_additemiMenu "Aceptar"iInviteSender );
    
menu_additemiMenu "Cancelar"iInviteSender );
    
menu_setpropiMenu  MPROP_EXIT MEXIT_ALL );
    
menu_displayid iMenu ); 

    return 
PLUGIN_HANDLED;
}

public 
InviteHandlerid iMenu iItem 
{
    if( 
iItem == MENU_EXIT )
        return 
PLUGIN_HANDLED;
    
    new 
szName133 ] , szName233 ], szKey] , iDummy idInviteSender;
    
    
menu_item_getinfoiMenu iItem iDummy szKey "" iDummy );
    
idInviteSender szKey];

    
get_user_nameidInviteSender szName1 charsmaxszName1 ) );
    
get_user_nameid szName2 charsmaxszName2 ) );
    
    if ( 
iItem == 
    {
        for ( new 
g_iMaxGroups p++ )
        {    
            if ( 
g_iPlayerGroupsid ][ ] & ( << ( idInviteSender 31 ) ) )
            {    
                new 
szArg32 ]
                
get_user_nameidszArg31 )
                
                switch( 
PlayerInvitations[idInviteSender] )
                {
                    case 
1client_printid print_chat "[PARTY] %s Ya esta en un party!!" szArg );
                    case 
2client_printid print_chat "[PARTY] %s Ya tiene una invitacion" szArg );
                }
            }
            else
            {
                if ( 
is_user_connectedidInviteSender ) && is_user_connectedid ) )
                {
                    
AddGroupidInviteSender id );
                    
                    
set_hudmessage255 255 255 0.05 0.25 6.0 10.0 );
                    
show_hudmessageidInviteSender"Estas en party con %s" szName2 );
                    
show_hudmessageid"Estas en party con %s" szName1 );
                        
                    
Is_User_in_Party[id] = 1;
                    
Is_User_in_Party[idInviteSender] = 1;
                    
                    
copyFriendName[id], charsmax(FriendName), szName1 )
                    
                    
PlayerInvitations[id] = 2
                
}  
            }
        }
    }
    else if ( 
iItem == )
    {
        
client_printidInviteSender print_chat "[PARTY] %s Ha cancelado tu invitacion." szName2);
        
client_printid print_chat "[PARTY] Cancelaste la invitacion de %s" szName1 );
            
        
PlayerInvitations[id] = 0
        
        
return PLUGIN_HANDLED;
    }  
    
    return 
PLUGIN_HANDLED;
}
            
public 
AddGroupidInvitor idInvitee )
{
    if ( ++
g_iGroupIndex == g_iMaxGroups )
        return 
0;
    
    
g_iPlayerGroupsidInvitor ][ g_iGroupIndex ] = ( << ( idInvitor 31 ) ) | ( << ( idInvitee 31 ) );
    
    return 
g_iGroupIndex;
}

public 
GetGroupPlayersiGroup , &id1 , &id2 )
{
    new 
bool:bFirstSet;
    
    for ( new 
<= 32 p++ )
    {
        if ( 
iGroup & ( << ( 31 ) ) )
        {
            if ( !
bFirstSet )
            {
                
id1 p;
                
bFirstSet true;
            }
            else
            {
                
id2 p;
                return 
1;
            }
        }
    }
    return 
0;

Creo el evento de round end y despues?
__________________
Aprendiendo de nadie
wEEk is offline
Winchester90
Senior Member
Join Date: May 2013
Location: Dale! RG4L Baby
Old 06-17-2013 , 06:24   Re: [Duda] Con el party
#2

Usa el de rak.
__________________
Proyectos No comercio XD
Zombie Resurection 1.0 (45%)
Winchester90 is offline
Especialista
BANNED
Join Date: Mar 2013
Old 06-17-2013 , 23:57   Re: [Duda] Con el party
#3

en la bonificacion party dividi la exp ganada en 2 y listo kapo
Especialista is offline
 



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 16:45.


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