Comanda /rc(report chat)
#1

In loc sa trimita mesajul la admin trimite de 2 ori la player.

Poza: http://imgur.com/a/KC0AH

Comanda /acr:
Код HTML:
CMD:acr(playerid, params[])
{
    new strglobal[856];
	if(PlayerInfo[playerid][pAdmin] == 0) return 1;
	new toplayerid;
	if(sscanf(params, "u", toplayerid)) return ShowSyntax(playerid, "/acr <Name/PlayerID>");
	if(ActiveReport[playerid] != 0) return SCM(playerid, COLOR_WHITE, "You're in a report right now.");
	if(toplayerid == INVALID_PLAYER_ID) return ShowSyntax(playerid, "/acr <Name/PlayerID>");
	if(HaveReport[toplayerid] == 0) return SCM(playerid, COLOR_WHITE, "This player don't have a report active anymore.");
	format(strglobal, sizeof(strglobal), "%s picked up %s's report.", GetName(playerid), GetName(toplayerid));
	SendAdmins(strglobal);
	HaveReport[toplayerid] = 0;
	ActiveReport[playerid] = 1, ActiveReport[toplayerid] = 1;
	ReportDuty[playerid] = 2, ReportDuty[toplayerid] = 1;
	ReportPlayerID[playerid] = toplayerid;
	ReportPlayerID[toplayerid] = toplayerid;
	ReportAdminID[playerid] = playerid;
	ReportAdminID[toplayerid] = toplayerid;
	format(strglobal, sizeof(strglobal), "* %s picked up %s's report.", GetName(playerid), GetName(toplayerid));
	SCM(playerid, COLOR_YELLOW2, strglobal);
	SCM(toplayerid, COLOR_YELLOW2, strglobal);
	SCM(playerid, COLOR_YELLOW2, "* You can stop this report by typing [/finishreport] in chat.");
	SCM(toplayerid, COLOR_YELLOW2, "* You can stop this report by typing [/finishreport] in chat.");
	SCM(playerid, COLOR_YELLOW2, "* You can talk with the player in chat now.");
	SCM(toplayerid, COLOR_YELLOW2, "* You can talk with the admin in chat now.");
	PlayerInfo[playerid][pReports] ++;
	return 1;
}
Comanda /rc:
Код HTML:
CMD:rc(playerid, params[])
{
	new stringuri[128], message[128], string1, string2;
	if(ActiveReport[playerid] == 0) return SCM(playerid, COLOR_WHITE, "You don't have a report active.");
	if(sscanf(params, "s[128]", message)) return ShowSyntax(playerid, "/rc <Message>");
	if(ReportDuty[playerid] == 2) string1 = ReportDuty[playerid];
	if(ReportDuty[playerid] == 1) string2 = ReportDuty[playerid];
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		format(stringuri, 128, "* Admin %s: %s", GetName(playerid), message);
		SCM(playerid,COLOR_YELLOW,stringuri);
		SCM(string2,COLOR_YELLOW,stringuri);
	}
	else
	{
		format(stringuri, 128, "* Player %s: %s", GetName(playerid), message);
		SCM(playerid,COLOR_YELLOW,stringuri);
		SCM(string1,COLOR_YELLOW,stringuri);
	}
	return 1;
}
Reply
#2

Pot spune ca variabilele alea sunt "mixate cu mixeru". Incearca sa reconstruiesti comanda de la zero...
Reply
#3

Ma poti ajuta? Comanda /rc am facut-o eu de la 0 insa am intampinat problema de mai sus.
Reply
#4

Incearca asa:
Код:
CMD:rc(playerid, params[])
{
	new stringuri[128], message[128], string1, string2;
	if(ActiveReport[playerid] == 0) return SCM(playerid, COLOR_WHITE, "You don't have a report active.");
	if(sscanf(params, "s[128]", message)) return ShowSyntax(playerid, "/rc <Message>");
	if(ReportDuty[playerid] == 2) string1 = ReportDuty[playerid];
	if(ReportDuty[playerid] == 1) string2 = ReportDuty[playerid];

	new id = ReportAdminID[playerid]; //admin
	new id2 = ReportPlayerID[playerid]; // player

	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		format(stringuri, 128, "* Admin %s: %s", GetName(playerid), message);
		SCM(id2,COLOR_YELLOW,stringuri);
		SCM(string2,COLOR_YELLOW,stringuri);
	}
	else
	{
		format(stringuri, 128, "* Player %s: %s", GetName(playerid), message);
		SCM(id,COLOR_YELLOW,stringuri);
		SCM(string1,COLOR_YELLOW,stringuri);
	}
	return 1;
}
Reply
#5

Multumesc, respect!
Reply
#6

Tot nu o sa iti mearga... Asa ar fi corect:
PHP код:
CMD:rc(playeridparams[])
{
    new 
stringuri[128], message[128], string1string2;
    if(
ActiveReport[playerid] == 0) return SCM(playeridCOLOR_WHITE"You don't have a report active.");
    if(
sscanf(params"s[128]"message)) return ShowSyntax(playerid"/rc <Message>");
    if(
PlayerInfo[playerid][pAdmin] >= 1)
    {
        
format(stringuri128"* Admin %s: %s"GetName(playerid), message);
        
SCM(playerid,COLOR_YELLOW,stringuri);
        
SCM(ReportPlayerID[playerid],COLOR_YELLOW,stringuri);
    }
    else
    {
        
format(stringuri128"* Player %s: %s"GetName(playerid), message);
        
SCM(playerid,COLOR_YELLOW,stringuri);
        
SCM(ReportAdminID[playerid],COLOR_YELLOW,stringuri);
    }
    return 
1;
}
//Si cealalta modificata:
CMD:acr(playeridparams[])
{
    new 
strglobal[856];
    if(
PlayerInfo[playerid][pAdmin] == 0) return 1;
    new 
toplayerid;
    if(
sscanf(params"u"toplayerid)) return ShowSyntax(playerid"/acr <Name/PlayerID>");
    if(
ActiveReport[playerid] != 0) return SCM(playeridCOLOR_WHITE"You're in a report right now.");
    if(
toplayerid == INVALID_PLAYER_ID) return ShowSyntax(playerid"/acr <Name/PlayerID>");
    if(
HaveReport[toplayerid] == 0) return SCM(playeridCOLOR_WHITE"This player don't have a report active anymore.");
    
format(strglobalsizeof(strglobal), "%s picked up %s's report."GetName(playerid), GetName(toplayerid));
    
SendAdmins(strglobal);
    
HaveReport[toplayerid] = 0;
    
ActiveReport[playerid] = 1ActiveReport[toplayerid] = 1;
    
ReportPlayerID[playerid] = toplayerid;
    
ReportPlayerID[toplayerid] = toplayerid;
    
ReportAdminID[playerid] = playerid;
    
ReportAdminID[toplayerid] = toplayerid;
    
format(strglobalsizeof(strglobal), "* %s picked up %s's report."GetName(playerid), GetName(toplayerid));
    
SCM(playeridCOLOR_YELLOW2strglobal);
    
SCM(toplayeridCOLOR_YELLOW2strglobal);
    
SCM(playeridCOLOR_YELLOW2"* You can stop this report by typing [/finishreport] in chat.");
    
SCM(toplayeridCOLOR_YELLOW2"* You can stop this report by typing [/finishreport] in chat.");
    
SCM(playeridCOLOR_YELLOW2"* You can talk with the player in chat now.");
    
SCM(toplayeridCOLOR_YELLOW2"* You can talk with the admin in chat now.");
    
PlayerInfo[playerid][pReports] ++;
    return 
1;

PS: Posibil sa aibe cateva erori, le rezolvi tu
Reply
#7

A mers 10MIN cum a zis RedGun, multumesc oricum +1 si tie
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)