Typical nothing is as easy as I imagine it to be lol.
Ok, my idea is when an admin gags a player, their STEAMID (surrounded by commas ( , ) ) is stored in a huge string variable and when that player speaks, the code will search that huge string variable for the player's STEAMID and if it is found then block the chat.
Unfortunately since I am relatively new to this language I am having difficulty handling the string variables at the point where I am trying to add the steamid to the huge string variable.
Here is what I have tryed so far (using most of the author's existing code, I said I was new to this :p):
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <lang>
#include <xs>
new g_gagged[510] // To store SteamID of who are gaged
public gag(id, level, cid)
{
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new cmd[32], playerName[32]
read_argv(0, cmd, 31)
read_argv(1, playerName, 31)
remove_quotes(playerName)
// Search for the Player
new player_id = get_player(playerName)
new steamAgainst[32]
get_user_authid(player_id, steamAgainst, 31)
if(equal(cmd, "amx_gag"))
{
//g_gagged = g_gagged & "," & steamAgainst & ","
new len = strlen(g_gagged)
//g_gagged[len] = g_gagged[len] & "," & steamAgainst & ","
//g_gagged[len] = g_gagged[len] & "," & steamAgainst & ","
g_gagged[len] = g_gagged[len] + "," & steamAgainst + ","
}
}
I cannot get the hang of the indexes in the variables

, can you tell me is my modified code anywhere near correct?