20.10.2018, 16:45
Quote:
|
Another question. How i can restrict a command for just one clan? I mean, i wanna do /clanmute, and player must be in clan "Test" to use it, how to? Do i need to check clan database ID or name? How i can do it?
I see there is playerClanID, but i don't know how to use it, i mean really don't know how it works. And, playerClanID is saved somewhere in database or is just a temporary variable? |
You can use this variable to access clan data in your command, if have done a similar job in other clan commands.
Have a look:
Код:
clanData[clanid][property]
pawn Код:
if (playerClanID[playerid] == -1) { // so we don't get any runtime error
if (!strcmp("Test", clanData[playerClanID[playerid]][CLAN_NAME])) { // clan name matches to "Test"
// do your code here
}
}
pawn Код:
enum E_CLAN_DATA {
CLAN_SQLID,
CLAN_TAG[MAX_CLAN_TAG_NAME],
CLAN_NAME[MAX_CLAN_NAME],
CLAN_SKIN,
CLAN_TEAM,
CLAN_OWNER[MAX_PLAYER_NAME],
Float:CLAN_SPAWN_POS[4],
CLAN_SPAWN_INTERIORID,
CLAN_SPAWN_WORLDID,
CLAN_VAULT_MONEY,
CLAN_VAULT_WEAPONS[MAX_CLAN_WEAPONS],
CLAN_VAULT_WEAPONS_TIMESTAMP[MAX_CLAN_WEAPONS],
CLAN_TOTAL_EXP,
CLAN_WAR_WINS,
CLAN_WAR_TOTAL,
Text3D:CLAN_3D_TEXT_LABEL,
CLAN_PICKUPID
};
Yes you can remove the array and code related to TEAMS, you have to remove the command related to setting clan team and also remove some code from OnPlayerSpawn.


