/report Command
#1

I need a command so like

/report (id) (message)

Then saves it to a .txt in the scriptfiles

Thanks
Reply
#2

I suggest you look into pen1 script how to save text int oa file, just use io_append with a \n before text
Reply
#3

Код:
dcmd_report(playerid, params[])
{
new player, reason[30];

if(sscanf(params, "us", player, reason))
{
SendClientMessage(playerid, RED, "Type: /report [player ID or part of name [reason].");
return 1;
}

if(player == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, RED, "Player not found.");
return 1;
}

new string[142], name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name1, MAX_PLAYER_NAME);
GetPlayerName(player, name2, MAX_PLAYER_NAME);

format(string, 142, "Player %s (ID: %i) reports %s (ID: %i) . REASON: %s.", name1, playerid, name2, player, reason);

new bool:AdminOnline = false;

for(new player2; player2 < GetMaxPlayers(); player2++)
{
if(IsPlayerAdmin(player2))
{
SendClientMessage(player2, RED, string);
AdminOnline = true;
}
}

if(AdminOnline == false)
{
SendClientMessage(playerid, RED, "Niestety, aktualnie nie ma adminуw. Pisz na GG: 123456.");
}
else
{
SendClientMessage(playerid, YELLOW, "Zgłosiłeś raport.");
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)