Код:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <fun>
new WORLD_MODEL[] = "models/w_famas.mdl"
new OLDWORLD_MODEL[] = "models/w_scout.mdl" // the world model you want replaced
public plugin_init( ) {
register_plugin( "Scout To Famas", "1.0", "InsaNe" );
new naziv_mape[ 8 ];
get_mapname( naziv_mape, charsmax( naziv_mape ) );
if( equali( naziv_mape, "fy_snow") )
register_forward(FM_SetModel, "fw_SetModel");
register_forward( FM_CmdStart, "Provera" );
}
public fw_SetModel(entity, model[])
{
// check if its a valid entity or else we'll get errors
if(!is_valid_ent(entity))
return FMRES_IGNORED
// checks if it's the model we want to change
if(!equali(model, OLDWORLD_MODEL))
return FMRES_IGNORED
new className[33]
entity_get_string(entity, EV_SZ_classname, className, 32)
// dropped weapons map weapons c4 + grenades
if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
{
// set's the world model (what you see on the ground)
entity_set_model(entity, WORLD_MODEL)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
public Provera(id) {
if( !is_user_alive(id))
return FMRES_IGNORED;
if( get_user_weapon(id) == CSW_SCOUT)
{
strip_user_weapons(id);
set_task(0.1,"cmd_famas",id);
}
return FMRES_IGNORED;
}
public cmd_famas(id)
{
if ( cs_get_user_team(id) == CS_TEAM_T ) {
give_item(id,"weapon_famas")
cs_set_user_bpammo(id,CSW_FAMAS,90)
give_item(id,"weapon_glock18")
cs_set_user_bpammo(id,CSW_GLOCK18,40)
give_item(id,"weapon_knife")
}
if ( cs_get_user_team(id) == CS_TEAM_CT ) {
give_item(id,"weapon_famas")
cs_set_user_bpammo(id,CSW_FAMAS,90)
give_item(id,"weapon_usp")
cs_set_user_bpammo(id,CSW_USP,24)
give_item(id,"weapon_knife")
}
return PLUGIN_HANDLED;
}