View Single Post
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 04-03-2019 , 09:17   Re: [CS:GO] Setting money ( the only way possible )
Reply With Quote #8

Quote:
Originally Posted by eyal282 View Post
Stock is now better.
That should be faster, because why use checking the FindEntityByClassname when it faster to create new and delete it
PHP Code:
stock SetClientMoney(clientmoney)
{
    
SetEntProp(clientProp_Send"m_iAccount"money);

    
int entity CreateEntityByName("game_money");
    if(
entity != INVALID_ENT_REFERENCE)
    {
        
DispatchKeyValue(entity"AwardText""");
    
        
DispatchSpawn(entity);

        
SetVariantInt(0);
        
AcceptEntityInput(entity"SetMoneyAmount");
        
        
SetVariantInt(client);
        
AcceptEntityInput(entity"AddMoneyPlayer");
        
        
AcceptEntityInput(entity"Kill");
        
        return 
true;
    }

    return 
false;

and i never had issue with giving money by the
Quote:
/**
* @brief Sets the money on a client.
*
* @param clientIndex The client index.
* @param iMoney The money amount.
**/
void AccountSetMoney(int clientIndex, int iMoney)
{
SetEntData(clientIndex, g_iOffset_PlayerAccount, iMoney, _, true);
}
__________________

Last edited by gubka; 04-03-2019 at 09:19.
gubka is offline
Send a message via ICQ to gubka