Plugin Teleport

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
Seve
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 555
Joined: 18 Aug 2012, 11:19
Detinator Steam: Da
Detinator server CS: GO.PLAYSIBIU.COM
SteamID: sevecsgo
Reputatie: Membru Club eXtreamCS (1 luna)
Utilizator neserios (tepar)
Has thanked: 83 times
Been thanked: 39 times
Contact:

15 Oct 2013, 15:21

Plugin teleport!

bind f teleport -> sa apesi pe f ca sa te teleportezi
Inteval de teleportare 10 secunde, sa apara mesa hud " Te poti teleporta in x secunde"
Sa aiba acces la teleport doar CT
Sa il primesca automat. Mesaj in chat : "Ai primit puterea de a te teleporta apasa pe F."

Multumesc frumos!
Va astept pe Go.PlaySibiu.Com [RO/128 tickrate]
Image
RoyalServer
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

15 Oct 2013, 15:31

| Afiseaza codul
[code=php]/* Plugin generated by AMXX-Studio */

#include <  amxmodx  >
#include <  cstrike  >
#include <  fakemeta  >
#include <  xs  >

#define PLUGIN "Plug-in Nou"
#define VERSION "0.1"
#define AUTHOR "Aragon*" // codul este facut de el, eu doar am dat copy paste din alt plugin de-al lui ( © hades ownage )

#define FFADE_IN        0x0000        // Just here so we don't pass 0 into the function
#define FFADE_OUT        0x0001        // Fade out (not in)
#define FFADE_MODULATE        0x0002        // Modulate (don't blend)
#define FFADE_STAYOUT        0x0004        // ignores the duration, stays faded out until new ScreenFade message received
#define BREAK_GLASS        0x01

const UNIT_SEC = 0x1000
const FFADE = 0x0000
const UNIT_SECOND = (1<<12)
const BREAK_WOOD = 0x08

new Teleport_Countdown [ 33 ], Float: LastMessage [ 33 ];

new TeleportSprite, TeleportSprite2
new const SOUND_TELEPORT[] = { "weapons/flashbang-1.wav" }
new cvar_teleport_countdown, cvar_teleport_range, cvar_teleport_fadetime, cvar_teleport_color;

enum {
    Red,
    Green,
    Blue
}


public plugin_init (    ) {
    
    register_plugin (    PLUGIN, VERSION, AUTHOR    );
    
    register_clcmd ( "teleport", "UseTeleport" );
    
    cvar_teleport_countdown = register_cvar("fr_teleport_countdown", "10")
    cvar_teleport_range = register_cvar("fr_teleport_range", "123456789")
    cvar_teleport_fadetime = register_cvar("fr_teleport_fadetime", "2.0")
    cvar_teleport_color = register_cvar("fr_teleport_color", "000000255")
}

public plugin_precache ( ) {
    
    TeleportSprite = precache_model( "sprites/blue_lightning_blizzard.spr")
    TeleportSprite2 = precache_model( "sprites/blueflare2hd.spr")    
    
    precache_sound(SOUND_TELEPORT)
    
}

public UseTeleport (     id    ) {
    
    if ( get_user_team ( id ) == 2 ) {
        
        if(Teleport_Countdown[id]) {
            if(LastMessage[id] < get_gametime()) {
                LastMessage[id] = get_gametime() + 1.0;
                ColorChat(id,"^x03[Teleport]^x04 Puterea iti va reveni in^x03 %d secund%s.",Teleport_Countdown[id], Teleport_Countdown[id] > 1 ? "e" : "a");
            }
        }
        else if (teleport(id)) {
            emit_sound(id, CHAN_STATIC, SOUND_TELEPORT, 1.0, ATTN_NORM, 0, PITCH_NORM)
            Teleport_Countdown[id] = get_pcvar_num(cvar_teleport_countdown);
            CountDown_Teleport(id);
        }
        else {
            Teleport_Countdown[id] = 0
            ColorChat(id, "^x03[Teleport]^x04 Pozitia de teleportare este invalida.")
        }
    }
    
    return 1;
}

public CountDown_Teleport ( id ) {
    
    if(!is_user_alive(id) || get_user_team ( id ) != 2) {
        Teleport_Countdown[id] = 0;
    }
    else if(Teleport_Countdown[id] > 0) {
        set_hudmessage(0, 0, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, 7);
        show_hudmessage(id, "Te vei putea din nou teleporta in %d secund%s", Teleport_Countdown[id], Teleport_Countdown[id] == 1 ? "a" : "e");
        Teleport_Countdown[id]--;
        set_task(1.0, "CountDown_Teleport", id);
    }
    else if(Teleport_Countdown[id] <= 0) {
        set_hudmessage(0, 0, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, 7);
        show_hudmessage(id, "Te poti teleporta din nou");
        Teleport_Countdown[id] = 0;
    }
}

