Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock ShowRadioTextDraw(playerid)
- {
- PlayerTextDrawShow(playerid, PlayerText:RadioDraw[playerid]);
- PlayerTextDrawShow(playerid, PlayerText:ChannelDraw[playerid]);
- PlayerTextDrawShow(playerid, PlayerText:SlotDraw[playerid]);
- SetRadioChannel(playerid, GetPlayerChannel(playerid));
- SetRadioSlot(playerid, GetPlayerSlot(playerid));
- return 1;
- }
- stock HideRadioTextDraw(playerid)
- {
- PlayerTextDrawHide(playerid, PlayerText:RadioDraw[playerid]);
- PlayerTextDrawHide(playerid, PlayerText:ChannelDraw[playerid]);
- PlayerTextDrawHide(playerid, PlayerText:SlotDraw[playerid]);
- return 1;
- }
- stock RadioMSG(playerid, message[])
- {
- new msg[128];
- format(msg, sizeof(msg), "{00FFFF}[Radio]{DADADA}: %s", message);
- return SendClientMessageEx(playerid, -1, msg);
- }
- stock SetRadioChannel(playerid, channel)
- {
- new msg[128];
- if(channel == 0)
- {
- format(msg, sizeof(msg), "~b~Chan: ~h~~g~0");
- PlayerInfo[playerid][pAuthed] = 0;
- }
- else
- {
- format(msg, sizeof(msg), "~b~Chan: ~h~~g~%d", channel);
- }
- PlayerTextDrawSetString(playerid, ChannelDraw[playerid], msg);
- PlayerInfo[playerid][pChannel] = channel;
- return 1;
- }
- stock SetRadioSlot(playerid, slot)
- {
- new msg[128];
- format(msg, sizeof(msg), "~b~Slot: ~h~~g~%d", slot);
- PlayerTextDrawSetString(playerid, SlotDraw[playerid], msg);
- PlayerInfo[playerid][pSlot] = slot;
- return 1;
- }
- // not show textdraw
- CMD:setchannel(playerid, params[])
- {
- new msg[128];
- new channelid,slot;
- if(sscanf(params, "d", channelid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "/setchannel [channel ID]");
- if(PlayerInfo[playerid][pRadio] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have a radio.");
- if(!ChannelExist(channelid)) return RadioMSG(playerid, "No such channel.");
- if(channelid == 911 && PlayerInfo[playerid][pMember] != 1) return SendClientMessageEx(playerid, COLOR_GREY, "Your radio doesn't support in this channel (LSPD).");
- if(channelid == GetPlayerChannel(playerid)) return RadioMSG(playerid, "You are in this channel already.");
- format(msg, sizeof(msg), "Radio Channel sET [CH: %d, Slot: %d]", channelid, slot);
- SendClientMessageEx(playerid, COLOR_GREEN, msg);
- RadioMSG(playerid, "Before you can /r please authorize, /auth.");
- PlayerInfo[playerid][pAuthed] = 0;
- SetRadioChannel(playerid, channelid);
- SetRadioSlot(playerid, slot);
- ShowRadioTextDraw(playerid);
- return 1;
- }
- CMD:setslot(playerid, params[])
- {
- new slot, string[128];
- if(sscanf(params, "d", slot)) return SendClientMessageEx(playerid, COLOR_GRAD1, "/setslot [slot-id]");
- if(PlayerInfo[playerid][pRadio] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have a radio.");
- if(slot == GetPlayerSlot(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are in this slot already.");
- if(slot > 3 || slot < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Slot must be 1-3.");
- SetRadioSlot(playerid, slot);
- format(string, sizeof(string), "You have set your radio slot to %d.", slot);
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- ShowRadioTextDraw(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment