Raised This Month: $119 Target: $400
 29% 

Solved [CSGO] Hi,there "get"/decrement/increment of m_iAccount


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Surprised
Junior Member
Join Date: Oct 2017
Old 10-12-2017 , 13:40   [CSGO] Hi,there "get"/decrement/increment of m_iAccount
Reply With Quote #1

Hi, I am new to sourcepawn how can i:
-decrement/increment m_iAccount
-"get" int of m_iAccount

I want to make paid gravity for my deathrun server

Sorry for my english

Thanks -Surpised

Last edited by Surprised; 10-12-2017 at 16:34.
Surprised is offline
Bobakanoosh
Member
Join Date: Sep 2015
Location: United States
Old 10-12-2017 , 14:31   Re: [CSGO] Hi,there "get"/decrement/increment of m_iAccount
Reply With Quote #2

What are you trying to use m_iAccount for?
__________________
Developer at Precision Gaming.

Taking private requests, add me on steam.
Bobakanoosh is offline
Surprised
Junior Member
Join Date: Oct 2017
Old 10-12-2017 , 14:40   Re: [CSGO] Hi,there "get"/decrement/increment of m_iAccount
Reply With Quote #3

For getting/decrementing/incrementing money.

Thanks for replaying to noob
Surprised is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-12-2017 , 15:19   Re: [CSGO] Hi,there "get"/decrement/increment of m_iAccount
Reply With Quote #4

You can find money code samples by looking others plugin source code (*.sp)



I made this quick
PHP Code:


public void OnPluginStart()
{
    
RegConsoleCmd("sm_mycommand"command_callback);
}

public 
Action command_callback(int clientint arg)
{
    
// no arguments passed through command
    
if(arg 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_mycommand <value>");
        return 
Plugin_Handled;
    }

    
// client index 0 = command used from server console
    
if(client == 0)
    {
        
ReplyToCommand(client"[SM] Use this command in-game");
        return 
Plugin_Handled;
    }


    
// get command first argument
    
char text[20];
    
GetCmdArg(1textsizeof(text));

    
int value StringToInt(text// convert text to integer

    
int m_iAccount GetEntProp(clientProp_Send"m_iAccount"); // player money

    
PrintToChat(client"Your money %i, your first argument %i, final ammount %i"m_iAccountvaluem_iAccount+value);

    
SetEntProp(clientProp_Send"m_iAccount"m_iAccount+value);



    return 
Plugin_Handled// Prevent "unknow command" error in console

__________________

Last edited by Bacardi; 10-12-2017 at 15:20.
Bacardi is offline
Surprised
Junior Member
Join Date: Oct 2017
Old 10-12-2017 , 16:34   Re: [CSGO] Hi,there "get"/decrement/increment of m_iAccount
Reply With Quote #5

Thank you Bacardi, Its working!!
You learnt me a lot, again thank You


//topic to close///
Surprised is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:41.


Powered by vBulletin®
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Theme made by Freecode