Raised This Month: $ Target: $400
 0% 

[CS:GO] Decoy Teleporter


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Purixi
Junior Member
Join Date: Jul 2015
Plugin ID:
4719
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Automatically teleports player to whatever location where his throwen decoy was fired.
    Old 07-08-2015 , 19:43   [CS:GO] Decoy Teleporter
    Reply With Quote #1

    Decoy Teleporter — Open source plugin prototype, you can use it to make your own plugins or anything else (gamemodes, etc).
    Plugin idea: Allow VIPs on my deathrun server to teleport to any location (preventing traps to be triggered).

    This plugin will teleport player with his own decoy, to any location he throw it to.
    Decoy will fire once and then automatically removed by server.

    Plugin run without any errors (debug floods in console, etc).

    Versions:
    Quote:
    1.0: Initial release.
    Attached Files
    File Type: sp Get Plugin or Get Source (purixi_decoyteleporter.sp - 2024 views - 980 Bytes)

    Last edited by Purixi; 10-02-2015 at 06:21.
    Purixi is offline
    Purixi
    Junior Member
    Join Date: Jul 2015
    Old 07-08-2015 , 20:39   Re: Decoy Teleporter
    Reply With Quote #2

    Same plugin, but with chat trigger, flags checking, and colored chat prints:
    Requirements: Multi Colors (include).
    PHP Code:
    #include <sourcemod>
    #include <sdktools>
    #include <multicolors>

    public Plugin:myinfo =
    {
        
    name "[Deathrun] Decoy Teleporter",
        
    author "Purixi",
        
    description "",
        
    version "1.0",
        
    url ""
    }

    new 
    g_AllowedDecoys[33];

    public 
    OnPluginStart()
    {
        
    HookEvent("decoy_firing"OnDecoyFiring);
        
    HookEvent("round_start"OnRoundStart);
        
    RegConsoleCmd("decoy"OnCommandExecuted);
    }

    public 
    OnClientPutInServer(client)
    {
        if(!
    IsFakeClient(client)) g_AllowedDecoys[client] = 1;
    }

    public 
    Action:OnCommandExecuted(clientargs)
    {
        new 
    flags GetUserFlagBits(client);
        
        if(
    flags ADMFLAG_GENERIC || flags ADMFLAG_ROOT)
        {
            if(
    g_AllowedDecoys[client] > 0)
            {
                
    g_AllowedDecoys[client]--;
                
    GivePlayerItem(client"weapon_decoy");
                
    CPrintToChat(client"{green}[Decoy Teleporter] {orange}You've been granted a {green}Decoy Teleporter{orange}. Use it with brain.");
            }
            
            else
            {
                
    CPrintToChat(client"{green}[Decoy Teleporter] {orange}You have already used all available {green}Decoy Teleporters{orange}.");
            }
        }
        
        else
        {
            
    CPrintToChat(client"{green}[Decoy Teleporter] {orange}You don't have permissions to access following command.");
        }
    }

    public 
    OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
    {
        new 
    userid GetEventInt(event"userid");
        new 
    client GetClientOfUserId(userid);
        
        
    g_AllowedDecoys[client] = 1;
    }

    public 
    OnDecoyFiring(Handle:event, const String:name[], bool:dontBroadcast)
    {
        new 
    userid GetEventInt(event"userid");
        new 
    client GetClientOfUserId(userid);
        
        new 
    flags GetUserFlagBits(client);
        
        if(
    flags ADMFLAG_GENERIC || flags ADMFLAG_ROOT)
        {
            new 
    Float:f_Pos[3];
            new 
    entityid GetEventInt(event"entityid");
            
    f_Pos[0] = GetEventFloat(event"x");
            
    f_Pos[1] = GetEventFloat(event"y");
            
    f_Pos[2] = GetEventFloat(event"z");
            
            
    TeleportEntity(clientf_PosNULL_VECTORNULL_VECTOR);
            
    RemoveEdict(entityid);
        }


    Last edited by Purixi; 07-09-2015 at 12:33.
    Purixi is offline
    hadesownage
    AlliedModders Donor
    Join Date: Jun 2013
    Location: Romania, Iași
    Old 07-19-2015 , 17:56   Re: Decoy Teleporter
    Reply With Quote #3

    .SMA lol
    hadesownage is offline
    Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
    Darkness_
    Veteran Member
    Join Date: Nov 2014
    Old 07-19-2015 , 18:24   Re: Decoy Teleporter
    Reply With Quote #4

    You attached a *.sma file. Since this is SourceMod it should be a *.sp file. The language of your plugin is in SourcePawn so just upload the file as a *.sp.

    Also, one should hook player_spawn instead of player_spawned.

    Last edited by Darkness_; 07-19-2015 at 18:24.
    Darkness_ is offline
    DrizzintahL
    New Member
    Join Date: Aug 2015
    Old 08-16-2015 , 02:42   Re: Decoy Teleporter
    Reply With Quote #5

    Hey this is my first time posting here, how hard would it be to continue this a tad and make it enabled / disabled with a cvar and/or something an admin can set on a player on and off? instead of globally being on. Cheers! (I'm looking into it, but I've never done much with this stuff, just learned how to compile it, lol)
    DrizzintahL is offline
    Purixi
    Junior Member
    Join Date: Jul 2015
    Old 10-02-2015 , 06:16   Re: Decoy Teleporter
    Reply With Quote #6

    Quote:
    Originally Posted by Darkness_ View Post
    You attached a *.sma file. Since this is SourceMod it should be a *.sp file. The language of your plugin is in SourcePawn so just upload the file as a *.sp.

    Also, one should hook player_spawn instead of player_spawned.
    Nope, since player_spawn doesn't work.
    Purixi is offline
    Gnoyek
    Member
    Join Date: Jul 2015
    Old 10-24-2015 , 11:20   Re: [CS:GO] Decoy Teleporter
    Reply With Quote #7

    someone can update this plugin with working "vip only" access? cuz second code Purixi dont work
    Gnoyek is offline
    lingzhidiyu
    Senior Member
    Join Date: Mar 2014
    Old 10-25-2015 , 02:09   Re: [CS:GO] Decoy Teleporter
    Reply With Quote #8

    Quote:
    Originally Posted by Gnoyek View Post
    someone can update this plugin with working "vip only" access? cuz second code Purixi dont work
    if your vip flag is "reservation" "a"

    replace if(flags & ADMFLAG_GENERIC || flags & ADMFLAG_ROOT) to
    if(flags & ADMFLAG_RESERVATION)

    list all flag
    PHP Code:
    #define ADMFLAG_RESERVATION
    #define ADMFLAG_GENERIC
    #define ADMFLAG_KICK    
    #define ADMFLAG_BAN    
    #define ADMFLAG_UNBAN
    #define ADMFLAG_SLAY    
    #define ADMFLAG_CHANGEMAP
    #define ADMFLAG_CONVARS
    #define ADMFLAG_CONFIG
    #define ADMFLAG_CHAT
    #define ADMFLAG_VOTE
    #define ADMFLAG_PASSWORD
    #define ADMFLAG_RCON
    #define ADMFLAG_CHEATS
    #define ADMFLAG_ROOT
    #define ADMFLAG_CUSTOM
    #define ADMFLAG_CUSTOM2    
    #define ADMFLAG_CUSTOM3    
    #define ADMFLAG_CUSTOM4        
    #define ADMFLAG_CUSTOM5    
    #define ADMFLAG_CUSTOM6 

    Last edited by lingzhidiyu; 10-25-2015 at 02:12.
    lingzhidiyu is offline
    Gnoyek
    Member
    Join Date: Jul 2015
    Old 10-25-2015 , 09:08   Re: [CS:GO] Decoy Teleporter
    Reply With Quote #9

    thank you, now works
    Gnoyek is offline
    Hunter6272
    Senior Member
    Join Date: Jun 2015
    Location: Don't know
    Old 10-26-2015 , 04:07   Re: [CS:GO] Decoy Teleporter
    Reply With Quote #10

    Can you make a non-vip deathrun version in which all players get the decoy teleport feature ?
    __________________
    Patience is the key to success.
    Hunter6272 is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 19:50.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode