Radio System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Radio System (
/showthread.php?tid=637420)
Radio System -
valelele - 14.07.2017
Now in my gamemode, I have one Radio System like this:
One player can buy a channel from Verona Mall, he goes there and type (/rentchannel [channel-id(1-9999)] [auth pass])
Then, he needs to /setchannel with the channel and the slot he wants(1-3 slots) and he puts there, it's okay..
By exemple: I buy a channel with /rentchannel 123 samp, then I type /setchannel 123(ID) 1(SLOT) . Then and now I'm on the channel 123 with slot 1. Okay, but if I want to buy another channel with /rentchannel and then /setchannel, the next radio channel it's next to be on slot 2 and so on up to slot 3.
When someone send a message on /radio, I need to see all the channels and all the slots I am on it, not to see just the messages from the channel and slot where I am
This is the
Код:
forward SendRadioMessage(playerid, channel, color, string[]);
public SendRadioMessage(playerid, channel, color, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (GetPVarInt(i, "PlayerLogged") == 1)
{
if(PlayerInfo[i][pChannel] == channel && PlayerInfo[i][pSlot] == PlayerInfo[playerid][pSlot])
{
if(PlayerInfo[i][pAuthed] == 1)
{
SCM(i, color, string);
}
}
}
}
}