bool:teleport(id) {
    new Float:vOrigin[3], Float:vNewOrigin[3],
    Float:vNormal[3], Float:vTraceDirection[3],
    Float:vTraceEnd[3];
    
    pev(id, pev_origin, vOrigin);
    
    velocity_by_aim(id, get_pcvar_num(cvar_teleport_range), vTraceDirection);
    xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);
    
    engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);
    
    new Float:flFraction;
    get_tr2(0, TR_flFraction, flFraction);
    if (flFraction < 1.0) {
        get_tr2(0, TR_vecEndPos, vTraceEnd);
        get_tr2(0, TR_vecPlaneNormal, vNormal);
    }
    
    xs_vec_mul_scalar(vNormal, 40.0, vNormal); // do not decrease the 40.0
    xs_vec_add(vTraceEnd, vNormal, vNewOrigin);
    
    if (is_player_stuck(id, vNewOrigin))
        return false;
    
    emit_sound(id, CHAN_STATIC, SOUND_TELEPORT, 1.0, ATTN_NORM, 0, PITCH_NORM);
    tele_effect(vOrigin);
    
    engfunc(EngFunc_SetOrigin, id, vNewOrigin);
    
    tele_effect2(vNewOrigin);
    
    if(is_user_connected(id)) {
        UTIL_ScreenFade(id, get_color(cvar_teleport_color), get_pcvar_float(cvar_teleport_fadetime), get_pcvar_float(cvar_teleport_fadetime), 150)
        new shock[3]
        shock[0] = random_num(2,10)
        shock[1] = random_num(2,5)
        shock[2] = random_num(2,10)
        message_begin(MSG_ONE, get_user_msgid("ScreenShake"), _, id)
        write_short((1<<12)*shock[0])
        write_short((1<<12)*shock[1])
        write_short((1<<12)*shock[2])
        message_end()
    }
    return true;
}

get_color(pcvar) {
    new iColor[3], szColor[10]
    get_pcvar_string(pcvar, szColor, charsmax(szColor))
    new c = str_to_num(szColor)
    
    iColor[Red] = c / 1000000
    c %= 1000000
    iColor[Green] = c / 1000
    iColor[Blue] = c % 1000
    
    return iColor
}

stock FixedUnsigned16(Float:flValue, iScale) {
    new iOutput;
    
    iOutput = floatround(flValue * iScale);
    if ( iOutput < 0 )
        iOutput = 0;
    
    if ( iOutput > 0xFFFF )
        iOutput = 0xFFFF;
    return iOutput;
}

stock UTIL_ScreenFade(id=0,iColor[3]={0,0,0},Float:flFxTime=-1.0,Float:flHoldTime=0.0,iAlpha=0,iFlags=FFADE_IN,bool:bReliable=false,bool:bExternal=false) {
    if( id && !is_user_connected(id))
        return;
    
    new iFadeTime;
    if( flFxTime == -1.0 ) {
        iFadeTime = 4;
    }
    else {
        iFadeTime = FixedUnsigned16( flFxTime , 1<<12 );
    }
    
    static gmsgScreenFade;
    if( !gmsgScreenFade ) {
        gmsgScreenFade = get_user_msgid("ScreenFade");
    }
    
    new MSG_DEST;
    if( bReliable ) {
        MSG_DEST = id ? MSG_ONE : MSG_ALL;
    }
    else {
        MSG_DEST = id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST;
    }
    
    if( bExternal ) {
        emessage_begin( MSG_DEST, gmsgScreenFade, _, id );
        ewrite_short( iFadeTime );
        ewrite_short( FixedUnsigned16( flHoldTime , 1<<12 ) );
        ewrite_short( iFlags );
        ewrite_byte( iColor[Red] );
        ewrite_byte( iColor[Green] );
        ewrite_byte( iColor[Blue] );
        ewrite_byte( iAlpha );
        emessage_end();
    }
    else {
        message_begin( MSG_DEST, gmsgScreenFade, _, id );
        write_short( iFadeTime );
        write_short( FixedUnsigned16( flHoldTime , 1<<12 ) );
        write_short( iFlags );
        write_byte( iColor[Red] );
        write_byte( iColor[Green] );
        write_byte( iColor[Blue] );
        write_byte( iAlpha );
        message_end();
    }
}

stock is_player_stuck(id, Float:originF[3]) {
    engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0);
    
    if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
        return true;
    
    return false;
}

