#include <sourcemod>
#include <sdktools>
public OnPluginStart()
{
HookEvent("player_spawn", OnPlayerSpawned);
HookEvent("decoy_firing", OnDecoyFiring);
}
public OnPlayerSpawned(Handle event, char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client && IsPlayerAlive(client) && GetClientTeam(client) > 1) GivePlayerItem(client, "weapon_decoy");
}
public OnDecoyFiring(Handle:event, const String:name[], bool:dontBroadcast) {
int client = GetClientOfUserId(GetEventInt(event, "userid"));
new Float:f_Pos[3];
new entityid = GetEventInt(event, "entityid");
f_Pos[0] = GetEventFloat(event, "x");
f_Pos[1] = GetEventFloat(event, "y");
f_Pos[2] = GetEventFloat(event, "z");
TeleportEntity(client, f_Pos, NULL_VECTOR, NULL_VECTOR);
RemoveEdict(entityid);
}