Vipas

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Keistas
Jau po truputį tampa savu
Posts: 144
Joined: 2011 Feb 23 19:44
Skype: mindzekas.nu

Re: Vipas

Post by Keistas »

Neišeina ne kaip... Padėkit, va ka rašo:

L 05/27/2011 - 21:50:08: [AMXX] Displaying debug trace (plugin "Vipas.amxx")
L 05/27/2011 - 21:50:08: [AMXX] Run time error 10: native error (native "get_user_flags")
L 05/27/2011 - 21:50:08: [AMXX] [0] textchABR9.sma::Damage (line 83)

Code: Select all

#include <amxmodx>#include <amxmisc>#include <fakemeta>#include <cstrike>#include <hamsandwich>#include <fun>#include <engine> #define Keysrod (1<<0) | (1<<1) | (1<<9)#define DAMAGE_RECIEVED static const COLOR[] = "^x04"static const CONTACT[] = "mindzekas.nu arba reduskinas2" new const VIP_STATUS[] = "Prisijunge vipai"new const VIP_STATUS_N[] = "Dabar vipu nera prisijungusiu" new gravity new health_addnew health_add_hsnew health_max new nKillernew nKiller_hpnew nHp_addnew nHp_max new AWP_Active new SayTxTnew msgSayTextnew g_maxplayersnew g_HudSyncObj #if defined DAMAGE_RECIEVED//new g_HudSync_Damage2#endif public plugin_init(){    register_plugin("VIP", "2.06", "CesoZona.eu")    register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)        gravity = register_cvar("amx_vip_gravity", "0.5")     health_add  = register_cvar("amx_vip_hp", "15")    health_add_hs   = register_cvar("amx_vip_hp_hs", "25")    health_max  = register_cvar("amx_vip_hp_max", "350")        RegisterHam(Ham_Spawn, "player", "Ham_PlayerSpawn", 1)     AWP_Active  = register_cvar("amx_vip_awp_active", "1")     register_event("Damage", "Damage", "b", "2!0", "3=0", "4!0")//register_event("Damage", "Damage", "b")//register_event("DeathMsg", "death_msg", "a")    register_event("DeathMsg", "hook_death", "a", "1>0")    register_event("CurWeapon", "Cur_Weapon", "be", "1=1")            register_clcmd("awp", "HandleCmd")//register_clcmd("sg550", "HandleCmd")//register_clcmd("g3sg1", "HandleCmd")     register_clcmd("say /vip", "VipInformation")    register_clcmd("say", "vip_show")        SayTxT = get_user_msgid("SayText");    msgSayText = get_user_msgid("SayText")    g_maxplayers = get_maxplayers()    } public plugin_cfg()        g_HudSyncObj = CreateHudSyncObj();        public Damage(Cl){        static Attacker;        Attacker = get_user_attacker(Cl);        if (!is_user_alive(id))    return         if (get_user_flags(Attacker) & ADMIN_LEVEL_H)        {                set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 7);                ShowSyncHudMsg(Attacker, g_HudSyncObj, "%d^n", read_data(2));        }} public hook_death(){    nKiller = read_data(1)     if ((read_data(3) == 1) && (read_data(5) == 0))    {        nHp_add = get_pcvar_num(health_add_hs)    }     else        nHp_add = get_pcvar_num(health_add)     nHp_max = get_pcvar_num(health_max)     if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))        return     nKiller_hp = get_user_health(nKiller)    nKiller_hp += nHp_add     if(nKiller_hp > nHp_max)        nKiller_hp = nHp_max     set_user_health(nKiller, nKiller_hp)     message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)    write_short(1<<10)    write_short(1<<10)    write_short(0x0000)    write_byte(0)    write_byte(0)    write_byte(200)    write_byte(75)    message_end()} public Ham_PlayerSpawn(id) {   if (!is_user_alive(id))      return    if(get_user_flags(id) & ADMIN_LEVEL_H)       set_user_gravity(id, get_pcvar_float(gravity)) }  public HandleCmd(id){    if (!get_pcvar_num(AWP_Active))        return PLUGIN_CONTINUE     if(get_user_flags(id) & ADMIN_LEVEL_H)        return PLUGIN_CONTINUE     client_print(id, print_center, "* AWP - Tik Vipams, daugiau info /vip *")    return PLUGIN_HANDLED} public Cur_Weapon(id){    if (!get_pcvar_num(AWP_Active))        return PLUGIN_CONTINUE     new WeaponID = read_data(2)     new mapname[32]    get_mapname(mapname, 31)     if (equali(mapname, "awp_", 3))        return PLUGIN_CONTINUE     else    {        if (WeaponID == CSW_AWP)        {            if (!(get_user_flags(id) & ADMIN_LEVEL_H))            {                client_print(id, print_center, "* AWP - Tik Vipams, daugiau info /vip *")                client_cmd(id, "drop")            }        }    }     return PLUGIN_HANDLED}  public VipInformation(id){    show_motd(id, "vipas.txt", "Vipo INFORMACIJA")} public vip_show(id) {    new said[192]    read_args(said,192)    if( ( containi(said, "donators") != -1 && containi(said, "vips") != -1 ) || contain(said, "/vips") != -1 )        set_task(0.1, "viplist", id)} public viplist(user) {    new vipnames[33][32]    new message[256]    new id, count, x, len        for(id = 1 ; id <= g_maxplayers ; id++)        if(is_user_connected(id))            if(get_user_flags(id) & ADMIN_LEVEL_H)                get_user_name(id, vipnames[count++], 31)     len = format(message, 255, "%s %s: ",COLOR, VIP_STATUS)    if(count > 0) {        for(x = 0 ; x < count ; x++) {            len += format(message[len], 255-len, "%s%s ", vipnames[x], x < (count-1) ? ", ":"")            if(len > 96 ) {                print_message(user, message)                len = format(message, 255, "%s ",COLOR)            }        }        print_message(user, message)    }    else {        len += format(message[len], 255-len, "%s.", VIP_STATUS_N)        print_message(user, message)    }} public client_authorized(id){    set_task(5.0, "PrintText", id)} public PrintText(id){    new message[256]    format(message, 255, "^x04[CesoZona-VIP]^x01 Rasyk:^x03 /vip^x01 kad pamatytum kokias teises turi ^x04 VIP.")    print_message(id, message)     return PLUGIN_CONTINUE} print_message(id, msg[]){    message_begin(MSG_ONE, msgSayText, {0,0,0}, id)    write_byte(id)    write_string(msg)    message_end()} stock client_printcolor(const id, const input[], any:...){    new count = 1, players[32];    static msg[191];    vformat(msg,190,input,3);    replace_all(msg,190,"/g","^4");// green txt    replace_all(msg,190,"/y","^1");// orange txt    replace_all(msg,190,"/ctr","^3");// team txt    replace_all(msg,190,"/w","^0");// team txt    if (id) players[0] = id; else get_players(players,count,"ch");    for (new i = 0; i < count; i++)        if (is_user_connected(players[i]))        {            message_begin(MSG_ONE_UNRELIABLE, SayTxT, _, players[i]);            write_byte(players[i]);            write_string(msg);            message_end();        }} public client_connect(id){new name[32]get_user_info(id, "name", name, 31)if(get_user_flags(id) & ADMIN_LEVEL_H) {set_hudmessage(200, 0, 0, 0.05, 0.65, 2, 0.02, 30.0, 0.03, 0.3, 5)show_hudmessage(0, "VIPAS %s prisijunge!",name)}}/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }*/ 

User avatar
aaarnas
Vyr. diskusijų administratorius
Posts: 3891
Joined: 2010 Aug 31 13:21
Skype: fiarno
Contact:

Re: Vipas

Post by aaarnas »

85 eilutėje įdėk:

Code: Select all

if(!(1<=Attacker<=g_maxplayers)) return;
Palikau CS pasaulį ;/ . Nebepasiekiamas.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests