Help with teamchat threw frequencies
#7

Well just store the values in the array and compare only the array in OnPlayerText
pawn Код:
static const
    pFreqFrac = 100
;
static stock
     pFrequency[MAX_PLAYERS]
;
stock SetPlayerFrequency(playerid, freq1, freq2) {
    pFrequency[playerid] = freq1 * pFreqFrac + freq2 % pFreqFrac;
}
stock GetPlayerFrequency(playerid, & freq1, & freq2) {
    freq1 = pFrequency[playerid] / pFreqFrac;
    freq2 = pFrequency[playerid] % pFreqFrac;
}
stock GetPlayerFrequencyV(playerid) {
    return pFrequency[playerid];
}
pawn Код:
// OnPlayerText
    if(text[0] == '!') {
        new
            string[144],
            freq = GetPlayerFrequencyV(playerid)
        ;
        GetPlayerName(playerid, string, MAX_PLAYER_NAME);
        format(string, sizeof string, ":Radio: %s: %s", string, text[1]);

        for(new i; i < MAX_PLAYERS; i++) {
            if(GetPlayerFrequencyV(i) == freq) {
                SendClientMessage(i, COLOR_YELLOW, string);
            }
        }
        return 0;
    }
Reply


Messages In This Thread
Help with teamchat threw frequencies - by AIped - 31.05.2014, 09:46
Re: Help with teamchat threw frequencies - by Threshold - 31.05.2014, 10:10
Re: Help with teamchat threw frequencies - by SyntaxQ - 31.05.2014, 10:13
Re: Help with teamchat threw frequencies - by AIped - 31.05.2014, 10:45
Re: Help with teamchat threw frequencies - by Zues - 31.05.2014, 16:26
Re: Help with teamchat threw frequencies - by AIped - 31.05.2014, 16:27
AW: Help with teamchat threw frequencies - by Nero_3D - 31.05.2014, 18:06
Re: Help with teamchat threw frequencies - by LowRyder - 31.05.2014, 18:56
Re: Help with teamchat threw frequencies - by AIped - 31.05.2014, 20:22
Re: Help with teamchat threw frequencies - by Threshold - 01.06.2014, 03:31

Forum Jump:


Users browsing this thread: 2 Guest(s)