25.02.2019, 14:48
so this is my Walkie Talkie command,/wt is like /sms but its a global chat for everyone that has a walkie talkie.But my problem is,when im alone the command works,i can speak on the wt chat,if its turned off i cant speak if i dont have one i cant speak,everthing works perfect,but if i am with a friend and he has his walkie talkie turned of,i can't write on the chat,is simply doesn't show my text,but if my friend has his walkie on everything work again
CMD:wt(playerid, params[])
{ new szText[128],string[128],string2[64];
if(PlayerInfo[playerid][pWalkie] == 0) return SendClientMessage(playerid, COLOR_GREY, "You need a walkie talkie to speak on the frequency");
if(PlayerInfo[playerid][pWalkieOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "Your walkie talkie is turned off");
if(sscanf(params,"s[128]",szText)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{FFFFFF}/wt <text>");
if(PlayerInfo[playerid][pMuted] == 1)
{
format(string2,sizeof(string2), "You are muted,you will be able to use the /wt chat in %d seconds", PlayerInfo[playerid][pMuteTime]);
SendClientMessage(playerid, COLOR_LIGHTRED, string2);
return 1;
}
foreach(Player,i)
{
if(PlayerInfo[i][pWalkieOn] == 0) return 1;
format(string,sizeof(string),"(Frequency) %s:%s", GetName(playerid),szText);
SendClientMessage(i, COLOR_ORANGE, string);
}
return 1;
}
CMD:wt(playerid, params[])
{ new szText[128],string[128],string2[64];
if(PlayerInfo[playerid][pWalkie] == 0) return SendClientMessage(playerid, COLOR_GREY, "You need a walkie talkie to speak on the frequency");
if(PlayerInfo[playerid][pWalkieOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "Your walkie talkie is turned off");
if(sscanf(params,"s[128]",szText)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{FFFFFF}/wt <text>");
if(PlayerInfo[playerid][pMuted] == 1)
{
format(string2,sizeof(string2), "You are muted,you will be able to use the /wt chat in %d seconds", PlayerInfo[playerid][pMuteTime]);
SendClientMessage(playerid, COLOR_LIGHTRED, string2);
return 1;
}
foreach(Player,i)
{
if(PlayerInfo[i][pWalkieOn] == 0) return 1;
format(string,sizeof(string),"(Frequency) %s:%s", GetName(playerid),szText);
SendClientMessage(i, COLOR_ORANGE, string);
}
return 1;
}