AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   csgo best way use (https://forums.alliedmods.net/showthread.php?t=305501)

BassPower 02-22-2018 07:03

csgo best way use
 
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;

Papero 02-22-2018 10:09

Re: csgo best way use
 
Tell us more info (like posting your whole code), we even dont know what are you trying to achieve...

BassPower 02-22-2018 10:36

Re: csgo best way use
 
Quote:

Originally Posted by Papero (Post 2579522)
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

Papero 02-23-2018 03:16

Re: csgo best way use
 
Quote:

Originally Posted by BassPower (Post 2579524)
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.


All times are GMT -4. The time now is 17:50.

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