Filehost.ro - gazduire fisiere
zstrike
Nou pe simpatie:
Angi pe Simpatie.ro
Femeie
25 ani
Bucuresti
cauta Barbat
26 - 52 ani
zstrikeReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
zstrike / Tutoriale & Resurse servere CS 1.6 /

[Tutorial] Cum coloram pluginurile

Pagini: 1 Moderat de h2k
#1
skizzi
Fondator ZStrike
Din: Slobozia
Postari: 407
M-am gandit sa va arat cum se fac pluginurile sa devine colorate.

^x01 = culoarea galben
^x02 = culoarea echipei [ Tero = rosu ; CT = albastru ; Spec = gri ]
^x03 = culoarea rosu
^x04 = culoarea verde

De exemplu luam pluginul Csreddevil_ss:

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new player
new ip[32]
new finish;

new maxscreens  //max nr of ss to a player
new screeninterval  //interval between 2 ss
new design  //visual stuff
new site  //the site/forum where a user can post ther pics to be unbanned

public plugin_init()
{
    register_plugin("CsRedDevil SS", "1.3", "edit by aEEk"
   
    register_concmd("amx_ss", "concmd_screen", ADMIN_LEVEL_A, "<authid, nick or #userid> <screens>"
    register_clcmd("say /ip", "show_ip"
   
    maxscreens = register_cvar("amx_ss_max", "5"
    screeninterval = register_cvar("amx_ss_interval", "1.0"
    design = register_cvar("amx_ss_design", "3"
    site = register_cvar("amx_ss_site","www.csreddevil.com"
}

public concmd_screen(id, level, cid)
{
    if(!cmd_access(id, level, cid, 3))   //if the one who requests an ss isnt admin exit
    {
        return PLUGIN_HANDLED
    }
   
    new arg1[24], arg2[4]
    read_argv(1, arg1, 23)
    read_argv(2, arg2, 3)
   
    new screens = str_to_num(arg2)
    new maxss = get_pcvar_num(maxscreens)
   
    if(screens > maxss)   //too many ss?
    {
        console_print(id, "[SS] Prea multe poze!"
       
        return PLUGIN_HANDLED
    }
   
    player = cmd_target(id, arg1, 1)
    if (!player)   //the player has exited the sv or he didnt existed
    {
        return PLUGIN_HANDLED
    }
    finish = screens
   
    new Float:interval = get_pcvar_float(screeninterval)    //a set_task for each "amx_ss nickname nr_of_ss"
    new array[2]
    array[0] = id //save usefull data in a vector so it can be reused
    array[1] = player
    set_task(interval, "ss_propriuzis", 0, array,2, "a", screens)
       
    return PLUGIN_HANDLED
}

public ss_propriuzis(array[2])
{
    //take data and set them accordingly
    new player = array[1]
    new id = array[0]
   
    //save time,adminname,playername so that the player cant give us other ss's and because it LOOKS COOOL!
    new timestamp[32], timestampmsg[128], name[32], adminname[32]
    get_time("%m/%d/%Y - %H:%M:%S", timestamp, 31)
    get_user_name(player, name, 31)
    get_user_name(id, adminname, 31)
    get_user_ip(player, ip, 31)
            
    //Clasic Design
    if(get_pcvar_num(design) == 0)
    {
        client_print(player, print_chat, "** Poza facuta pe jucatorul ^"%s^"de  adminul ^"%s^" **", name, adminname)
        client_cmd(player, "snapshot" //ss
    }
    //Doar Playerului
    else if(get_pcvar_num(design) == 1)
    {
        client_print(player, print_chat, "** Poza facuta pe jucatorul ^"%s^" de adminul ^"%s^" (%s) **", name, adminname, timestamp)
        client_cmd(player, "snapshot" //ss
    }
    //HUD Message doar Playerului
    else if(get_pcvar_num(design) == 2)
    {
        set_hudmessage(player, 255, 0, -1.0, 0.3, 0, 0.25, 1.0, 0.0, 0.0, 4)
        format(timestampmsg, 127, "** Ora: - %s **", timestamp)
        show_hudmessage(player, timestampmsg)
       
        client_cmd(player, "snapshot"  //ss
    }
    //Full
    else if(get_pcvar_num(design) == 3)
    {
        //HUD Timestamp Message
        set_hudmessage(player, 255, 0, -1.0, 0.3, 0, 0.25, 1.0, 0.0, 0.0, 4)
        format(timestampmsg, 127, "** Jucator %s Ora: - %s **",name,timestamp)
        show_hudmessage(player, timestampmsg)
        
        client_print(0, print_chat, "** Poza facuta pe jucatorul ^"%s^" de adminul ^"%s^" (%s) **", name, adminname, timestamp)
       
        client_cmd(player, "snapshot" //ss
    }
    console_print(id, "[SS]%s 's ip is %s!",name,ip)
    console_print(id, "[SS]%s 's ip is %s!",name,ip)
    console_print(id, "[SS]%s 's ip is %s!",name,ip)
    finish = finish - 1;
   
    if(finish == 0)
    {
        client_cmd(player, "kill"
        cs_set_user_team(player,CS_TEAM_SPECTATOR);
        new forum[51];
        get_pcvar_string(site,forum,50)
        client_print(player, print_chat, "Posteaza pozele pe %s pentru unban", forum)
    }
   
    return PLUGIN_CONTINUE;
}

public show_ip(id)
{
    console_print(id, "[SS]Last Stored IP: %s!",ip)
}
Si ca sa il facem COLORAT trebuie sa facem asa: (ce este cu ROSU trebuie adaugat/schimbat din primu exemplu)

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>

new player
new ip[32]
new finish;

new maxscreens  //max nr of ss to a player
new screeninterval  //interval between 2 ss
new design  //visual stuff
new site  //the site/forum where a user can post ther pics to be unbanned

public plugin_init()
{
    register_plugin("CsRedDevil SS", "1.3", "edit by aEEk"
   
    register_concmd("amx_ss", "concmd_screen", ADMIN_LEVEL_A, "<authid, nick or #userid> <screens>"
    register_clcmd("say /ip", "show_ip"
   
    maxscreens = register_cvar("amx_ss_max", "5"
    screeninterval = register_cvar("amx_ss_interval", "1.0"
    design = register_cvar("amx_ss_design", "3"
    site = register_cvar("amx_ss_site","www.csreddevil.com"
}

public concmd_screen(id, level, cid)
{
    if(!cmd_access(id, level, cid, 3))   //if the one who requests an ss isnt admin exit
    {
        return PLUGIN_HANDLED
    }
   
    new arg1[24], arg2[4]
    read_argv(1, arg1, 23)
    read_argv(2, arg2, 3)
   
    new screens = str_to_num(arg2)
    new maxss = get_pcvar_num(maxscreens)
   
    if(screens > maxss)   //too many ss?
    {
        console_print(id, "[SS] Prea multe poze!"
       
        return PLUGIN_HANDLED
    }
   
    player = cmd_target(id, arg1, 1)
    if (!player)   //the player has exited the sv or he didnt existed
    {
        return PLUGIN_HANDLED
    }
    finish = screens
   
    new Float:interval = get_pcvar_float(screeninterval)    //a set_task for each "amx_ss nickname nr_of_ss"
    new array[2]
    array[0] = id //save usefull data in a vector so it can be reused
    array[1] = player
    set_task(interval, "ss_propriuzis", 0, array,2, "a", screens)
       
    return PLUGIN_HANDLED
}

public ss_propriuzis(array[2])
{
    //take data and set them accordingly
    new player = array[1]
    new id = array[0]
   
    //save time,adminname,playername so that the player cant give us other ss's and because it LOOKS COOOL!
    new timestamp[32], timestampmsg[128], name[32], adminname[32]
    get_time("%m/%d/%Y - %H:%M:%S", timestamp, 31)
    get_user_name(player, name, 31)
    get_user_name(id, adminname, 31)
    get_user_ip(player, ip, 31)
            
    //Clasic Design
    if(get_pcvar_num(design) == 0)
    {
        ColorChat(player, print_chat, "^x02** Poza facuta pe jucatorul ^x04^"%s^"de  adminul ^x04^"%s^" **", name, adminname)
        client_cmd(player, "snapshot" //ss
    }
    //Doar Playerului
    else if(get_pcvar_num(design) == 1)
    {
        ColorChat(player, print_chat, "^x02** Poza facuta pe jucatorul ^x04^"%s^" de adminul ^x04^"%s^" (%s) **", name, adminname, timestamp)
        client_cmd(player, "snapshot" //ss
    }
    //HUD Message doar Playerului
    else if(get_pcvar_num(design) == 2)
    {
        set_hudmessage(player, 255, 0, -1.0, 0.3, 0, 0.25, 1.0, 0.0, 0.0, 4)
        format(timestampmsg, 127, "** Ora: - %s **", timestamp)
        show_hudmessage(player, timestampmsg)
       
        client_cmd(player, "snapshot"  //ss
    }
    //Full
    else if(get_pcvar_num(design) == 3)
    {
        //HUD Timestamp Message
        set_hudmessage(player, 255, 0, -1.0, 0.3, 0, 0.25, 1.0, 0.0, 0.0, 4)
        format(timestampmsg, 127, "** Jucator %s Ora: - %s **",name,timestamp)
        show_hudmessage(player, timestampmsg)
        
        ColorChat(player, print_chat, "^x02** Poza facuta pe jucatorul ^x04^"%s^" de adminul ^x04^"%s^" (%s) **", name, adminname, timestamp)
       
        client_cmd(player, "snapshot" //ss
    }
    console_print(id, "[SS]%s 's ip is %s!",name,ip)
    console_print(id, "[SS]%s 's ip is %s!",name,ip)
    console_print(id, "[SS]%s 's ip is %s!",name,ip)
    finish = finish - 1;
   
    if(finish == 0)
    {
        client_cmd(player, "kill"
        cs_set_user_team(player,CS_TEAM_SPECTATOR);
        new forum[51];
        get_pcvar_string(site,forum,50)
        ColorChat(player, print_chat, "^x01Posteaza pozele pe ^x04%s pentru unban", forum)
    }
   
    return PLUGIN_CONTINUE;
}

public show_ip(id)
{
    console_print(id, "[SS]Last Stored IP: %s!",ip)
}

Deci, pe server ar trebui sa arata cam asa:

TERO:

** Poza facuta pe jucatorul skizzi de adminul skizzi**

CT:

** Poza facuta pe jucatorul skizzi de adminul skizzi **

SPEC:
** Poza facuta pe jucatorul skizzi de adminul skizzi **

Pentru cel care au fost facut SS'urile:

Posteaza pozele pe www.zstrike.3xforum.ro pentru unban

Posteaza pozele pe www.zstrike.3xforum.ro pentru unban


Posteaza pozele pe www.zstrike.3xforum.ro pentru unban



Pentru nelamuriri post reply !!!


_______________________________________
Welcome To www.ZStrike.3xForum.Ro


Caut administrator pe  www.ZStrike.3xforum.ro

 
   

Topicuri similare

Pagini: 1