|
Senior Member
|
07-09-2018
, 02:24
Re: CS:GO Use Bandage by klicking Q (lastinv)
|
#7
|
Quote:
Originally Posted by LenHard
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.
|
thanks and what do you mean with spamming the forum? am i creating to much requests or..? if so sorry, i am new in SourcePawn and would also lern it by using other Coders stuffs. Sometimes i am tring it alone but the Code don't work and i give fast up.
Last edited by iskenderkebab33; 07-09-2018 at 02:26.
|
|
|
|