Raised This Month: $63 Target: $400
 15% 

csgo best way use


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BassPower
Member
Join Date: Mar 2011
Location: Lithuania
Old 02-22-2018 , 08:03   csgo best way use
Reply With Quote #1

public Action WeaponCanUseGunsRound(int client, int weapon)
{
if (RR || SGR || SSG != 1)return Plugin_Continue;
char sWeapon[32];
GetEdictClassname(weapon, sWeapon, sizeof(sWeapon));
if (StrEqual(sWeapon, "weapon_deagle") || StrEqual(sWeapon, "weapon_awp"))
{
return Plugin_Handled;
}
return Plugin_Changed;
}

best way use:
if (RR || SGR || SSG != 1)return Plugin_Continue;
if (RR && SGR && SSG != 1)return Plugin_Continue;
if ((RR != 1) || (SGR != 1) || (SSG != 1))return Plugin_Continue;
BassPower is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Rimini, Italy
Old 02-22-2018 , 11:09   Re: csgo best way use
Reply With Quote #2

Tell us more info (like posting your whole code), we even dont know what are you trying to achieve...
__________________
Papero is offline
Send a message via Skype™ to Papero
BassPower
Member
Join Date: Mar 2011
Location: Lithuania
Old 02-22-2018 , 11:36   Re: csgo best way use
Reply With Quote #3

Quote:
Originally Posted by Papero View Post
Tell us more info (like posting your whole code), we even dont know what are you trying to achieve...
i can post all code:

PHP Code:
int RR = -1;
int SRG = -1;
int SSG = -1;

SDKHook(clientSDKHook_WeaponCanUseWeaponCanUseGunsRound);
SDKHook(clientSDKHook_WeaponCanSwitchToWeaponCanUseGunsRound);

public 
Action WeaponCanUseGunsRound(int clientint weapon)
{
if (
RR || SGR || SSG != 1)return Plugin_Continue;
char sWeapon[32];
GetEdictClassname(weaponsWeaponsizeof(sWeapon));
if (
StrEqual(sWeapon"weapon_deagle") || StrEqual(sWeapon"weapon_awp"))
{
return 
Plugin_Handled;
}
return 
Plugin_Changed;

here is function to use weapons like in RR = Rifle Round - Handled weapons awp and dgl and if SSG = Scout round do same, just want know how fix because now not block weapons problem is if (RR || SGR || SSG != 1)return Plugin_Continue; if i write just if (RR != 1)return Plugin_Continue; is ok how add more in 1 function
BassPower is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Rimini, Italy
Old 02-23-2018 , 04:16   Re: csgo best way use
Reply With Quote #4

Quote:
Originally Posted by BassPower View Post
i can post all code:

PHP Code:
int RR = -1;
int SRG = -1;
int SSG = -1;

SDKHook(clientSDKHook_WeaponCanUseWeaponCanUseGunsRound);
SDKHook(clientSDKHook_WeaponCanSwitchToWeaponCanUseGunsRound);

public 
Action WeaponCanUseGunsRound(int clientint weapon)
{
if (
RR || SGR || SSG != 1)return Plugin_Continue;
char sWeapon[32];
GetEdictClassname(weaponsWeaponsizeof(sWeapon));
if (
StrEqual(sWeapon"weapon_deagle") || StrEqual(sWeapon"weapon_awp"))
{
return 
Plugin_Handled;
}
return 
Plugin_Changed;

here is function to use weapons like in RR = Rifle Round - Handled weapons awp and dgl and if SSG = Scout round do same, just want know how fix because now not block weapons problem is if (RR || SGR || SSG != 1)return Plugin_Continue; if i write just if (RR != 1)return Plugin_Continue; is ok how add more in 1 function
You need to use SDKHook inside the OnClientPutInServer(int client) forward.
__________________

Last edited by Papero; 02-23-2018 at 04:17.
Papero is offline
Send a message via Skype™ to Papero
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 18:55.


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