08.04.2018, 16:36
It crashes my server after I use /report command, idk why.. can u guys please point it out for me, what causes it??
The command :
The command :
PHP код:
CMD:report(playerid, params[])
{
new string[144], targetid, reason[MAX_PLAYERS], count = 0;
if(GetPVarInt(playerid, "TryToEscape") == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to log in to use this command!");
if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Penggunaan: /report [playerid] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFF0000FF, "This player is not logged in!");
if(GetPVarInt(targetid, "TryToEscape") == 0) return SendClientMessage(playerid, -1, "This player is not logged in");
if(strlen(reason) < 6) return SendClientMessage(playerid, -1, "Your report is too short"); //
format(string, sizeof(string), "%s have reported against %s reason: %s", IsPlayerName(playerid), IsPlayerName(targetid), reason);
SaveLogs("Reports", string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPVarInt(i, "TryToEscape") == 1 && Account[i][Admin] > 0)
{
count ++;
SendClientMessage(i, 0xFF0000FF, string);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
}
format(string, sizeof(string), "Your report is being processed by the system. Thanks for your report!", count);
SendClientMessage(playerid, 0xFF0000FF, string);
count = 0;
return 1;
}