Raised This Month: $51 Target: $400
 12% 

Auto-teleport to gifts


Post New Thread Reply   
 
Thread Tools Display Modes
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 11-11-2013 , 05:57   Re: Auto-teleport to gifts
Reply With Quote #31

Quote:
Originally Posted by friagram View Post
The problem is most people just want to have fun on the holiday maps, but there are often a bunch of trolls that go out of their ways to do things like camp the gift areas to deny people of getting gifts. It is not realy fair when there is a medic heavy, sentrygun, or a bunch of players camping you in your spawn, and you die and can't get the gift. On my servers, even with instant respawn -- people would miss it. Now, you can just wait for it to spawn again. Whatever, I just made a public command people can use every few minutes to tele them to each location so that they can check the spots and grab them if they are too far away, or need to see which one to go to. It doesn't really disrupt the gameplay, you can't just idle and do it, and the great majority of people are just glad to be able to get their gifts. Mabye you could make something with a point viewcontrol or something if you just wanted to give them a peak, but.. Might as well just give them a chance to get it. I think i set the cooldown to like 3 or 5 minutes.
PHP Code:
#include <sourcemod>
#include <sdktools>
#define PL_VERSION "1.0"

new g_Location[MAXPLAYERS+1];
new 
Float:h_Home[MAXPLAYERS+1][3];

public 
Plugin:myinfo =
{
    
name " Auto-Teleport Halloween 2013",
    
author "Kazhan",
    
description "Auto-Teleport on Halloween map 2013",
    
version PL_VERSION,
    
url ""
}

public 
OnPluginStart()
{
    
HookEvent"player_spawn"EvenT_Spawn );
    
RegConsoleCmd"sm_autogift"Command_GiftTeleport"Teleport player to specify gift location" );
}

public 
EvenT_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserIdGetEventIntevent"userid" ));
    if( 
client && IsClientInGameclient ) && !IsFakeClientclient ))
    {
        
g_Location[client] = 1;
        
decl Float:VecOri[3]
        
GetEntPropVectorclientProp_Send"m_vecOrigin"VecOri );
        
h_Home[client][0] = VecOri[0];
        
h_Home[client][1] = VecOri[1];
        
h_Home[client][2] = VecOri[2];
    }
}

public 
Action:Command_GiftTeleportclientargs )
{
    if ( 
client )
    {
        
ReplyToCommandclient"[AUTOTELEPORT]: Command in game only..");
        return 
Plugin_Handled;
    }
    if ( 
args )
    {
        
ReplyToCommandclient"[AUTOTELEPORT]: Usage !autogift to teleport you to the next gift locarion.");
        return 
Plugin_Handled;
    }
    
    
decl Float:LocatioN[3];
    if ( 
GetLocationclientLocatioN ))
    {
        
LocatioN[2] += 10.0;
        
TeleportEntityclientLocatioNNULL_VECTORNULL_VECTOR );
    }
    return 
Plugin_Handled;
}

bool:GetLocationclientFloat:Loc[3] )
{
    
// location 1
    
if ( g_Location[client] == )
    {
        
Loc[0] = 6121.0;
        
Loc[1] = 7599.0;
        
Loc[2] = 360.0;
        
g_Location[client]++;
        
PrintToChatclient"[AUTOTELEPORT]: Location 1 reached" );
        return 
true;
    }
    
// location 2
    
else if ( g_Location[client] == )
    {
        
Loc[0] = 7972.0;
        
Loc[1] = 7585.0;
        
Loc[2] = -110.0;
        
g_Location[client]++;
        
PrintToChatclient"[AUTOTELEPORT]: Location 2 reached" );
        return 
true;
    }
    
// location 3
    
else if ( g_Location[client] == )
    {
        
Loc[0] = 9079.0;
        
Loc[1] = 8004.0;
        
Loc[2] = -1170.0;
        
g_Location[client]++;
        
PrintToChatclient"[AUTOTELEPORT]: Location 3 reached" );
        return 
true;
    }
    
//----------------------------------------
    //----------------------------------------
    // new location here
    
    
    
    
    
    //----------------------------------------
    //----------------------------------------
    
else
    {
        
g_Location[client] = 1;
        
TeleportEntityclienth_Home[client], NULL_VECTORNULL_VECTOR );
        
PrintToChatclient"[AUTOTELEPORT]: Spawn location reached" );
    }
    return 
false;

Fair enough..
p/s: Better narrow down the gift location base on map name since the coordinate may change.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 11-11-2013 at 05:57. Reason: ma english suck..
GsiX 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 21:13.


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