Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Prośba o przerobienie ;D


  • Zamknięty Temat jest zamknięty
2 odpowiedzi w tym temacie

#1 SaveD

    Życzliwy

  • Użytkownik

Reputacja: 1
Nowy

  • Postów:38
  • Lokalizacja:Lublin
Offline

Napisano 07.02.2010 20:12

Proszę o przerobienie pluginu tak, aby nie mutował TT.

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include < fun >
#include < hamsandwich >

#define ADMIN_VOICE ADMIN_MENU


new g_iMaxClients;
new g_iMenu;

new bool:g_connected[33]; 

public plugin_init() {
    register_plugin( "Jb Weapon", "1.0", "wundeR" );    
    RegisterHam( Ham_Spawn, "player", "HamPlayerSpawn", 1 );
    
    register_forward( FM_Voice_SetClientListening, "FwdSetVoice" );
    
    g_iMaxClients = get_maxplayers();
    
    g_iMenu = menu_create( "Choose your weapon", "HandleWeaponsMenu" );
    menu_additem( g_iMenu, "AK47", "1", 0 );
    menu_additem( g_iMenu, "M4A1", "2", 0 );
    menu_additem( g_iMenu, "AWP", "3", 0 );
    menu_additem( g_iMenu, "M3", "4", 0 );
    menu_additem( g_iMenu, "FAMAS", "5", 0 );
    menu_additem( g_iMenu, "P90", "6", 0 );
    menu_additem( g_iMenu, "M249", "7", 0 );
    menu_setprop( g_iMenu, MPROP_EXIT, MEXIT_ALL ); 
    
    g_iMaxClients = global_get( glb_maxClients );
}

public HamPlayerSpawn(id) {
    if( is_user_alive( id ) && is_user_connected( id ) ) {
        strip_user_weapons( id );
        give_item( id, "weapon_knife" );
        if( cs_get_user_team( id ) == CS_TEAM_CT ) {
            give_item( id, "weapon_deagle" );
            cs_set_user_bpammo( id, CSW_DEAGLE, 35 );
            menu_display( id, g_iMenu, 0 );
        }
    }    
}

public client_putinserver(client)
{
    g_connected[client] = true;
}

public client_disconnect(client)
{
    g_connected[client] = false;
}

public FwdSetVoice(receiver, sender, bool:listen)
{
    if( !(1 <= receiver <= g_iMaxClients)
    || !g_connected[receiver]
    || !(1 <= sender <= g_iMaxClients)
    || !g_connected[sender] ) return FMRES_IGNORED;
    
    new CsTeams:team = cs_get_user_team(sender);
    if( (team == CS_TEAM_T || team == CS_TEAM_CT && !is_user_alive(sender)) && !access(sender, ADMIN_VOICE) )
    {
        engfunc(EngFunc_SetClientListening, receiver, sender, 0);
        return FMRES_SUPERCEDE;
    }
    
    return FMRES_IGNORED;
}

public HandleWeaponsMenu( id, iMenu, iItem ) {
    if( iItem == MENU_EXIT || !is_user_alive( id ) )
    return PLUGIN_HANDLED;
    
    new szKey[ 7 ], _Trash;
    menu_item_getinfo( iMenu, iItem, _Trash, szKey, 1, "", 0, _Trash );
    
    switch( szKey[ 0 ] ) {
        case '1': {
            give_item( id, "weapon_ak47" );
            cs_set_user_bpammo( id, CSW_AK47, 90 );
        }
        case '2': {
            give_item( id, "weapon_m4a1" );
            cs_set_user_bpammo( id, CSW_M4A1, 90 );
        }
        case '3': {
            give_item( id, "weapon_awp" );
            cs_set_user_bpammo( id, CSW_AWP, 30 );
        }
        case '4': {
            give_item( id, "weapon_m3" );
            cs_set_user_bpammo( id, CSW_M3, 32 );
        }
        case '5': {
            give_item( id, "weapon_famas" );
            cs_set_user_bpammo( id, CSW_FAMAS, 90 );
        }
        case '6': {
            give_item( id, "weapon_p90" );
            cs_set_user_bpammo( id, CSW_P90, 100 );
        }
        case '7': {
            give_item( id, "weapon_m249" );
            cs_set_user_bpammo( id, CSW_M249, 200 );
        }
    }
    return PLUGIN_HANDLED;
}

Użytkownik SaveD edytował ten post 07.02.2010 20:35

  • +
  • -
  • 0

#2 DarkGL

    Nie oddam ciasteczka !

  • Administrator

Reputacja: 6 555
Godlike

  • Postów:11 981
  • GG:
  • Steam:steam
  • Imię:Rafał
  • Lokalizacja:Warszawa
Offline

Napisano 07.02.2010 21:16

chyba o to ci chodzi
public FwdSetVoice(receiver, sender, bool:listen)
{
	if( !(1 <= receiver <= g_max_clients)
	|| !g_connected[receiver]
	|| !(1 <= sender <= g_max_clients)
	|| !g_connected[sender] ) return FMRES_IGNORED;
	
	if(is_user_alive(sender) && cs_get_user_team(sender) == CS_TEAM_T) //gdy mowi TT
	{
		if (cs_get_user_team(receiver) == CS_TEAM_CT) //nie slyszy go CT
		{
			engfunc(EngFunc_SetClientListening, receiver, sender, false)
			forward_return(FMV_CELL, true)
			return FMRES_SUPERCEDE
		}
	} 
	else if ( cs_get_user_team(sender) == CS_TEAM_CT){
		engfunc(EngFunc_SetClientListening, receiver, sender, true)
		forward_return(FMV_CELL, true)
		return FMRES_SUPERCEDE
	} 
	else { //gdy mowi spect
		if (!is_user_alive(receiver)) //nie slysza go ani CT ani TT
		{
			engfunc(EngFunc_SetClientListening, receiver, sender, true)
			forward_return(FMV_CELL, true)
			return FMRES_SUPERCEDE
		}
		else
		{
			engfunc(EngFunc_SetClientListening, receiver, sender, false)
			forward_return(FMV_CELL, true)
			return FMRES_SUPERCEDE
		}
	}
	return FMRES_IGNORED;
}
tt slyszy ct
ct nie slyszy tt
tt może rozmawiać z innymi tt

Użytkownik DarkGL edytował ten post 07.02.2010 21:17

  • +
  • -
  • 1

#3 SaveD

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:38
  • Lokalizacja:Lublin
Offline

Napisano 07.02.2010 21:19

Ok, dzięki za pomoc. :P
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych