You would have to somehow assign the entity of the player who "armed" the beam to the beam entity that you created.
Then when another player breaks that beam, kill that player, and award the owner of the beam +1 frag...
There are probably a bunch of different ways to accomplish this - one way I did it with the
DropMoneyOnDeath was with a TrieArray... in the array I put the UserID of the player that dropped the money and the amount of the money...
chopped up code, but enough to show you how I did what I did... not saying my way is the correct or only way - it's just the way I did it
Code:
enum MoneyAttributes
{
AMOUNT,
WHO
};
DropMoney(client)
{
new ent;
if((ent = CreateEntityByName("prop_physics_multiplayer")) != -1)
{
// CREATED ENTITY AND OTHER INFO
// Get amount of cash to assign this dropped money for the trie
new amount = (clientCash * PercentOfMoney / 100);
// Get the UserID of the client (player/victim) for the trie
new UserID = GetClientUserId(client);
// Begin storing entity information in a trie array
new String:sEntity[12]
IntToString(ent, sEntity, sizeof(sEntity));
new MoneyDroppedInfo[MoneyAttributes];
MoneyDroppedInfo[AMOUNT] = amount;
MoneyDroppedInfo[WHO] = UserID;
// Set trie for this entity with UserID and amount information
SetTrieArray(h_Trie, sEntity, MoneyDroppedInfo[0], 2, true);
// Hook the money entity to know when a player touches it
SDKHook(ent, SDKHook_StartTouch, StartTouch);
}
}