Žalia spalva

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
User avatar
xFrostas
Flooderis arba specialistas
Posts: 660
Joined: 2010 Sep 02 15:47
Skype: frost.lt

Re: Žalia spalva

Post by xFrostas »

duok dabar visą sma, sutvarkysiu tau.

Keistas
Jau po truputį tampa savu
Posts: 144
Joined: 2011 Feb 23 19:44
Skype: mindzekas.nu

Re: Žalia spalva

Post by Keistas »

Code: Select all

#include <amxmodx>#include <hamsandwich>#include <gunxpmod>#include <jctf>   new g_msgSayText new const XP_KILLCARRIER =      15 /* for killing the flag carrier */new const XP_STEAL =            50 /* for stealing the dropped flag from the enemy base */new const XP_PICKUP =           50 /* for picking the dropped enemy flag */new const XP_DROP =         -20 /* for dropping the flag when killed */new const XP_MANUALDROP =       -20 /* for dropping the flag using /dropflag  */new const XP_RETURN =           30 /* for returning your flag */new const XP_RETURN_ASSIST =        30 /* for assisting on returning the flag */new const XP_CAPTURE =          100 /* for capturing the enemy flag */new const XP_CAPTURE_ASSIST =       30 /* for assisting on capturing the enemy flag */ new g_iMaxPlayers public plugin_init(){    register_plugin("jCTF + GunXP: Get XP for flags", "0.2", "Digi")        new szVersion[6]        get_cvar_string("jctf_version", szVersion, charsmax(szVersion))        if(str_to_float(szVersion) < 1.26)        set_fail_state("jCTF is required at least v1.26 !")        g_iMaxPlayers = get_maxplayers()        RegisterHam(Ham_Killed, "player", "player_killed", 1)        g_msgSayText = get_user_msgid("SayText")} public player_killed(iVictim, iKiller){    if(XP_KILLCARRIER != 0 && iVictim != iKiller && 1 <= iKiller <= g_iMaxPlayers && jctf_get_flagcarrier(iVictim) && jctf_get_team(iVictim) != jctf_get_team(iKiller))    {        set_user_xp(iKiller, get_user_xp(iKiller) + XP_KILLCARRIER)                printcolor(iKiller, "/g[GunXP] /y%s%d XP for killing the flag carrier", XP_KILLCARRIER > 0 ? "+" : "", XP_KILLCARRIER)    }} public jctf_flag(iEvent, iPlayer, iFlagTeam, bool:bAssist){    new iXP        switch(iEvent)    {        case FLAG_STOLEN:        {            iXP = XP_STEAL                        if(iXP != 0)                 client_print(iPlayer, print_center, "[GunXP] %s%d XP kad paemei prieso VELIAVA", XP_STEAL > 0 ? "+" : "", XP_STEAL)        }                case FLAG_PICKED:        {            iXP = XP_PICKUP                        if(iXP != 0)                client_print(iPlayer, print_center, "[GunXP] %s%d XP kad paemei prieso veliava", XP_PICKUP > 0 ? "+" : "", XP_PICKUP)        }                case FLAG_DROPPED:        {            iXP = XP_DROP                        if(iXP != 0)                client_print(iPlayer, print_center, "[GunXP] %s%d XP kad ismetei prieso veliava", XP_DROP > 0 ? "+" : "", XP_DROP)        }                case FLAG_MANUALDROP:        {            iXP = XP_MANUALDROP                        if(iXP != 0)                client_print(iPlayer, print_center, "[GunXP] %s%d XP uz tai kad tycia ismetei prieso veliava", XP_MANUALDROP > 0 ? "+" : "", XP_MANUALDROP)        }                case FLAG_RETURNED:        {            if(bAssist)            {                iXP = XP_RETURN_ASSIST                                if(iXP != 0)                    client_print(iPlayer, print_center, "[GunXP] %s%d XP uz tai kad padejai susigrazinti veliava", XP_RETURN_ASSIST > 0 ? "+" : "", XP_RETURN_ASSIST)            }            else            {                iXP = XP_RETURN                                if(iXP != 0)                    client_print(iPlayer, print_center, "[GunXP] %s%d XP kad grazinai veliava", XP_RETURN > 0 ? "+" : "", XP_RETURN)            }        }                case FLAG_CAPTURED:        {            if(bAssist)            {                iXP = XP_CAPTURE_ASSIST                                if(iXP != 0)                    client_print(iPlayer, print_center, "[GunXP] %s%d XP uz tai kad padejai susigrazinti prieso veliava", XP_CAPTURE_ASSIST > 0 ? "+" : "", XP_CAPTURE_ASSIST)            }            else            {                iXP = XP_CAPTURE                                if(iXP != 0)                    client_print(iPlayer, print_center, "[GunXP] %s%d XP uz tai kad pavogei prieso VELIAVA", XP_CAPTURE > 0 ? "+" : "", XP_CAPTURE)            }        }    }        if(iXP != 0)        set_user_xp(iPlayer, get_user_xp(iPlayer) + iXP)} stock print_color(const id, const input[], any:...){        new iCount = 1, iPlayers[32]        static szMsg[191]    vformat(szMsg, charsmax(szMsg), input, 3)        replace_all(szMsg, 190, "/g", "^4") // green txt    replace_all(szMsg, 190, "/y", "^1") // orange txt    replace_all(szMsg, 190, "/ctr", "^3") // team txt    replace_all(szMsg, 190, "/w", "^0") // team txt        if(id) iPlayers[0] = id    else get_players(iPlayers, iCount, "ch")        for (new i = 0; i < iCount; i++)    {        if (is_user_connected(iPlayers[i]))        {            message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])            write_byte(iPlayers[i])            write_string(szMsg)            message_end()        }    }}
Štai, arba
Attachments
jctf_gunxp_getxp.sma
(5.14 KiB) Downloaded 722 times

