View Single Post
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-09-2018 , 02:24   Re: CS:GO Use Bandage by klicking Q (lastinv)
Reply With Quote #7

Quote:
Originally Posted by LenHard View Post
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_RoundStartEventHookMode_Post);   
    
    
AddCommandListener(CL_Heal"+lookatweapon");  
}   

public 
Action CL_Heal(int client, const char[] sCmdint args)   
{   
    if (
client <= MaxClients && IsClientInGame(client) && IsPlayerAlive(client))   
    {   
        if (
gI_Limit[client] <= LIMIT)
        {            
            ++
gI_Limit[client];
            
            
int iHealth GetEntProp(clientProp_Send"m_iHealth") + 10
            
int iMaxHealth GetEntProp(clientProp_Data"m_iMaxHealth");         
             
            if (
iHealth <= iMaxHealth
                
SetEntProp(clientProp_Send"m_iHealth"iHealth); 
            else 
                
SetEntProp(clientProp_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[] sEventNamebool bDontBroadcast

    for (
int i 1<= 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.
iskenderkebab33 is offline