Raised This Month: $ Target: $400
 0% 

Bits problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 04-22-2012 , 16:28   Bits problem
Reply With Quote #1

I made this plugin but it doesn't give me weapons. Where could be the problem ? Becouse i can't fint it.

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >

#define SetPlayerBit(%1,%2) (%1 |= (1 << (%2 & 31)))
#define ResetPlayerBit(%1,%2) (%1 &= ~(1 << (%2 & 31)))
#define GetPlayerBit(%1,%2) (%1 & (1 << (%2 & 31)))

new const WEAPONSN[ ][ ] = { "weapon_m4a1""weapon_m3""weapon_deagle" };
new const 
WEAPONSC[ ] = { CSW_M4A1CSW_M3CSW_DEAGLE };
new const 
WEAPONSA[ ] = { 9032032};

enum _:PlayerData 
    
kills
    
deaths 
}

new 
g_alive;
new 
g_player32 ][ PlayerData ];

public 
plugin_init( ) {
    
register_plugin"Test Bits/Enum""1.0""TBagT" );
    
    
RegisterHamHam_Spawn"player""bacon_spawn");
    
register_event"DeathMsg""deathmsg""a" );
    
register_logevent"RoundStart"2"1=Round_Start" );
    
    
register_clcmd"say !info""show_info_player" );
}

public 
bacon_spawnid ) {
    
is_user_aliveid ) ? SetPlayerBitg_aliveid ) : ResetPlayerBitg_aliveid )
}

public 
RoundStart( ) {
    new 
player32 ], iiNum;
    
get_playersplayeriNum"ac" );
    for( 
0iNumi++ ) { 
        
set_task3.0"give_weapon"); 
    }
}

public 
deathmsg( ) {
    
is_user_aliveid ) ? SetPlayerBitg_aliveid ) : ResetPlayerBitg_aliveread_data) );
    
remove_taskread_data) );
    
g_playerread_data) ][ kills ]++;
    
g_playerread_data) ][ deaths ]++;
}

public 
give_weaponid ) {
    if( !
GetPlayerBitg_aliveid ) ) return;
    
    
cs_set_user_armorid100CS_ARMOR_VESTHELM );
    
strip_user_weaponsid );
    
give_itemid"weapon_knife" );
    for( new 
0sizeof WEAPONSNi++ ) {
        
give_itemidWEAPONSN] );
        
cs_set_user_bpammoidWEAPONSC], WEAPONSA] );
    }
}

public 
show_info_playerid ) {
    
client_printidprint_chat"Your Kills: %i, your deaths: %i."g_playerid ][ kills ], g_playerid ][ deaths ] );

DoviuX is offline
Send a message via Skype™ to DoviuX
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-22-2012 , 16:44   Re: Bits problem
Reply With Quote #2

Code:
set_task( 3.0, "give_weapon", i );
->
Code:
set_task( 3.0, "give_weapon", player[i] );
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 04-22-2012 , 17:09   Re: Bits problem
Reply With Quote #3

Thanks
DoviuX is offline
Send a message via Skype™ to DoviuX
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 07:47.


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