User avatar
xFrostas
Flooderis arba specialistas
Posts: 660
Joined: 2010 Sep 02 15:47
Skype: frost.lt

Re: Žalia spalva

Post by xFrostas »

daryk print_color, o ne printcolor, nes gi stock'e tai print_color..

Keistas
Jau po truputį tampa savu
Posts: 144
Joined: 2011 Feb 23 19:44
Skype: mindzekas.nu

Re: Žalia spalva

Post by Keistas »

Jo žioplumo klaida, viskas sukomplino pagaliau...

Bet va, kad spalvu nedaro:

Code: Select all

#include <amxmodx>#include <hamsandwich>#include <gunxpmod>#include <jctf>   new g_msgSayText new const XP_KILLCARRIER =      15 /* for killing the flag carrier */new const XP_STEAL =            50 /* for stealing the dropped flag from the enemy base */new const XP_PICKUP =           50 /* for picking the dropped enemy flag */new const XP_DROP =         -20 /* for dropping the flag when killed */new const XP_MANUALDROP =       -20 /* for dropping the flag using /dropflag  */new const XP_RETURN =           30 /* for returning your flag */new const XP_RETURN_ASSIST =        30 /* for assisting on returning the flag */new const XP_CAPTURE =          100 /* for capturing the enemy flag */new const XP_CAPTURE_ASSIST =       30 /* for assisting on capturing the enemy flag */ new g_iMaxPlayers public plugin_init(){    register_plugin("jCTF + GunXP: Get XP for flags", "0.2", "Digi")        new szVersion[6]        get_cvar_string("jctf_version", szVersion, charsmax(szVersion))        if(str_to_float(szVersion) < 1.26)        set_fail_state("jCTF is required at least v1.26 !")        g_iMaxPlayers = get_maxplayers()        RegisterHam(Ham_Killed, "player", "player_killed", 1)        g_msgSayText = get_user_msgid("SayText")} public player_killed(iVictim, iKiller){    if(XP_KILLCARRIER != 0 && iVictim != iKiller && 1 <= iKiller <= g_iMaxPlayers && jctf_get_flagcarrier(iVictim) && jctf_get_team(iVictim) != jctf_get_team(iKiller))    {        set_user_xp(iKiller, get_user_xp(iKiller) + XP_KILLCARRIER)                print_color(iKiller, "/g[GunXP] /y%s%d XP for killing the flag carrier", XP_KILLCARRIER > 0 ? "+" : "", XP_KILLCARRIER)    }} public jctf_flag(iEvent, iPlayer, iFlagTeam, bool:bAssist){    new iXP        switch(iEvent)    {        case FLAG_STOLEN:        {            iXP = XP_STEAL                        if(iXP != 0)                 client_print(iPlayer, print_chat, "^4[GunXP] %s%d XP kad paemei prieso VELIAVA", XP_STEAL > 0 ? "+" : "", XP_STEAL)        }                case FLAG_PICKED:        {            iXP = XP_PICKUP                        if(iXP != 0)                client_print(iPlayer, print_chat, "^4[GunXP] %s%d XP kad paemei prieso veliava", XP_PICKUP > 0 ? "+" : "", XP_PICKUP)        }                case FLAG_DROPPED:        {            iXP = XP_DROP                        if(iXP != 0)                client_print(iPlayer, print_chat, "^4[GunXP] %s%d XP kad ismetei prieso veliava", XP_DROP > 0 ? "+" : "", XP_DROP)        }                case FLAG_MANUALDROP:        {            iXP = XP_MANUALDROP                        if(iXP != 0)                client_print(iPlayer, print_chat, "^4[GunXP] %s%d XP uz tai kad tycia ismetei prieso veliava", XP_MANUALDROP > 0 ? "+" : "", XP_MANUALDROP)        }                case FLAG_RETURNED:        {            if(bAssist)            {                iXP = XP_RETURN_ASSIST                                if(iXP != 0)                    client_print(iPlayer, print_chat, "[GunXP] %s%d XP uz tai kad padejai susigrazinti veliava", XP_RETURN_ASSIST > 0 ? "+" : "", XP_RETURN_ASSIST)            }            else            {                iXP = XP_RETURN                                if(iXP != 0)                    client_print(iPlayer, print_chat, "[GunXP] %s%d XP kad grazinai veliava", XP_RETURN > 0 ? "+" : "", XP_RETURN)            }        }                case FLAG_CAPTURED:        {            if(bAssist)            {                iXP = XP_CAPTURE_ASSIST                                if(iXP != 0)                    client_print(iPlayer, print_chat, "[GunXP] %s%d XP uz tai kad padejai susigrazinti prieso veliava", XP_CAPTURE_ASSIST > 0 ? "+" : "", XP_CAPTURE_ASSIST)            }            else            {                iXP = XP_CAPTURE                                if(iXP != 0)                    client_print(iPlayer, print_chat, "[GunXP] %s%d XP uz tai kad pavogei prieso VELIAVA", XP_CAPTURE > 0 ? "+" : "", XP_CAPTURE)            }        }    }        if(iXP != 0)        set_user_xp(iPlayer, get_user_xp(iPlayer) + iXP)} stock print_color(const id, const input[], any:...){        new iCount = 1, iPlayers[32]        static szMsg[191]    vformat(szMsg, charsmax(szMsg), input, 3)        replace_all(szMsg, 190, "/g", "^4") // green txt    replace_all(szMsg, 190, "/y", "^1") // orange txt    replace_all(szMsg, 190, "/ctr", "^3") // team txt    replace_all(szMsg, 190, "/w", "^0") // team txt        if(id) iPlayers[0] = id    else get_players(iPlayers, iCount, "ch")        for (new i = 0; i < iCount; i++)    {        if (is_user_connected(iPlayers[i]))        {            message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])            write_byte(iPlayers[i])            write_string(szMsg)            message_end()        }    }}
Aš padares ant kai kuriu kolkas tuos ^4 bandžiau ir /g

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

