PDA

View Full Version : [TF2] Need a check bot name on re/spawn


Michalplyoutube
11-03-2014, 10:29
So I tried
public OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
PrintToChatAll("Triggered spawn.");
new client = GetClientOfUserId( GetEventInt( event, "userid" ) );
decl String:strName[32];
GetEntPropString(client, Prop_Data, "m_iName", strName, sizeof(strName));
if (bool:StrEqual(strName, "Bumper Scout")) //(strName) == Bumper Scout)
{
PrintToChatAll("addcond trigger.");
TF2_AddCondition(client, TFCOND_HalloweenKart, TFCondDuration_Infinite);
}
}That didn't worked how can i check bot name on spawn if the name equals scout then do stuff i would need an example

thecount
11-04-2014, 16:27
#include <tf2_stocks>

public OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
PrintToChatAll("Triggered spawn.");
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new String:strName[MAX_NAME_LENGTH];
GetClientName(client, strName, sizeof(strName));
if (StrEqual(strName, "Bumper Scout")){
PrintToChatAll("addcond trigger.");
TF2_AddCondition(client, 82, TFCondDuration_Infinite);
}
}