09.10.2013, 17:12
Hello, my server is crashing at when I use the RadioBroadCast function, but when I use the same function on Localhost, it doesn't crash, it seems to only crash on Linux. I tried using the Crashdetect plugin, but it didn't do anything to tell me.
pawn Код:
forward RadioBroadCast(playerid, Float:radi, color, string[]);
public RadioBroadCast(playerid, Float:radi, color, string[])
{
new MiscString[128];
foreach(new i : Player)
{
if(PlayerInfo[i][pRadioFreq] == PlayerInfo[playerid][pRadioFreq] && PlayerInfo[i][pRadio] == 1)
{
for(new Words; Words < sizeof(BannedWords); Words++) //Sets a loop as it checks the words one by one.
{
if(strfind(string,BannedWords[Words],true) != -1 ) // Checks if the text includes any of the defined Swear Words or not
{
SendClientMessage(playerid, -1, "Using OOC Words in IC chat is prohibited.");
return 1; // return 0; to avoid sending the text in chat.
}
}
format(MiscString, sizeof(MiscString), "** [%d khz] %s: %s **", PlayerInfo[playerid][pRadioFreq], GetName(playerid), string);
SendClientMessage(i, color, MiscString);
format(MiscString, sizeof(MiscString), "(radio) %s says: %s", GetName(playerid), string);
ProxDetector(radi, playerid, MiscString,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
format(MiscString, sizeof(MiscString), "[%d khz] %s (IP: %s): %s", PlayerInfo[playerid][pRadioFreq], GetName(playerid), GetPlayerIpEx(playerid), string);
Log("logs/radio.log", MiscString);
}
}
return 1;
}