Quote:
Originally Posted by Leonardo
Unfortunately, I dont know what is it "Insurgency" ^_^
but try to use function OnMapSpawn. for checking on every rounds before event round_start.
and.... maybe not "strcmp", but this: StrContains(string_a ,string_b)>=-1
and for "menu" should use ConCommands, for example, "+toggleLaser"/"-toggleLaser".
personal setting must be in arrays... for example: new PlayerSettings[<clientID>][<settingID>][<lengthOfSettingsValue>]
and can anyone say, whats wrong here?
Code:
g_CvarWeapons = CreateConVar("sm_laser_aim_weapons", "weapon_awp|weapon_scout", "List of weapons", FCVAR_NOTIFY);
Code:
new bool:b_playerNeededWeapon;
b_playerNeededWeapon = false;
new String:s_neededWeaponList[128];
GetConVarString(g_CvarWeapons, s_neededWeaponList, sizeof(s_neededWeaponList));
new a_playerWeaponTemp[12][32];
str_piece(s_neededWeaponList, a_playerWeaponTemp, sizeof(a_playerWeaponTemp), sizeof(a_playerWeaponTemp[]) - 1, '|');
for(new i = 0; i < sizeof(a_playerWeaponTemp); i++)
{
if (StrEqual(a_playerWeaponTemp[i], s_playerWeapon))
{
b_playerNeededWeapon = true;
}
}
Code:
stock str_piece(input[], output[][], outputsize, piecelen, token = '|')
{
new i = -1, pieces, len = -1 ;
while ( input[++i] != 0 )
{
if ( input[i] != token )
{
if ( ++len < piecelen )
output[pieces][len] = input[i] ;
}
else
{
output[pieces++][++len] = 0 ;
len = -1 ;
if ( pieces == outputsize )
return pieces ;
}
}
return pieces + 1;
}
|
I'm not seeing exactly what you are trying to do, but if you're trying to check the equiped weapon against the allowed weapons, I suggest you just make as many cvars as there are weapons, like "sm_laseraim_weapon_awp 1", it'll make things easier on your end user, and on you, since you could just check this by using a switch statement.
If this was not where you where going for, ignore me :p