CMD:wt(playerid, params[]) { if(PlayerInfo[playerid][pRadio] == 1) { if(isnull(params)) { SendClientMessageEx(playerid, COLOR_WHITE, "[USAGE] /wt [chat]"); SendClientMessageEx(playerid, COLOR_GRAD2, "[HINT] Type /setfreq to set the frequency of your Walkie Talkie."); return 1; } if(PlayerInfo[playerid][pRadioFreq] >= 1 || PlayerInfo[playerid][pRadioFreq] <= -1) { if(GetPVarInt(playerid, "Injured") != 0||PlayerCuffed[playerid]!=0||GetPVarInt(playerid, "Hospital")!=0) { SendClientMessageEx (playerid, COLOR_GRAD2, "You cannot do this at this time."); return 1; } RadioBroadCast(playerid, COLOR_GREY, params); return 1; } else { SendClientMessageEx(playerid, COLOR_GRAD2, "The frequency of your radio is set to 0, you can not broadcast over that frequency."); } } else { SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have a Walkie Talkie!"); } return 1; }
public RadioBroadCast(playerid, color, string[]) { new MiscString[256], Float: aaaPositions[3]; new String[256], foreach(Player, i) { if(PlayerInfo[i][pRadioFreq] == PlayerInfo[playerid][pRadioFreq] && PlayerInfo[i][pRadio] >= 1 && gRadio[i] != 0) { GetPlayerPos(i, aaaPositions[0], aaaPositions[1], aaaPositions[2]); format(MiscString, sizeof(MiscString), "[WT:%d] {75AE5D}%s : %s", PlayerInfo[playerid][pRadioFreq], GetPlayerNameEx(playerid), String); SendClientMessageEx(i, COLOR_YELLOW, MiscString); format(MiscString, sizeof(MiscString), "[<WT>]\n* %s *", String); SetPlayerChatBubble(i, MiscString, 0x75AE5D00, 5.0, 5000); } if(AdminReadPm[i] == true) { format(MiscString, sizeof(MiscString), "[WT:%d] {75AE5D}%s : %s", PlayerInfo[playerid][pRadioFreq], GetPlayerNameEx(playerid), String); SendClientMessage(i, COLOR_YELLOW, MiscString); } } }
public RadioBroadCast(playerid, color, string[]) { new MiscString[256], Float: aaaPositions[3]; new String[256], foreach(Player, i) { if(PlayerInfo[i][pRadioFreq] == PlayerInfo[playerid][pRadioFreq] && PlayerInfo[i][pRadio] >= 1 && gRadio[i] != 0) { GetPlayerPos(i, aaaPositions[0], aaaPositions[1], aaaPositions[2]); format(MiscString, sizeof(MiscString), "[WT:%d] {75AE5D}%s : %s", PlayerInfo[playerid][pRadioFreq], GetPlayerNameEx(playerid), string); SendClientMessageEx(i, COLOR_YELLOW, MiscString); format(MiscString, sizeof(MiscString), "[<WT>]\n* %s *", string); SetPlayerChatBubble(i, MiscString, 0x75AE5D00, 5.0, 5000); } if(AdminReadPm[i] == true) { format(MiscString, sizeof(MiscString), "[WT:%d] {75AE5D}%s : %s", PlayerInfo[playerid][pRadioFreq], GetPlayerNameEx(playerid), String); SendClientMessage(i, COLOR_YELLOW, MiscString); } } }
new MiscString[256], Float: aaaPositions[3]; new String[256],
if(isnull(params))
{
SendClientMessageEx(playerid, COLOR_WHITE, "[USAGE] /wt [chat]");
SendClientMessageEx(playerid, COLOR_GRAD2, "[HINT] Type /setfreq to set the frequency of your Walkie Talkie.");
return 1;
}
use sscanf instead of this
PHP код:
|
error 017: undefined symbol "i"
error 001: expected token: "-identifier-", but found "for"
public RadioBroadCast(playerid, color, string[]) { new MiscString[256], Float: aaaPositions[3] , String[256]; foreach(Player, i) { if(PlayerInfo[i][pRadioFreq] == PlayerInfo[playerid][pRadioFreq] && PlayerInfo[i][pRadio] >= 1 && gRadio[i] != 0) { GetPlayerPos(i, aaaPositions[0], aaaPositions[1], aaaPositions[2]); format(MiscString, sizeof(MiscString), "[WT:%d] {75AE5D}%s : %s", PlayerInfo[playerid][pRadioFreq], GetPlayerNameEx(playerid), string); SendClientMessageEx(i, COLOR_YELLOW, MiscString); format(MiscString, sizeof(MiscString), "[<WT>]\n* %s *", string); SetPlayerChatBubble(i, MiscString, 0x75AE5D00, 5.0, 5000); } if(AdminReadPm[i] == true) { format(MiscString, sizeof(MiscString), "[WT:%d] {75AE5D}%s : %s", PlayerInfo[playerid][pRadioFreq], GetPlayerNameEx(playerid), String); SendClientMessage(i, COLOR_YELLOW, MiscString); } } }