Offline |
|
|
Csatlakozott:2017.08.09. 17:01 Hozzászólások:266 Megköszönt másnak: 61 alkalommal Megköszönték neki: 72 alkalommal
|
Sziasztok! Szeretnék kérdezni ha szabad. Ham_Item_Deploynál melyik az amelyik legkevésbé eszi a szervert? Egy ilyesmi?new const g_sWeaponTypeDeploy[][] = { "weapon_m4a1", "weapon_awp", "weapon_deagle", "weapon_knife", "weapon_galil", "weapon_glock18", "weapon_usp", "weapon_fiveseven", "weapon_mp5navy", "weapon_p90", "weapon_famas", "weapon_ak47" }; enum _:WeapDeployType{ Weapon_cs, ActiveSkinNumber } new const g_iWeaponTypeDeploy[][WeapDeployType] = { { CSW_M4A1, 0 }, { CSW_AWP, 1}, { CSW_DEAGLE, 2}, { CSW_KNIFE, 3}, { CSW_GALIL, 4}, { CSW_GLOCK18, 5}, { CSW_USP, 6}, { CSW_FIVESEVEN, 7}, { CSW_MP5NAVY, 8}, { CSW_P90, 9}, { CSW_FAMAS, 10}, { CSW_AK47, 11} }; new g_iActiveSkin[iMaxWeapType][33]; for(new i = 0; i < sizeof(g_sWeaponTypeDeploy); i++) RegisterHam(Ham_Item_Deploy, g_sWeaponTypeDeploy[i], "weapon_change", 1); public weapon_change(iEnt) { new id = get_pdata_cbase(iEnt, 41, 4); if(!is_user_alive(id) || !is_user_connected(id)) return HAM_IGNORED; new iWeapon = cs_get_user_weapon(id); for(new i = 0; i < sizeof(g_iWeaponTypeDeploy); i++) { if(iWeapon == g_iWeaponTypeDeploy[i][Weapon_cs]) { if(g_iActiveSkin[g_iWeaponTypeDeploy[i][ActiveSkinNumber]][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[g_iWeaponTypeDeploy[i][ActiveSkinNumber]][id]][eWeaponFile]); } } return HAM_IGNORED; }
vagy ha simán csak így csinálom:switch(iWeapon) { case CSW_M4A1: { if(g_iActiveSkin[0][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[0][id]][eWeaponFile]); } case CSW_AWP: { if(g_iActiveSkin[1][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[1][id]][eWeaponFile]); } case CSW_DEAGLE: { if(g_iActiveSkin[2][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[2][id]][eWeaponFile]); } case CSW_KNIFE: { if(g_iActiveSkin[3][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[3][id]][eWeaponFile]); } case CSW_GALIL: { if(g_iActiveSkin[4][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[4][id]][eWeaponFile]); } case CSW_GLOCK18: { if(g_iActiveSkin[5][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[5][id]][eWeaponFile]); } case CSW_USP: { if(g_iActiveSkin[6][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[6][id]][eWeaponFile]); } case CSW_FIVESEVEN: { if(g_iActiveSkin[7][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[7][id]][eWeaponFile]); } case CSW_MP5NAVY: { if(g_iActiveSkin[8][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[8][id]][eWeaponFile]); } case CSW_P90: { if(g_iActiveSkin[9][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[9][id]][eWeaponFile]); } case CSW_FAMAS: { if(g_iActiveSkin[10][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[10][id]][eWeaponFile]); } case CSW_AK47: { if(g_iActiveSkin[11][id] == -1) return HAM_IGNORED; else entity_set_string(id, EV_SZ_viewmodel, g_cAllWeapons[g_iActiveSkin[11][id]][eWeaponFile]); } }
Vagy valami észrevétel, hogy mit lehetne szebben/egyszerűbben? UI: Nem jó az smabox? _________________ "Szeretek aludni... mert az álmaim szebbek, mint a valóság."
|
|