Re: Žalia spalva

Post by aaarnas »

Negali nerodyti. O ten negalėjau patikrinti, nes include to neturėjau.
Palikau CS pasaulį ;/ . Nebepasiekiamas.

Keistas
Jau po truputį tampa savu
Posts: 144
Joined: 2011 Feb 23 19:44
Skype: mindzekas.nu

Re: Žalia spalva

Post by Keistas »

Dėl tu

Code: Select all

#include <amxmodx>#include <hamsandwich>#include <gunxpmod>#include <jctf>
Šiose bibliotekose lygtais nėra print_color

Va paveikslėlis:
http://www.part.lt/perziura/d3ac95febce ... 626796.JPG

User avatar
xFrostas
Flooderis arba specialistas
Posts: 660
Joined: 2010 Sep 02 15:47
Skype: frost.lt

Re: Žalia spalva

Post by xFrostas »

kode žinutė turi atrodyti taip:

print_color(id, "/g[GunXP] /yTavo tekstas.")

o per žaidima bus šitaip:

[GunXP] Tavo tekstas.

Keistas
Jau po truputį tampa savu
Posts: 144
Joined: 2011 Feb 23 19:44
Skype: mindzekas.nu

Re: Žalia spalva

Post by Keistas »

xFrostas wrote:kode žinutė turi atrodyti taip:

print_color(id, "/g[GunXP] /yTavo tekstas.")

o per žaidima bus šitaip:

[GunXP] Tavo tekstas.
Kai taip padarau, meta error:

jctf_gunxp_getxp.sma<61> error 035: argument type mismatch <argument 2>
jctf_gunxp_getxp.sma<69> error 035: argument type mismatch <argument 2>
jctf_gunxp_getxp.sma<77> error 035: argument type mismatch <argument 2>
jctf_gunxp_getxp.sma<85> error 035: argument type mismatch <argument 2>
jctf_gunxp_getxp.sma<95> error 035: argument type mismatch <argument 2>
jctf_gunxp_getxp.sma<102> error 035: argument type mismatch <argument 2>
jctf_gunxp_getxp.sma<113> error 035: argument type mismatch <argument 2>
jctf_gunxp_getxp.sma<120> error 035: argument type mismatch <argument 2>


Susitvarkiau reikėjo:

Code: Select all

print_color(iPlayer, "/g[GunXP] /y%s%d XP kad paemei prieso VELIAVA", XP_STEAL > 0 ? "+" : "", XP_STEAL)

FrankJScott
Gana aktyvus vartotojas
Posts: 302
Joined: 2024 Apr 04 22:28
Skype: asfasf

High Rated Product Blog

Post by FrankJScott »

Please try Google before asking about Great Product Website 3d06748

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests