[HELP] /report
#1

i can't found the problem ... that's relay strange the command don't work properly ... any one know where the problem come from ?
Код:
CMD:report(playerid, params[])
{
	new reason[50], giveplayerid, sendername[24], str3[128], PlayerName[24], file[128];
	if(sscanf(params, "us[32]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [playerid] [reason]");
	if(!IsPlayerConnected(giveplayerid)) return 1;
	GetPlayerName(playerid, sendername, 20);
	GetPlayerName(giveplayerid, PlayerName, sizeof(PlayerName));
	format(file, 128, USER_FILE, PlayerName);
	format(str3, 128, "%s reported by: %s Reason: %s",PlayerName, sendername, reason);
	SendClientMessage(playerid, 0xFFFFFFFF, "thanks for reporting");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(GetAdminLevel(playerid) >= 1|| IsPlayerAdmin(playerid))
			SendClientMessage(i, COLOR_RED, str3);
		}
	}
	return 0;
}
Reply
#2

pawn Код:
CMD:report(playerid, params[])
{
    new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], str[128], reason, iD;
    if (sscanf(params, "dz", iD, reason)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX:/report [ID] [Reason]");
    if (iD == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This Player is not online.");
    if (playerid == iD) return SendClientMessage(playerid, COLOR_RED, "You can't report yourself.");
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(iD, aName, sizeof(aName));
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            new zName[MAX_PLAYER_NAME], pFile[256];
            GetPlayerName(i, zName, sizeof(zName));
            format(pFile, sizeof(pFile), "Users\%s.ini", zName); //not needed but leave it there to avoid errors
            if (IsPlayerAdmin(i) || dini_Int(pFile, "AdminLevel") >= 1)
            {
                format(str, sizeof(str), "%s(%d) has reported %s(%d) for: %s", pName, playerid, aName, iD, reason);
                SendClientMessage(i, COLOR_LEMON, str);
            }
        }
    }
    return 1;
}
^^. Just change the COLOR's to your one to avoid undefined errors
Reply
#3

the problem isn't on the colors ... the problem is that the report can't be sent to admins
Reply
#4

Quote:
Originally Posted by Amine_Mejrhirrou
Посмотреть сообщение
the problem isn't on the colors ... the problem is that the report can't be sent to admins
I ment if you will use the one I posted for you. My one works perfectly so try it.

Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 94 seconds. Haters Gonna Hate FUU

Reply
#5

thanks you then ! i'm gonna try it for now if it works i'll not post in this topic
Reply
#6

Quote:
Originally Posted by Amine_Mejrhirrou
Посмотреть сообщение
thanks you then ! i'm gonna try it for now if it works i'll not post in this topic
Okay as well if you want the reporter to get a message "Thank you for report" or something like that

place this
pawn Код:
SendClientMessage(playerid, COLOR, "YOUR TEXT.");

under
pawn Код:
format(str, sizeof(str), "%s(%d) has reported %s(%d) for: %s", pName, playerid, aName, iD, reason);
                SendClientMessage(i, COLOR_LEMON, str);
Reply
#7

yeah i know how to scrip that . i just don't knew wher the problem came from thanks a lot for your help i appreciate it
Reply
#8

Quote:
Originally Posted by Amine_Mejrhirrou
Посмотреть сообщение
yeah i know how to scrip that . i just don't knew wher the problem came from thanks a lot for your help i appreciate it
Your welcome lol it is my first time helping so lol xD
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)