AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [JailBreak] T spy by exolent (https://forums.alliedmods.net/showthread.php?t=116812)

vaan123 01-26-2010 19:52

[JailBreak] T spy by exolent
 
hello,

hey exo could you fix your plugin T Spy , this error appears whenever i start my hlds :


Quote:

Originally Posted by error
Mod_NumForName : models/player//.mdl not found

CODE :

Code:

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

new const SPY_CHANCE = 5;
new const
SPY_MODEL[ ] = "";
new const
SPY_WEAPONS[ ] = {
   
CSW_KNIFE,
   
CSW_ELITE
};
new const
SPY_HEALTH = 100;

new const
g_szWeaponClassnames[ ][ ] =
{
   
"",
   
"weapon_p228",
   
"",
   
"weapon_scout",
   
"weapon_hegrenade",
   
"weapon_xm1014",
   
"weapon_c4",
   
"weapon_mac10",
   
"weapon_aug",
   
"weapon_smokegrenade",
   
"weapon_elite",
   
"weapon_fiveseven",
   
"weapon_ump45",
   
"weapon_sg550",
   
"weapon_galil",
   
"weapon_famas",
   
"weapon_usp",
   
"weapon_glock18",
   
"weapon_awp",
   
"weapon_mp5navy",
   
"weapon_m249",
   
"weapon_m3",
   
"weapon_m4a1",
   
"weapon_tmp",
   
"weapon_g3sg1",
   
"weapon_flashbang",
   
"weapon_deagle",
   
"weapon_sg552",
   
"weapon_ak47",
   
"weapon_knife",
   
"weapon_p90"
};

enum AmmoTypes
{
   
AMMO_CLIP,
   
AMMO_BACKPACK
};

new const
g_iWeaponMaxAmmo[ sizeof( g_szWeaponClassnames ) ][ AmmoTypes ] =
{
    {
0, 0 },
    {
13, 52 },
    {
0, 0 },
    {
10, 90 },
    {
0, 0 },
    {
7, 32 },
    {
0, 0 },
    {
30, 100 },
    {
30, 90 },
    {
0, 0 },
    {
30, 120 },
    {
20, 100 },
    {
25, 100 },
    {
30, 90 },
    {
35, 90 },
    {
25, 90 },
    {
12, 100 },
    {
20, 120 },
    {
10, 30 },
    {
30, 120 },
    {
100, 200 },
    {
8, 32 },
    {
30, 90 },
    {
30, 120 },
    {
20, 90 },
    {
0, 0 },
    {
7, 35 },
    {
30, 90 },
    {
30, 90 },
    {
0, 0 },
    {
50, 100 }
};

new
bool:g_bSpy;

new
g_iMsgId_TeamInfo;

public
plugin_precache( ) {
    new
szModel[ 128 ];
   
formatex( szModel, 127, "models/player/%s/%s.mdl", SPY_MODEL, SPY_MODEL );
   
precache_model( szModel );
}

public
plugin_init( ) {
   
register_plugin( "T Spy", "0.0.1", "Exolent" );
   
   
register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
   
   
RegisterHam( Ham_Spawn, "player", "FwdPlayerSpawn", 1 );
   
   
g_iMsgId_TeamInfo = get_user_msgid( "TeamInfo" );
}

public
EventNewRound( ) {
   
g_bSpy = false;
}

public
FwdPlayerSpawn( iPlayer ) {
    if( !
g_bSpy
   
&& is_user_alive( iPlayer )
    &&
cs_get_user_team( iPlayer ) == CS_TEAM_T ) {
        if(
random_num( 1, 100 ) <= SPY_CHANCE ) {
           
g_bSpy = true;
           
            new
iBlock = get_msg_block( g_iMsgId_TeamInfo );
           
set_msg_block( g_iMsgId_TeamInfo, BLOCK_SET );
           
           
fm_cs_set_user_team( iPlayer, CS_TEAM_CT );
           
ExecuteHamB( Ham_CS_RoundRespawn, iPlayer );
           
fm_cs_set_user_team( iPlayer, CS_TEAM_T );
           
           
set_msg_block( g_iMsgId_TeamInfo, iBlock );
           
           
cs_set_user_model( iPlayer, SPY_MODEL );
           
           
strip_user_weapons( iPlayer );
           
            new
iWeapon, iEntity, iAmmo;
            for( new
i = 0; i < sizeof( SPY_WEAPONS ); i++ ) {
               
iWeapon = SPY_WEAPONS[ i ];
               
iEntity = give_item( iPlayer, g_szWeaponClassnames[ iWeapon ] );
               
               
iAmmo = g_iWeaponMaxAmmo[ iWeapon ][ AMMO_CLIP ];
                if(
iAmmo ) {
                   
cs_set_weapon_ammo( iEntity, iAmmo );
                }
               
               
iAmmo = g_iWeaponMaxAmmo[ iWeapon ][ AMMO_BACKPACK ];
                if(
iAmmo ) {
                   
cs_set_user_bpammo( iPlayer, iWeapon, iAmmo );
                }
            }
           
           
set_user_health( iPlayer, SPY_HEALTH );
           
           
client_print( iPlayer, print_center, "You are a SPY! (%i%% chance)", SPY_CHANCE );
        }
    }
}

// ConnorMcLeod
fm_cs_set_user_team(id, {CsTeams,_}:iTeam, {CsInternalModel,_}:iModel = CsInternalModel:CS_DONTCHANGE)
{
    static const
OFFSET_TEAM = 114;
    static const
OFFSET_INTERNALMODEL = 126;
   
    if(
iTeam > CS_TEAM_SPECTATOR )
        return;

   
set_pdata_int(id, OFFSET_TEAM, _:iTeam);

    if(
iModel )
    {
       
set_pdata_int(id, OFFSET_INTERNALMODEL, _:iModel);
    }

   
dllfunc(DLLFunc_ClientUserInfoChanged, id, engfunc(EngFunc_GetInfoKeyBuffer, id));

    static const
szTeams[] = { "UNASSIGNED" , "TERRORIST" , "CT" , "SPECTATOR" };

   
emessage_begin(MSG_ALL, g_iMsgId_TeamInfo);
   
ewrite_byte(id);
   
ewrite_string(szTeams[_:iTeam]);
   
emessage_end();
}

ORIGINAL THREAD :
http://forums.alliedmods.net/showthread.php?t=114581

please fix it :P



thanks a bunch =)