stock tele_effect(const Float:torigin[3]) {
    new origin[3];
    origin[0] = floatround(torigin[0]);
    origin[1] = floatround(torigin[1]);
    origin[2] = floatround(torigin[2]);
    
    message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
    write_byte(TE_BEAMCYLINDER);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+10);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+60);
    write_short(TeleportSprite);
    write_byte(0);
    write_byte(0);
    write_byte(3);
    write_byte(60);
    write_byte(0);
    write_byte(0);
    write_byte(0);
    write_byte(255);
    write_byte(255);
    write_byte(0);
    message_end();
}

stock tele_effect2(const Float:torigin[3]) {
    new origin[3];
    origin[0] = floatround(torigin[0]);
    origin[1] = floatround(torigin[1]);
    origin[2] = floatround(torigin[2]);
    
    message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
    write_byte(TE_BEAMCYLINDER);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+10);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+60);
    write_short(TeleportSprite);
    write_byte(0);
    write_byte(0);
    write_byte(3);
    write_byte(60);
    write_byte(0);
    write_byte(0);
    write_byte(0);
    write_byte(255);
    write_byte(255);
    write_byte(0);
    message_end();
    
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
    write_byte(TE_SPRITETRAIL);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+40);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]);
    write_short(TeleportSprite2);
    write_byte(30);
    write_byte(10);
    write_byte(1);
    write_byte(50);
    write_byte(10);
    message_end();
}    



stock UTIL_FadeToBlack(id,Float:fxtime=3.0,bool:bReliable=false,bool:bExternal=false) {
    UTIL_ScreenFade(id, _, fxtime, fxtime, 255, FFADE_OUT|FFADE_STAYOUT,bReliable,bExternal);
}

stock ColorChat(const id, const input[], any:...) {
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!x04", "^4");
    replace_all(msg, 190, "!x01", "^1");
    replace_all(msg, 190, "!x03", "^3");
    
    if(id) players[0] = id;
    else get_players(players, count, "ch"); {
        for(new i = 0; i < count; i++) {
            if(is_user_connected(players)) {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
                write_byte(players);
                write_string(msg);
                message_end();
            }
        }
    }
}
 [/code]
User avatar
Seve
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 555
Joined: 18 Aug 2012, 11:19
Detinator Steam: Da
Detinator server CS: GO.PLAYSIBIU.COM
SteamID: sevecsgo
Reputatie: Membru Club eXtreamCS (1 luna)
Utilizator neserios (tepar)
Has thanked: 83 times
Been thanked: 39 times
Contact:

15 Oct 2013, 15:55

Merge, insa as vrea ca in momentul cand incepe runda sa scrie, Ai primit puterea de a te teleporta apasa pe f!
Va astept pe Go.PlaySibiu.Com [RO/128 tickrate]
Image
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

15 Oct 2013, 16:16

| Afiseaza codul
[code=php]/* Plugin generated by AMXX-Studio */

#include <  amxmodx  >
#include <  cstrike  >
#include <  fakemeta  >
#include <  xs  >

#define PLUGIN "Plug-in Nou"
#define VERSION "0.1"
#define AUTHOR "Aragon*" // codul este facut de el, eu doar am dat copy paste din alt plugin de-al lui ( © hades ownage )

#define FFADE_IN        0x0000        // Just here so we don't pass 0 into the function
#define FFADE_OUT        0x0001        // Fade out (not in)
#define FFADE_MODULATE        0x0002        // Modulate (don't blend)
#define FFADE_STAYOUT        0x0004        // ignores the duration, stays faded out until new ScreenFade message received
#define BREAK_GLASS        0x01

const UNIT_SEC = 0x1000
const FFADE = 0x0000
const UNIT_SECOND = (1<<12)
const BREAK_WOOD = 0x08

new Teleport_Countdown [ 33 ], Float: LastMessage [ 33 ];

new TeleportSprite, TeleportSprite2
new const SOUND_TELEPORT[] = { "weapons/flashbang-1.wav" }
new cvar_teleport_countdown, cvar_teleport_range, cvar_teleport_fadetime, cvar_teleport_color;

enum {
    Red,
    Green,
    Blue
}


public plugin_init (    ) {
    
    register_plugin (    PLUGIN, VERSION, AUTHOR    );
    
    register_clcmd ( "teleport", "UseTeleport" );
    register_logevent ( "round_start", 2, "1=Round_Start" );
    
    cvar_teleport_countdown = register_cvar("fr_teleport_countdown", "10")
    cvar_teleport_range = register_cvar("fr_teleport_range", "123456789")
    cvar_teleport_fadetime = register_cvar("fr_teleport_fadetime", "2.0")
    cvar_teleport_color = register_cvar("fr_teleport_color", "000000255")
}

