Raised This Month: $ Target: $400
 0% 

Сhange the string "rebuy"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
artist
Member
Join Date: Nov 2013
Old 05-26-2016 , 15:16   Сhange the string "rebuy"
Reply With Quote #1

I want to add a weapon to "F2", when issued its "give_item(id, "weapon_m4a1")"

Code:
void _ClientCommand(edict_t *pEntity)
{
	//........................
	else if (FStrEq(pcmd, "cl_setrebuy"))
	{
		if (CMD_ARGC() == 2)
		{
			player->InitRebuyData(CMD_ARGV(1));

			BOOL oldval = g_bClientPrintEnable;
			g_bClientPrintEnable = false;
			player->Rebuy();
			g_bClientPrintEnable = oldval;
		}

		return;
	}
	//........................
}
Code:
void CBasePlayer::Rebuy(void)
{
	char *string = m_rebuyString;
	char *token;

	m_bIsInRebuy = true;

	while(1)
	{
		string = MP_COM_Parse(string);
		token = MP_COM_GetToken();

		if(!string) break;

		if(!stricmp(token, "primaryWeapon")) RebuyPrimaryWeapon();
		else if(!stricmp(token, "primaryAmmo")) RebuyPrimaryAmmo();
		else if(!stricmp(token, "secondaryWeapon")) RebuySecondaryWeapon();
		else if(!stricmp(token, "secondaryAmmo")) RebuySecondaryAmmo();
		else if(!stricmp(token, "hegrenade")) RebuyHEGrenade();
		else if(!stricmp(token, "flashbang")) RebuyFlashbang();
		else if(!stricmp(token, "smokegrenade")) RebuySmokeGrenade();
		else if(!stricmp(token, "defuser")) RebuyDefuser();
		else if(!stricmp(token, "nightvision")) RebuyNightVision();
		else if(!stricmp(token, "armor")) RebuyArmor();
	}
	m_bIsInRebuy = false;
}
Code:
char *m_rebuyString;              /*  2356     4 */
PHP Code:
static bufer[256]; get_pdata_string(id2356bufercharsmax(bufer), 14)
client_print(idprint_chatbufer
CS crashes...

Last edited by artist; 05-26-2016 at 15:24.
artist is offline
 



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 18:41.


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