Quote:
Originally Posted by mug1wara
PHP Code:
#include <sourcemod>
#pragma semicolon 1
int g_iKills[MAXPLAYERS + 1];
public void OnPluginStart() { HookEvent("player_death", Event_Death); }
public void OnMapEnd() { for (int i = 1; i <= MaxClients; i++) { g_iKills[i] = 0; } }
public Action Event_Death(Event hEvent, const char[] sName, bool bDontBroadcast) { int iAttacker = GetClientOfUserId(hEvent.GetInt("attacker")); if (IsValidClient(iAttacker)) { g_iKills[iAttacker]++; if (g_iKills[iAttacker] == DesiredAmountOfKills) { /* Perform an action here */ } } }
stock bool IsValidClient(int iClient) { if (!(0 < iClient <= MaxClients) || !IsClientInGame(iClient) || IsFakeClient(iClient)) { return false; } return true; }
|
Something does not understand where this variable identified with the
DesiredAmountOfKills
And if I correctly understood your code, then the check occurs in a ratio of 1 to 1, that is, 1 time he killed 1 time it. It seems clear written in English , and how to do for example a test not immediately, but for example after 30 murders of enemies or 10 of your own deaths.
so thanks for the example, but I'm still not very much in SourcePawn.
added:
Everything is understood, you are simply in the process of counting the count of murders and who killed. And I would like the data on this to be taken from the table that appears after pressing the TAB key. Нere is a screenshot of the table
http://expandedcs.com/uploads/posts/...css3v34v84.jpg
I just thought from this table it's not easier to take information, and only then do the calculations. Just say not after every murder and for example in 1-2 minutes.
Will the server be lagging too much because of your cat ?! (question out of curiosity)
And so once again thank you, we will try it .. but you count 1 to 1. I would like type 3 to 1.
Sorry for the bad English.