public round_start ( ) {
    
    new iPlayers [ 32 ], iNum, i;
    get_players ( iPlayers, iNum, "CT" );
    
    for ( i = 0; i < iNum; i++ )
    {
        client_cmd ( iPlayers [ i ], "bind f teleport" );
        ColorChat(iPlayers [ i ], "^x03[Teleport]^x04 Pozitia de teleportare este invalida.")
        
    }
}

public plugin_precache ( ) {
    
    TeleportSprite = precache_model( "sprites/blue_lightning_blizzard.spr")
    TeleportSprite2 = precache_model( "sprites/blueflare2hd.spr")    
    
    precache_sound(SOUND_TELEPORT)
    
}

public UseTeleport (     id    ) {
    
    if ( get_user_team ( id ) == 2 ) {
        
        if(Teleport_Countdown[id]) {
            if(LastMessage[id] < get_gametime()) {
                LastMessage[id] = get_gametime() + 1.0;
                ColorChat(id,"^x03[Teleport]^x04 Puterea iti va reveni in^x03 %d secund%s.",Teleport_Countdown[id], Teleport_Countdown[id] > 1 ? "e" : "a");
            }
        }
        else if (teleport(id)) {
            emit_sound(id, CHAN_STATIC, SOUND_TELEPORT, 1.0, ATTN_NORM, 0, PITCH_NORM)
            Teleport_Countdown[id] = get_pcvar_num(cvar_teleport_countdown);
            CountDown_Teleport(id);
        }
        else {
            Teleport_Countdown[id] = 0
            ColorChat(id, "^x03[Teleport]^x04 Pozitia de teleportare este invalida.")
        }
    }
    
    return 1;
}

public CountDown_Teleport ( id ) {
    
    if(!is_user_alive(id) || get_user_team ( id ) != 2) {
        Teleport_Countdown[id] = 0;
    }
    else if(Teleport_Countdown[id] > 0) {
        set_hudmessage(0, 0, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, 7);
        show_hudmessage(id, "Te vei putea din nou teleporta in %d secund%s", Teleport_Countdown[id], Teleport_Countdown[id] == 1 ? "a" : "e");
        Teleport_Countdown[id]--;
        set_task(1.0, "CountDown_Teleport", id);
    }
    else if(Teleport_Countdown[id] <= 0) {
        set_hudmessage(0, 0, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, 7);
        show_hudmessage(id, "Te poti teleporta din nou");
        Teleport_Countdown[id] = 0;
    }
}

bool:teleport(id) {
    new Float:vOrigin[3], Float:vNewOrigin[3],
    Float:vNormal[3], Float:vTraceDirection[3],
    Float:vTraceEnd[3];
    
    pev(id, pev_origin, vOrigin);
    
    velocity_by_aim(id, get_pcvar_num(cvar_teleport_range), vTraceDirection);
    xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);
    
    engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);
    
    new Float:flFraction;
    get_tr2(0, TR_flFraction, flFraction);
    if (flFraction < 1.0) {
        get_tr2(0, TR_vecEndPos, vTraceEnd);
        get_tr2(0, TR_vecPlaneNormal, vNormal);
    }
    
    xs_vec_mul_scalar(vNormal, 40.0, vNormal); // do not decrease the 40.0
    xs_vec_add(vTraceEnd, vNormal, vNewOrigin);
    
    if (is_player_stuck(id, vNewOrigin))
        return false;
    
    emit_sound(id, CHAN_STATIC, SOUND_TELEPORT, 1.0, ATTN_NORM, 0, PITCH_NORM);
    tele_effect(vOrigin);
    
    engfunc(EngFunc_SetOrigin, id, vNewOrigin);
    
    tele_effect2(vNewOrigin);
    
    if(is_user_connected(id)) {
        UTIL_ScreenFade(id, get_color(cvar_teleport_color), get_pcvar_float(cvar_teleport_fadetime), get_pcvar_float(cvar_teleport_fadetime), 150)
        new shock[3]
        shock[0] = random_num(2,10)
        shock[1] = random_num(2,5)
        shock[2] = random_num(2,10)
        message_begin(MSG_ONE, get_user_msgid("ScreenShake"), _, id)
        write_short((1<<12)*shock[0])
        write_short((1<<12)*shock[1])
        write_short((1<<12)*shock[2])
        message_end()
    }
    return true;
}

