Quote:
Originally Posted by usaexelent
It still doesn't work. On new round my skins doesn't change. That means that the Crysis array is still true and setarray didn't work. ;(
|
I havent test This, I think i should work.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
new VIEW_MODELKNIFE[] = "models/CRYSMOD/c_v_knife.mdl"
new VIEW_MODELAUG[] = "models/CRYSMOD/c_v_aug.mdl"
new VIEW_MODELUSP[] = "models/CRYSMOD/c_v_usp.mdl"
new PLAYER_MODELAUG[] = "models/CRYSMOD/c_p_aug.mdl"
new bool:Crysis[ 33 ]; // Holder for whether player is Crysis or not
public plugin_precache()
{
precache_model(VIEW_MODELKNIFE);
precache_model(VIEW_MODELAUG);
precache_model(VIEW_MODELUSP);
precache_model(PLAYER_MODELAUG);
}
public plugin_init()
{
register_plugin("Someting","0.1","usaexelent");
register_event( "CurWeapon", "Event_CurWeapon", "be", "1=1" ); // Register curweapon
register_logevent("GetCrysis", 2, "1=Round_Start")
register_clcmd("say /boost", "GetCrysis")
RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1);
}
public Event_CurWeapon( id )
{
if( !is_user_alive( id ) || !Crysis[ id ] )
return PLUGIN_CONTINUE;
switch( read_data(2) )
{
case CSW_KNIFE:
{
set_pev( id, pev_viewmodel2, VIEW_MODELKNIFE); // set models
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0) // set visibility
}
case CSW_USP:
{
set_pev( id, pev_viewmodel2, VIEW_MODELUSP); // set models
set_user_rendering(id)
}
case CSW_AUG:
{
set_pev( id, pev_viewmodel2, VIEW_MODELAUG); // set models
set_pev( id, pev_weaponmodel2, PLAYER_MODELAUG ); // set models
set_user_rendering(id)
}
default:
{
set_user_rendering(id);
}
}
}
public GetCrysis( )
{
arrayset(Crysis, sizeof(Crysis), false);
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum, "h" );
new iRand = iPlayers[ random( iNum ) ]; // Get random player
Crysis[ iRand ] = true; // Set the array index to true
client_print(iRand, print_chat, "You are Crysis now!");
}
public Player_Spawn_Post(id)
{
Crysis[id] = false;
}
public client_connect(id)
{
Crysis[id] = false;
}
public client_disconnect(id)
{
Crysis[id] = false;
}
If somthing is Wrong Plz Correct me!