[FilterScript] MySQL Clan System
#24

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
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?
playerClanID holds the clan ID player is in, it's saved and loaded everytime a player connects/disconnects.

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]
So if i want to get player's clan name: i'll do two checks:
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
    }
}
For a list of properties you can get from a clanid:
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
};
^ Its like database but for runtime only!

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
Also i want to remove TEAMS datas, everything related to it. Will it work too without teams?
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.
Reply


Messages In This Thread
MySQL Clan System - by Gammix - 24.07.2018, 03:06
Re: MySQL Clan System - by Ilias_ - 24.07.2018, 07:05
Re: MySQL Clan System - by iLearner - 24.07.2018, 12:46
Re: MySQL Clan System - by Hunud - 24.07.2018, 13:34
Re: MySQL Clan System - by RogueDrifter - 24.07.2018, 16:31
Re: MySQL Clan System - by Gammix - 24.07.2018, 22:30
Re: MySQL Clan System - by Ultraz - 24.07.2018, 22:48
Re: MySQL Clan System - by RxErT - 25.07.2018, 20:19
Re: MySQL Clan System - by iSteve - 29.07.2018, 15:20
Re: MySQL Clan System - by Rassh - 30.07.2018, 00:05
Re: MySQL Clan System - by TroS - 11.08.2018, 13:50
Re: MySQL Clan System - by Chaprnks - 12.08.2018, 04:38
Re: MySQL Clan System - by Gammix - 14.08.2018, 03:51
Re: MySQL Clan System - by Venom546 - 21.09.2018, 16:10
Re: MySQL Clan System - by Gammix - 22.09.2018, 23:45
Re: MySQL Clan System - by Venom546 - 24.09.2018, 10:34
Re: MySQL Clan System - by v1k1nG - 24.09.2018, 11:33
Re: MySQL Clan System - by KinderClans - 14.10.2018, 14:29
Re: MySQL Clan System - by KinderClans - 16.10.2018, 12:55
Re: MySQL Clan System - by Gammix - 16.10.2018, 18:50
Re: MySQL Clan System - by KinderClans - 16.10.2018, 19:21
Re: MySQL Clan System - by KinderClans - 18.10.2018, 13:37
Re: MySQL Clan System - by Danielknow - 20.10.2018, 09:45
Re: MySQL Clan System - by Gammix - 20.10.2018, 16:45
Re: MySQL Clan System - by KinderClans - 22.10.2018, 08:16
Re: MySQL Clan System - by Droxx - 16.12.2018, 15:07

Forum Jump:


Users browsing this thread: 2 Guest(s)