wrecked_ 01-26-2010 20:03

Re: [JailBreak] T spy by exolent
 
You need to edit the
PHP Code:

new const SPY_MODEL[ ] = ""

to whatever model you want the spy to have. If you leave it blank then you'll get that error.

vaan123 01-26-2010 20:21

Re: [JailBreak] T spy by exolent
 
how the hell did i miss that , im an idiot :P thanks wrecked ! :crab:

wrecked_ 01-26-2010 22:12

Re: [JailBreak] T spy by exolent
 
No problem, I'm not a :crab:, for the record. :avast: I'm a pirate.

mininova 01-28-2010 09:33

Re: [JailBreak] T spy by exolent
 
One question
This would be changing x number of users CS_TEAM_T?


PHP Code:

public FwdPlayerSpawniPlayer ) {
    if( !
g_bSpy
    
&& is_user_aliveiPlayer )
    && 
cs_get_user_teamiPlayer ) == CS_TEAM_T ) {
        if( 
random_num1100 ) <= SPY_CHANCE ) {
            
g_bSpy true;
            
            new 
iBlock get_msg_blockg_iMsgId_TeamInfo );
            
set_msg_blockg_iMsgId_TeamInfoBLOCK_SET );
            
            
fm_cs_set_user_teamiPlayerCS_TEAM_CT );
            
ExecuteHamBHam_CS_RoundRespawniPlayer );
            
fm_cs_set_user_teamiPlayerCS_TEAM_T );
            
            
set_msg_blockg_iMsgId_TeamInfoiBlock );
            
            
cs_set_user_modeliPlayerSPY_MODEL );
            
            
strip_user_weaponsiPlayer );
            
            new 
iWeaponiEntityiAmmo;
            for( new 
0sizeofSPY_WEAPONS ); i++ ) {
                
iWeapon SPY_WEAPONS];
                
iEntity give_itemiPlayerg_szWeaponClassnamesiWeapon ] );
                
                
iAmmo g_iWeaponMaxAmmoiWeapon ][ AMMO_CLIP ];
                if( 
iAmmo ) {
                    
cs_set_weapon_ammoiEntityiAmmo );
                }
                
                
iAmmo g_iWeaponMaxAmmoiWeapon ][ AMMO_BACKPACK ];
                if( 
iAmmo ) {
                    
cs_set_user_bpammoiPlayeriWeaponiAmmo );
                }
            }
            
            
set_user_healthiPlayerSPY_HEALTH );
            
            
client_printiPlayerprint_center"You are a SPY! (%i%% chance)"SPY_CHANCE );
        }
    }






Exolent[jNr] 01-28-2010 15:50

Re: [JailBreak] T spy by exolent
 
Quote:

Originally Posted by mininova (Post 1070578)
One question
This would be changing x number of users CS_TEAM_T?

No.


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

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