Raised This Month: $32 Target: $400
 8% 

Solved Teleport plugin for dead ppl


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zyten
Senior Member
Join Date: Jan 2018
Old 06-08-2018 , 11:17   Teleport plugin for dead ppl
Reply With Quote #1

Looking for help to build this plugin

!sloc Save location to teleport. if could make it with memmory to remember always on everymap saved location


!tpme teleports target to saved location. i need this to be only for dead ppl. alive cant be teleported

Last edited by Zyten; 06-11-2018 at 12:08.
Zyten is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-08-2018 , 14:59   Re: Teleport plugin for dead ppl
Reply With Quote #2

Code:
float g_savedOrg[MAXPLAYERS + 1][3];
float g_savedAng[MAXPLAYERS + 1][3];

public void OnPluginStart()
{
	RegConsoleCmd("sm_sloc", SM_SaveLoc);
	RegConsoleCmd("sm_tpme", SM_TeleportMe);
}

public Action SM_SaveLoc(int client, int args)
{
	if (!IsPlayerAlive(client))
	{
		ReplyToCommand(client, "You can't save your location while you're dead.");
		return Plugin_Handled;
	}
	GetClientAbsOrigin(client, g_savedOrg[client]);
	GetClientAbsAngles(client, g_savedAng[client]);
	
	ReplyToCommand(client, "Your location has been saved.");
	return Plugin_Handled;
}

public Action SM_TeleportMe(int client, int args)
{
	if (IsPlayerAlive(client))
	{
		ReplyToCommand(client, "You can't teleport while your are alive.");
		return Plugin_Handled;
	}
	
	CS_RespawnPlayer(client);
	TeleportEntity(client, g_savedOrg[client], g_savedAng[client], NULL_VECTOR);
	
	ReplyToCommand(client, "You have been teleported to your saved location.");
	return Plugin_Handled;
}
__________________
Taking private requests


Last edited by KlausLaw; 06-08-2018 at 15:00.
KlausLaw is offline
Zyten
Senior Member
Join Date: Jan 2018
Old 06-08-2018 , 23:51   Re: Teleport plugin for dead ppl
Reply With Quote #3

forgot to mention csgo

in case someone wanna compile on future. add those to beggining of script

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>

thx alot for plugin

Hey one problem thou. when use !tpme its bring you to alive again. Need him to stay dead

Last edited by Zyten; 06-09-2018 at 01:00.
Zyten is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-09-2018 , 07:49   Re: Teleport plugin for dead ppl
Reply With Quote #4

Do you want to teleport a dead player?
Well, here it is, i don't understand why would you want it.
Code:
float g_savedOrg[MAXPLAYERS + 1][3];
float g_savedAng[MAXPLAYERS + 1][3];

public void OnPluginStart()
{
	RegConsoleCmd("sm_sloc", SM_SaveLoc);
	RegConsoleCmd("sm_tpme", SM_TeleportMe);
}

public Action SM_SaveLoc(int client, int args)
{
	if (!IsPlayerAlive(client))
	{
		ReplyToCommand(client, "You can't save your location while you're dead.");
		return Plugin_Handled;
	}
	GetClientAbsOrigin(client, g_savedOrg[client]);
	GetClientAbsAngles(client, g_savedAng[client]);
	
	ReplyToCommand(client, "Your location has been saved.");
	return Plugin_Handled;
}

public Action SM_TeleportMe(int client, int args)
{
	if (IsPlayerAlive(client))
	{
		ReplyToCommand(client, "You can't teleport while your are alive.");
		return Plugin_Handled;
	}
	

	TeleportEntity(client, g_savedOrg[client], g_savedAng[client], NULL_VECTOR);
	
	ReplyToCommand(client, "You have been teleported to your saved location.");
	return Plugin_Handled;
}
__________________
Taking private requests

KlausLaw is offline
Zyten
Senior Member
Join Date: Jan 2018
Old 06-09-2018 , 12:31   Re: Teleport plugin for dead ppl
Reply With Quote #5

Thx m8 works perfect. !redie plugin


can u make this too !noclipme for dead ppl only with same command toggle on off. also if u can make !sloc to be to dead ppl too

Last edited by Zyten; 06-09-2018 at 12:57.
Zyten is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-09-2018 , 13:05   Re: Teleport plugin for dead ppl
Reply With Quote #6

