Quote:
Originally Posted by iskenderkebab33
can you do also, a Player can use it only 3 times per Round please. Thanks.
|
PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
#define LIMIT 3
int gI_Limit[MAXPLAYERS + 1];
public void OnPluginStart()
{
HookEvent("round_start", Event_RoundStart, EventHookMode_Post);
AddCommandListener(CL_Heal, "+lookatweapon");
}
public Action CL_Heal(int client, const char[] sCmd, int args)
{
if (0 < client <= MaxClients && IsClientInGame(client) && IsPlayerAlive(client))
{
if (gI_Limit[client] < LIMIT)
{
++gI_Limit[client];
int iHealth = GetEntProp(client, Prop_Send, "m_iHealth") + 10;
int iMaxHealth = GetEntProp(client, Prop_Data, "m_iMaxHealth");
if (iHealth <= iMaxHealth)
SetEntProp(client, Prop_Send, "m_iHealth", iHealth);
else
SetEntProp(client, Prop_Send, "m_iHealth", iMaxHealth);
ClientCommand(client, "play )items/healthshot_success_01.wav");
}
else PrintToChat(client, "[SM] You already used it \x04%i\x01 times...", LIMIT);
}
return Plugin_Continue;
}
public void Event_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
for (int i = 1; i <= MaxClients; ++i)
if (IsClientInGame(i))
gI_Limit[i] = 0;
}
Alright, stop spamming the forums with requests, make all your requests in one post. Otherwise I'll stop assisting.
__________________