15.04.2016, 02:28
Hi guys, I use South Central gamemode, but I have a problem with a cmds, only one and I can't resolve this..
The problem is the radio, when i define channel IG e.g: (/channel 3), the channel successfully change but when I type /r nothing happen in tchat..
Please I seriously need your help guys..
Script:
The problem is the radio, when i define channel IG e.g: (/channel 3), the channel successfully change but when I type /r nothing happen in tchat..
Please I seriously need your help guys..
Script:
Code:
CMD:channel(playerid, params[])
{
new channel;
if (!Inventory_HasItem(playerid, "Radio Portable"))
return SendErrorMessage(playerid, "You must have a portable radio.");
if (sscanf(params, "d", channel))
{
SendSyntaxMessage(playerid, "/channel [radio channel] (0 to disable)");
if (PlayerData[playerid][pChannel] > 0)
SendClientMessageEx(playerid, COLOR_YELLOW, "[NOTE]:{FFFFFF} Your current radio channel is set to %d.", PlayerData[playerid][pChannel]);
return 1;
}
if (channel < 0 || channel > 999999)
return SendErrorMessage(playerid, "The channel can't be below 0 or above 999,999.");
PlayerData[playerid][pChannel] = channel;
if (channel == 0)
SendServerMessage(playerid, "You have disabled your portable radio.");
else SendServerMessage(playerid, "You have set your radio's channel to %d (\"/r [text]\" to chat).", channel);
return 1;
}
CMD:r(playerid, params[])
{
if (isnull(params))
return SendSyntaxMessage(playerid, "/r [Radio IC]");
if (!Inventory_HasItem(playerid, "Radio Portable"))
return SendErrorMessage(playerid, "You must have a portable radio.");
if (!PlayerData[playerid][pChannel])
return SendErrorMessage(playerid, "Your portable radio is disabled (/channel).");
static
string[128];
if(PlayerData[playerid][pChannel] == 911 && GetFactionType(playerid) != FACTION_POLICE) return SendErrorMessage(playerid, "This is police department's freqency only.");
if (strlen(params) > 64)
{
format(string, sizeof(string), "** [RADIO: %d] %s: %.64s",PlayerData[playerid][pChannel],ReturnName(playerid, 0), params);
SendRadioMessage(PlayerData[playerid][pChannel], COLOR_SERVER, string);
format(string, sizeof(string), "...%s **",params[64]);
SendRadioMessage(PlayerData[playerid][pChannel], COLOR_SERVER, string);
//SendNearbyMessage(playerid, 5.0, COLOR_SERVER, "** (Radio) %s: %.64s", ReturnName(playerid, 0), params);
//SendNearbyMessage(playerid, 5.0, COLOR_SERVER, "...%s **", params[64]);
}
else {
format(string, sizeof(string), "** [RADIO: %d] %s: %.64s",PlayerData[playerid][pChannel],ReturnName(playerid, 0), params);
SendRadioMessage(PlayerData[playerid][pChannel], COLOR_SERVER, string);
format(string, sizeof(string), "...%s **",params[64]);
SendRadioMessage(PlayerData[playerid][pChannel], COLOR_SERVER, string);
//SendNearbyMessage(playerid, 5.0, COLOR_SERVER, "** (Radio) %s: %.64s", ReturnName(playerid, 0), params);
}
return 1;
}

