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

Give client targetname


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Porcellian
Member
Join Date: Oct 2017
Old 11-11-2020 , 09:31   Give client targetname
Reply With Quote #1

Hello,

I have a map that has a targetname called "player1". I need to give the player that has joined this specific targetname to make the player teleport to a specific place.

It is not working though. Here is the code

Code:
public OnClientPutInServer(client)
{
	DispatchKeyValue(client, "targetname", "player1");
}
ERROR: error 017: undefined
symbol "DispatchKeyValue"
Porcellian is offline
FAQU
Member
Join Date: Sep 2020
Location: Romania
Old 11-11-2020 , 10:30   Re: Give client targetname
Reply With Quote #2

DispatchKeyValue is a function of sdktools, so make sure you include sdktools.

PHP Code:
#include <sourcemod>
#include <sdktools>

public void OnClientPutInServer(int client)
{
    
DispatchKeyValue(client"targetname""player1");


Last edited by FAQU; 11-11-2020 at 11:26.
FAQU is offline
Balimbanana
Member
Join Date: Jan 2017
Old 11-11-2020 , 12:28   Re: Give client targetname
Reply With Quote #3

Also depending on how it is handled, sending a DispatchKeyValue to an already spawned entity may not apply correctly. You could set it on player spawn if it doesn't work, then if it still won't apply, set by either AddOutput or SetEntPropString:
PHP Code:
SetVariantString("targetname player1");
AcceptEntityInput(client"AddOutput");

Or
SetEntPropString(clientProp_Data"m_iName""player1"); 
Balimbanana is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-11-2020 , 18:06   Re: Give client targetname
Reply With Quote #4

...if you have trigger brush, why not look clients who touch that and make your choice output call or else ?
Bacardi 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 23:28.


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