Witam,
Stworzyłem swój własny plugin VIP'a za pośrednictwem Waszej strony, lecz mam z nim problem.
Mianowicie, ogólnie działanie pluginu jest bez zastrzeżeń, problem pojawia się gdy chcę dodać komuś vip'a.
VIP "t" ADMIN_LEVEL_H Poziom własny 8
Teoretycznie dodawanie vipa polega na dodaniu SID w users.ini i wygląda to tak
"STEAM_0:1:3759031138" "" "ht" "ce"
ale vip nie działa, dlaczego?
oto mój plik vip.sma
#include <amxmodx> #include <cstrike> #include <engine> #include <fun> #include <hamsandwich> forward amxbans_admin_connect(id); new CsArmorType:armortype, bool:g_Vip[33], gRound=0, g_Hudmsg, weapon_id; public plugin_init(){ register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill"); register_event("HLTV", "event_new_round", "a", "1=0", "2=0"); register_logevent("GameCommencing", 2, "1=Game_Commencing"); RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1); register_message(get_user_msgid("ScoreAttrib"), "VipStatus"); register_message(get_user_msgid("SayText"),"handleSayText"); g_Hudmsg=CreateHudSyncObj(); } public client_authorized(id){ if(get_user_flags(id) & 524290 == 524290){ client_authorized_vip(id); } } public client_authorized_vip(id){ g_Vip[id]=true; new g_Name[64]; get_user_name(id,g_Name,charsmax(g_Name)); set_hudmessage(24, 190, 220, 0.25, 0.2, 0, 6.0, 6.0); ShowSyncHudMsg(0, g_Hudmsg, "Vip %s wbija na serwer !",g_Name); } public client_disconnect(id){ if(g_Vip[id]){ client_disconnect_vip(id); } } public client_disconnect_vip(id){ g_Vip[id]=false; } public event_new_round(){ ++gRound; } public GameCommencing(){ gRound=0; } public SpawnedEventPre(id){ if(g_Vip[id]){ if(is_user_alive(id)){ SpawnedEventPreVip(id); } } } public SpawnedEventPreVip(id){ if(gRound>=1){ cs_set_user_armor(id, min(cs_get_user_armor(id,armortype)+100, 100), CS_ARMOR_VESTHELM); new henum=(user_has_weapon(id,CSW_HEGRENADE)?cs_get_user_bpammo(id,CSW_HEGRENADE):0); give_item(id, "weapon_hegrenade"); ++henum; new fbnum=(user_has_weapon(id,CSW_FLASHBANG)?cs_get_user_bpammo(id,CSW_FLASHBANG):0); give_item(id, "weapon_flashbang"); ++fbnum; cs_set_user_bpammo(id, CSW_FLASHBANG, 2); new sgnum=(user_has_weapon(id,CSW_SMOKEGRENADE)?cs_get_user_bpammo(id,CSW_SMOKEGRENADE):0); give_item(id, "weapon_smokegrenade"); ++sgnum; give_item(id, "weapon_deagle"); give_item(id, "ammo_50ae"); weapon_id=find_ent_by_owner(-1, "weapon_deagle", id); if(weapon_id)cs_set_weapon_ammo(weapon_id, 7); cs_set_user_bpammo(id, CSW_DEAGLE, 35); if(get_user_team(id)==2){ give_item(id, "item_thighpack"); } } if(gRound>=2){ cs_set_user_money(id, min(cs_get_user_money(id)+150, 16000), 1); } if(get_pdata_cbase(id, 368)==-1){ if(gRound>=2){ give_item(id, "weapon_xm1014"); give_item(id, "ammo_buckshot"); weapon_id=find_ent_by_owner(-1, "weapon_xm1014", id); if(weapon_id)cs_set_weapon_ammo(weapon_id, 7); cs_set_user_bpammo(id, CSW_XM1014, 32); } } } public VipStatus(){ new id=get_msg_arg_int(1); if(is_user_alive(id) && g_Vip[id]){ set_msg_arg_int(2, ARG_BYTE, get_msg_arg_int(2)|4); } } public handleSayText(msgId,msgDest,msgEnt){ new id = get_msg_arg_int(1); if(is_user_connected(id) && g_Vip[id]){ new szTmp[256],szTmp2[256]; get_msg_arg_string(2,szTmp, charsmax(szTmp)) new szPrefix[64] = "^x04[VIP]"; if(!equal(szTmp,"#Cstrike_Chat_All")){ add(szTmp2,charsmax(szTmp2),szPrefix); add(szTmp2,charsmax(szTmp2)," "); add(szTmp2,charsmax(szTmp2),szTmp); } else{ add(szTmp2,charsmax(szTmp2),szPrefix); add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 : %s2"); } set_msg_arg_string(2,szTmp2); } return PLUGIN_CONTINUE; } public amxbans_admin_connect(id){ client_authorized(id); }