forked from surftimer/SurfTimer
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added telefinder.sp added delete records by steam id maybe db creation fix maybe shuffled some things
- Loading branch information
1 parent
c482ee8
commit ad18ac2
Showing
6 changed files
with
294 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
#pragma semicolon 1 | ||
|
||
#include <sourcemod> | ||
#include <sdktools> | ||
#include <cstrike> | ||
#include <surftimer> | ||
|
||
Handle g_hEntity; | ||
Handle g_hTMEntity; | ||
|
||
public Plugin myinfo = | ||
{ | ||
name = "[Surf Timer] Teleport Destination Finder", | ||
author = "marcowmadeira", | ||
description = "Shows a list of info_teleport_destination entities.", | ||
version = "1.0", | ||
url = "http://marcowmadeira.com/" | ||
}; | ||
|
||
public void OnPluginStart() | ||
{ | ||
RegAdminCmd("sm_surftimertele", ShowTeleportDestinations, ADMFLAG_ROOT, "[Surf Timer] Shows a menu with all info_teleport_destination entities"); | ||
RegAdminCmd("sm_itd", ShowTeleportDestinations, ADMFLAG_ROOT, "[Surf Timer] Shows a menu with all info_teleport_destination entities"); | ||
RegAdminCmd("sm_triggerlocations", ShowTriggersLocations, ADMFLAG_ROOT, "[Surf Timer] Shows a menu with all trigger_multiple locations"); | ||
} | ||
|
||
public void OnMapStart() | ||
{ | ||
int iEnt; | ||
g_hEntity = CreateArray(12); | ||
g_hTMEntity = CreateArray(12); | ||
|
||
while ((iEnt = FindEntityByClassname(iEnt, "info_teleport_destination")) != -1) | ||
PushArrayCell(g_hEntity, iEnt); | ||
|
||
while ((iEnt = FindEntityByClassname(iEnt, "trigger_multiple")) != -1) { | ||
|
||
char target_name[32]; | ||
GetEntPropString(iEnt, Prop_Data, "m_iName", target_name, sizeof(target_name)); | ||
|
||
|
||
if (strlen(target_name) > 0 && StrContains(target_name, "sm_ckZone") == -1) | ||
PushArrayCell(g_hTMEntity, iEnt); | ||
} | ||
} | ||
|
||
public void OnMapEnd() | ||
{ | ||
delete g_hEntity; | ||
delete g_hTMEntity; | ||
} | ||
|
||
public Action ShowTeleportDestinations(int client, int args) | ||
{ | ||
Menu menu = new Menu(TD_MenuHandler); | ||
|
||
menu.SetTitle("Teleport Destinations"); | ||
|
||
for (int i = 0; i < GetArraySize(g_hEntity); i++) | ||
{ | ||
|
||
// Get entity | ||
int entity = GetArrayCell(g_hEntity, i); | ||
|
||
// Get targetname | ||
char target_name[32]; | ||
GetEntPropString(entity, Prop_Data, "m_iName", target_name, sizeof(target_name)); | ||
|
||
menu.AddItem(target_name, target_name); | ||
} | ||
|
||
menu.Display(client, 30); | ||
} | ||
|
||
public int TD_MenuHandler(Menu menu, MenuAction action, int param1, int param2) | ||
{ | ||
if (action == MenuAction_Select) { | ||
|
||
int entity = GetArrayCell(g_hEntity, param2); | ||
|
||
float position[3]; | ||
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", position); | ||
|
||
surftimer_SafeTeleport(param1, position, NULL_VECTOR, NULL_VECTOR, true); | ||
} else if (action == MenuAction_End) { | ||
delete menu; | ||
} | ||
} | ||
|
||
public Action ShowTriggersLocations(int client, int args) | ||
{ | ||
Menu menu = new Menu(TM_MenuHandler); | ||
|
||
menu.SetTitle("trigger_multiple entities"); | ||
|
||
for (int i = 0; i < GetArraySize(g_hTMEntity); i++) | ||
{ | ||
// Get entity | ||
int entity = GetArrayCell(g_hTMEntity, i); | ||
|
||
// Get targetname | ||
char target_name[32]; | ||
GetEntPropString(entity, Prop_Data, "m_iName", target_name, sizeof(target_name)); | ||
|
||
menu.AddItem(target_name, target_name); | ||
} | ||
|
||
menu.Display(client, 30); | ||
} | ||
|
||
public int TM_MenuHandler(Menu menu, MenuAction action, int param1, int param2) | ||
{ | ||
if (action == MenuAction_Select) { | ||
|
||
int entity = GetArrayCell(g_hTMEntity, param2); | ||
|
||
float position[3]; | ||
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", position); | ||
|
||
surftimer_SafeTeleport(param1, position, NULL_VECTOR, NULL_VECTOR, true); | ||
} else if (action == MenuAction_End) { | ||
delete menu; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters