Old4Game

Old4Game - New gaming generations

1408942Dum Oct 01, 2017 6:29 am6293BuNiCu.wHVizitatorVizitator

    Executare Client[AMXX]

    Distribuiţi
    avatar
    FeeL^Me
    Membru

    Member Title : WGR Member
    Mesaje : 53
    Join : 26/06/2012

    Executare Client[AMXX]

    Mesaj Scris de FeeL^Me la data de Mier Iun 27, 2012 5:03 am

    Sallut la toti ! In acest tutorial va veti putea executa o comanda asupra unui jucator(client)

    La inceput avem asa :
    Cod:
    /* Script generated by Pawn Studio */

    #include
    #include

    #define PLUGIN "New Plugin"
    #define AUTHOR "Unknown"
    #define VERSION "1.0"

    public plugin_init()
    {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    // Add your own code here
    }


    Adaugam concmd

    Cod:
    register_concmd("comanda","public-ul",accesul de Admin,"Mesajul ce va aparea la amx_help")

    la noi fiind -->
    Cod:
    register_concmd("amx_ss","ss",ADMIN_KICK,"- Faci snapshot unui jucator")


    sa va reamintesc lista acceselor la admini
    Cod:
    ADMIN_SLAP
    ADMIN_SLAY
    ADMIN_KICK
    ADMIN_BAN
    ADMIN_MAP
    ADMIN_CVAR
    ADMIN_RCON
    ADMIN_VOTE
    ADMIN_CHAT
    ADMIN_CFG
    ADMIN_PASSWORD
    ADMIN_IMMUNITY
    ADMIN_RESERVATION
    ADMIN_LEVEL_A
    ADMIN_LEVEL_B
    ADMIN_LEVEL_C
    ADMIN_LEVEL_D
    ADMIN_LEVEL_E
    ADMIN_LEVEL_F
    ADMIN_LEVEL_G
    ADMIN_LEVEL_H


    Acum adaugam publicul
    Cod:
    public ss(id,level,cid){

    }


    Acum sa verificam ca este admin adaugam
    Cod:
    if(!cmd_access(id,level,cid,2))
    return PLUGIN_HANDLED;


    Acuma trebuie sa cream codul care va fi executat pe jucator, si cream un :

    Cod:
    new arg[32]
    read_argv(1,arg,31)


    Acum trebuie sa facem ca acest arg sa fie executat pe cineva
    Cod:
    new player = cmd_target(id,arg,1)


    Acum verificam daca jucatorul este viu
    Cod:
    if(!is_user_alive(id))
    return PLUGIN_HANDLED


    Pana acum avem asa :
    Cod:
    public ss(id,level,cid){
    if(!cmd_access(id,level,cid,2))
    return PLUGIN_HANDLED;

    new arg[32]
    read_argv(1,arg,31)
    new player = cmd_target(id,arg,1)

    if(!is_user_alive(id))
    return PLUGIN_HANDLED

    }


    Acum cream comanda :
    Cod:
    client_cmd(player,"snapshot")
    return PLUGIN_HANDLED


    Pentru cei care zic de exp :
    Cod:
    Nu arata nicaieri ca a executat poza :|
    Nu arata numele la admin
    Nu arata numele la jucator


    Unde aveam --> | Adaugam asta deasupra lui
    Cod:
    client_cmd(player,"snapshot")

    Cod:
    client_print(0, print_chat, "ADMIN ii face ss lui %s", player)

    Acum fa arata doar numele Jucatorului executat .
    Daca vrem sa arate si numele adminului adaugam

    static name[32]
    get_user_name(id,name,31);

    si apoi modificam :
    Cod:
    client_print(0, print_chat, "ADMIN ii face ss lui %s", player)

    cu -->
    Cod:
    client_print(0, print_chat, "ADMIN %s ii face ss lui %s",name , player)

    si la final ar trebui sa arate :
    Cod:
    /* Script generated by Pawn Studio */

    #include
    #include

    #define PLUGIN "New Plugin"
    #define AUTHOR "Unknown"
    #define VERSION "1.0"

    public plugin_init() {
    register_plugin(PLUGIN,VERSION,AUTHOR)
    register_concmd("amx_ss","ss",ADMIN_KICK,"- facem ss jucatorului")
    }

    public ss(id,level,cid){
    if(!cmd_access(id,level,cid,2))
    return PLUGIN_HANDLED;

    static name[32]
    new arg[32]

    read_argv(1,arg,31)
    new player = cmd_target(id,arg,1)

    get_user_name(id,name,31);

    if(!is_user_alive(id))
    return PLUGIN_HANDLED

    client_print(0, print_chat, "ADMIN %s ii face ss lui %s", name, player)
    client_cmd(player,"snapshot")

    return PLUGIN_HANDLED
    }
    avatar
    Sideways ;d
    Membru

    Member Title : WGR Member
    Mesaje : 396
    Join : 04/05/2011

    Re: Executare Client[AMXX]

    Mesaj Scris de Sideways ;d la data de Mar Iul 03, 2012 7:37 am

    prea complicat dupa parerea mea ..
    avatar
    kEnT10
    Membru

    Member Title : WGR Member
    Mesaje : 456
    Join : 17/11/2011
    Localizare : SIBIU

    Re: Executare Client[AMXX]

    Mesaj Scris de kEnT10 la data de Lun Iul 16, 2012 4:38 am

    Supper ;x
    avatar
    [D0m!n0]F|4V!U$
    Membru

    Member Title : WGR Member
    Mesaje : 353
    Join : 16/02/2013

    Re: Executare Client[AMXX]

    Mesaj Scris de [D0m!n0]F|4V!U$ la data de Lun Feb 25, 2013 3:53 am

    foarte bun :YMAPPLAUSE:
    avatar
    SpEcToRaS
    Membru

    Member Title : WGR Member
    Mesaje : 48
    Join : 17/02/2013
    Localizare : Braila

    Re: Executare Client[AMXX]

    Mesaj Scris de SpEcToRaS la data de Lun Feb 25, 2013 10:18 am

    prea tare!
    avatar
    Tequila
    Super Moderator

    Member Title : Super Moderators
    Mesaje : 219
    Join : 17/01/2013

    Re: Executare Client[AMXX]

    Mesaj Scris de Tequila la data de Mar Feb 26, 2013 1:18 am

    Frumos tutorialul ,multumim

    Continut sponsorizat

    Re: Executare Client[AMXX]

    Mesaj Scris de Continut sponsorizat


      Acum este: Sam Aug 18, 2018 2:00 am