get_color(pcvar) {
    new iColor[3], szColor[10]
    get_pcvar_string(pcvar, szColor, charsmax(szColor))
    new c = str_to_num(szColor)
    
    iColor[Red] = c / 1000000
    c %= 1000000
    iColor[Green] = c / 1000
    iColor[Blue] = c % 1000
    
    return iColor
}

stock FixedUnsigned16(Float:flValue, iScale) {
    new iOutput;
    
    iOutput = floatround(flValue * iScale);
    if ( iOutput < 0 )
        iOutput = 0;
    
    if ( iOutput > 0xFFFF )
        iOutput = 0xFFFF;
    return iOutput;
}

stock UTIL_ScreenFade(id=0,iColor[3]={0,0,0},Float:flFxTime=-1.0,Float:flHoldTime=0.0,iAlpha=0,iFlags=FFADE_IN,bool:bReliable=false,bool:bExternal=false) {
    if( id && !is_user_connected(id))
        return;
    
    new iFadeTime;
    if( flFxTime == -1.0 ) {
        iFadeTime = 4;
    }
    else {
        iFadeTime = FixedUnsigned16( flFxTime , 1<<12 );
    }
    
    static gmsgScreenFade;
    if( !gmsgScreenFade ) {
        gmsgScreenFade = get_user_msgid("ScreenFade");
    }
    
    new MSG_DEST;
    if( bReliable ) {
        MSG_DEST = id ? MSG_ONE : MSG_ALL;
    }
    else {
        MSG_DEST = id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST;
    }
    
    if( bExternal ) {
        emessage_begin( MSG_DEST, gmsgScreenFade, _, id );
        ewrite_short( iFadeTime );
        ewrite_short( FixedUnsigned16( flHoldTime , 1<<12 ) );
        ewrite_short( iFlags );
        ewrite_byte( iColor[Red] );
        ewrite_byte( iColor[Green] );
        ewrite_byte( iColor[Blue] );
        ewrite_byte( iAlpha );
        emessage_end();
    }
    else {
        message_begin( MSG_DEST, gmsgScreenFade, _, id );
        write_short( iFadeTime );
        write_short( FixedUnsigned16( flHoldTime , 1<<12 ) );
        write_short( iFlags );
        write_byte( iColor[Red] );
        write_byte( iColor[Green] );
        write_byte( iColor[Blue] );
        write_byte( iAlpha );
        message_end();
    }
}

stock is_player_stuck(id, Float:originF[3]) {
    engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0);
    
    if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
        return true;
    
    return false;
}

stock tele_effect(const Float:torigin[3]) {
    new origin[3];
    origin[0] = floatround(torigin[0]);
    origin[1] = floatround(torigin[1]);
    origin[2] = floatround(torigin[2]);
    
    message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
    write_byte(TE_BEAMCYLINDER);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+10);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+60);
    write_short(TeleportSprite);
    write_byte(0);
    write_byte(0);
    write_byte(3);
    write_byte(60);
    write_byte(0);
    write_byte(0);
    write_byte(0);
    write_byte(255);
    write_byte(255);
    write_byte(0);
    message_end();
}

stock tele_effect2(const Float:torigin[3]) {
    new origin[3];
    origin[0] = floatround(torigin[0]);
    origin[1] = floatround(torigin[1]);
    origin[2] = floatround(torigin[2]);
    
    message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
    write_byte(TE_BEAMCYLINDER);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+10);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+60);
    write_short(TeleportSprite);
    write_byte(0);
    write_byte(0);
    write_byte(3);
    write_byte(60);
    write_byte(0);
    write_byte(0);
    write_byte(0);
    write_byte(255);
    write_byte(255);
    write_byte(0);
    message_end();
    
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
    write_byte(TE_SPRITETRAIL);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]+40);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]);
    write_short(TeleportSprite2);
    write_byte(30);
    write_byte(10);
    write_byte(1);
    write_byte(50);
    write_byte(10);
    message_end();
}    



stock UTIL_FadeToBlack(id,Float:fxtime=3.0,bool:bReliable=false,bool:bExternal=false) {
    UTIL_ScreenFade(id, _, fxtime, fxtime, 255, FFADE_OUT|FFADE_STAYOUT,bReliable,bExternal);
}

stock ColorChat(const id, const input[], any:...) {
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!x04", "^4");
    replace_all(msg, 190, "!x01", "^1");
    replace_all(msg, 190, "!x03", "^3");
    
    if(id) players[0] = id;
    else get_players(players, count, "ch"); {
        for(new i = 0; i < count; i++) {
            if(is_user_connected(players)) {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
                write_byte(players);
                write_string(msg);
                message_end();
            }
        }
    }
} [/code]
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests