|
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
|
11-11-2013
, 05:57
Re: Auto-teleport to gifts
|
#31
|
Quote:
Originally Posted by friagram
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 = GetClientOfUserId( GetEventInt( event, "userid" )); if( client > 0 && IsClientInGame( client ) && !IsFakeClient( client )) { g_Location[client] = 1; decl Float:VecOri[3] GetEntPropVector( client, Prop_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_GiftTeleport( client, args ) { if ( client < 1 ) { ReplyToCommand( client, "[AUTOTELEPORT]: Command in game only.."); return Plugin_Handled; } if ( args > 1 ) { ReplyToCommand( client, "[AUTOTELEPORT]: Usage !autogift to teleport you to the next gift locarion."); return Plugin_Handled; } decl Float:LocatioN[3]; if ( GetLocation( client, LocatioN )) { LocatioN[2] += 10.0; TeleportEntity( client, LocatioN, NULL_VECTOR, NULL_VECTOR ); } return Plugin_Handled; }
bool:GetLocation( client, Float:Loc[3] ) { // location 1 if ( g_Location[client] == 1 ) { Loc[0] = 6121.0; Loc[1] = 7599.0; Loc[2] = 360.0; g_Location[client]++; PrintToChat( client, "[AUTOTELEPORT]: Location 1 reached" ); return true; } // location 2 else if ( g_Location[client] == 2 ) { Loc[0] = 7972.0; Loc[1] = 7585.0; Loc[2] = -110.0; g_Location[client]++; PrintToChat( client, "[AUTOTELEPORT]: Location 2 reached" ); return true; } // location 3 else if ( g_Location[client] == 3 ) { Loc[0] = 9079.0; Loc[1] = 8004.0; Loc[2] = -1170.0; g_Location[client]++; PrintToChat( client, "[AUTOTELEPORT]: Location 3 reached" ); return true; } //---------------------------------------- //---------------------------------------- // new location here //---------------------------------------- //---------------------------------------- else { g_Location[client] = 1; TeleportEntity( client, h_Home[client], NULL_VECTOR, NULL_VECTOR ); PrintToChat( client, "[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..
|
|
|
|