Quote:
Originally Posted by Zyten View Post
Thx m8 works perfect. !redie plugin


can u make this too !noclipme for dead ppl only with same command toggle on off. also if u can make !sloc to be to dead ppl too
Code:
public void OnPluginStart()
{
	RegConsoleCmd("sm_sloc", SM_SaveLoc);
	RegConsoleCmd("sm_tpme", SM_TeleportMe);
	RegConsoleCmd("sm_noclipme", SM_Noclipme);
}

public Action SM_SaveLoc(int client, int args)
{
	GetClientAbsOrigin(client, g_savedOrg[client]);
	GetClientAbsAngles(client, g_savedAng[client]);
	
	ReplyToCommand(client, "Your location has been saved.");
	return Plugin_Handled;
}

public Action SM_TeleportMe(int client, int args)
{
	if (IsPlayerAlive(client))
	{
		ReplyToCommand(client, "You can't teleport while your are alive.");
		return Plugin_Handled;
	}
	
	TeleportEntity(client, g_savedOrg[client], g_savedAng[client], NULL_VECTOR);
	ReplyToCommand(client, "You have been teleported to your saved location.");
	return Plugin_Handled;
}

public Action SM_Noclipme(int client, int args)
{
	if (IsPlayerAlive(client))
	{
		ReplyToCommand(client, "You can't use noclip while you are alive.");
		return Plugin_Handled;
	}
	if (GetEntityMoveType(client) == MOVETYPE_WALK)
	{
		SetEntityMoveType(client, MOVETYPE_NOCLIP);
		ReplyToCommand(client, "Noclip is now on.");
	}
	else
	{
		SetEntityMoveType(client, MOVETYPE_WALK);
		ReplyToCommand(client, "Noclip is now off.");
	}
	return Plugin_Handled;
}
I posted the noclip on your other post, but here you go, i added your request to the teleport, and added the noclip.
__________________
Taking private requests

KlausLaw is offline
Zyten
Senior Member
Join Date: Jan 2018
Old 06-09-2018 , 13:39   Re: Teleport plugin for dead ppl
Reply With Quote #7

\csgo\addons\sourcemod\scripting\saveloc.sp(1 5) : error 017: undefined symbol "g_savedOrg"
\csgo\addons\sourcemod\scripting\saveloc.sp(1 5) : warning 215: expression has no effect
\csgo\addons\sourcemod\scripting\saveloc.sp(1 5) : error 001: expected token: ";", but found "]"
csgo\addons\sourcemod\scripting\saveloc.sp(15 ) : error 029: invalid expression, assumed zero
csgo\addons\sourcemod\scripting\saveloc.sp(15 ) : fatal error 190: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
Zyten is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-09-2018 , 13:43   Re: Teleport plugin for dead ppl
Reply With Quote #8

Quote:
Originally Posted by Zyten View Post
\csgo\addons\sourcemod\scripting\saveloc.sp(1 5) : error 017: undefined symbol "g_savedOrg"
\csgo\addons\sourcemod\scripting\saveloc.sp(1 5) : warning 215: expression has no effect
\csgo\addons\sourcemod\scripting\saveloc.sp(1 5) : error 001: expected token: ";", but found "]"
csgo\addons\sourcemod\scripting\saveloc.sp(15 ) : error 029: invalid expression, assumed zero
csgo\addons\sourcemod\scripting\saveloc.sp(15 ) : fatal error 190: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
Sry, my bad. forgot to paste the vars.
Add this at the top of the plugin:
Code:
float g_savedOrg[MAXPLAYERS + 1][3];
float g_savedAng[MAXPLAYERS + 1][3];
__________________
Taking private requests

KlausLaw is offline
Zyten
Senior Member
Join Date: Jan 2018
Old 06-09-2018 , 13:51   Re: Teleport plugin for dead ppl
Reply With Quote #9

noclip dosent work isnt even possible?
Zyten is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-09-2018 , 14:12   Re: Teleport plugin for dead ppl
Reply With Quote #10

Quote:
Originally Posted by Zyten View Post
noclip dosent work isnt even possible?
Just tested, works great.
I added the plugin, maybe you did something wrong.
Attached Files
File Type: sp Get Plugin or Get Source (pluginZyten.sp - 298 views - 1.6 KB)
__________________
Taking private requests


Last edited by KlausLaw; 06-09-2018 at 14:13.
KlausLaw 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 17:34.


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