AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bits problem (https://forums.alliedmods.net/showthread.php?t=183520)

DoviuX 04-22-2012 16:28

Bits problem
 
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 ] );



Emp` 04-22-2012 16:44

Re: Bits problem
 
Code:

set_task( 3.0, "give_weapon", i );
->
Code:

set_task( 3.0, "give_weapon", player[i] );

DoviuX 04-22-2012 17:09

Re: Bits problem
 
Thanks :) :crab:


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

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