CMD:n(playerid, params[])
{
if(playerVariables[playerid][pAdmin] == 0 && playerVariables[playerid][pHelper] == 0)
{
if(playerVariables[playerid][nTimeOut] == 0)
{
if(playerVariables[playerid][timeN] > 0)
return SendClientMessage(playerid, COLOR_ERROR, "You have muted from /n. You can't use this now.");
new helper;
new szClearMsg[600];
if(haveQuestion[playerid] == 0)
{
if(playerVariables[playerid][pTogN] == 0) {
playerVariables[playerid][pTogN] = 1;
SS(playerid, COLOR_ACTION, "Help chat enabled. Use /togn to disable it.", "Chat de ajutor activat. Foloseste /togn pentru a-l dezactiva.");
new query[120];
format(query, sizeof(query), "UPDATE playeraccounts SET playerTogN = '%d' WHERE playerID = '%d'", playerVariables[playerid][pTogN], playerVariables[playerid][pInternalID]);
mysql_query(db, query);
}
format(szMessage, sizeof(szMessage), "* Newbie %s: %s", pName(playerid), params);
S(playerid, COLOR_NEWBIES, szMessage);
format(playerVariables[playerid][pReportMessage], 300, "%s", params);
format(playerVariables[playerid][pReportMessage2], 300, "%s", params);
playerVariables[playerid][nTimeOut] = 120;
haveQuestion[playerid] = 1;
format(szClearMsg, sizeof(szClearMsg), "INSERT INTO chatlogs (value, playerinternalid, chat) VALUES('%s', '%d', 'newbie')", szMessage, playerVariables[playerid][pInternalID]);
mysql_query(handle, szClearMsg);
foreach(Player, i)
{
if(playerVariables[i][pHelperDuty] == 1 && playerVariables[i][pHelper] >= 1 || playerVariables[i][pAdmin] >= 1)
{
helper = i;
break;
}
}
new strings[300];
if(helperQuestion[helper] == 0 && helperQuestionID[helper] == -1 && playerVariables[helper][pHelperDuty] == 1)
{
format(strings, sizeof(strings), "{FFAB00}** {FFEB00}Question from %s (%d, level %d) {FFAB00}**", pName(playerid), playerid, playerVariables[playerid][pLevel]);
SendClientMessage(helper, COLOR_BLUE, strings);
format(strings, sizeof(szMessage), "%s", params);
S(helper, COLOR_YELLOW, strings);
helperQuestion[helper] = 1;
helperQuestionID[helper] = playerid;
}
}
else return SS(playerid, COLOR_ERROR, "You already sent a question to /n. Please wait.", "Ai trimis deja o intrebare pe /n. Asteapta..");
}
else
{
format(szMessage, sizeof(szMessage), "Poti folosi /n peste %d secunde.", playerVariables[playerid][nTimeOut]);
SendClientMessage(playerid, COLOR_ERROR, szMessage);
}
}
else
{
if(helperQuestion[playerid] == 1)
{
if(helperQuestionID[playerid] != -1)
{
new hd, q;
new id = helperQuestionID[playerid];
foreach(Player, i)
{
if(playerVariables[i][pHelperDuty] == 1)
{
hd++;
}
if(haveQuestion[i] == 1)
{
q++;
}
}
if(playerVariables[playerid][pLanguage] == 1)
{
format(szMessage, sizeof(szMessage), "Raspuns trimis: %s", params);
}
else if(playerVariables[playerid][pLanguage] == 2)
{
format(szMessage, sizeof(szMessage), "Answer send: %s", params);
}
S(playerid, COLOR_GREY, szMessage);
if(q >= hd && q > 0)
{
SS(playerid, COLOR_GREY, "You can use /nnext to receive a new question.", "Poti folosi comanda /nnext pentru a primi o intrebare noua.");
}
if(haveQuestion[id] == 1)
{
foreach(Player, i)
{
if(i != playerid && i != id)
{
format(szMessage, sizeof(szMessage), "* Newbie %s: %s", GetName(id), playerVariables[id][pReportMessage]);
if(playerVariables[i][pTogN] == 1) S(i, COLOR_NEWBIES, szMessage);
}
}
}
foreach(Player, z)
{
if(id != z && z != playerid)
{
if(playerVariables[playerid][pAdmin] >= 1)
{
format(szMessage, sizeof(szMessage), "* Admin %s: @%s, %s", pName(playerid), pName(id), params);
}
else if(playerVariables[playerid][pHelper] >= 1)
{
format(szMessage, sizeof(szMessage), "* Helper %s: @%s, %s", pName(playerid), pName(id), params);
}
if(playerVariables[z][pTogN] == 1) S(z, COLOR_NEWBIES, szMessage);
}
else if(id == z && z != playerid)
{
if(playerVariables[playerid][pAdmin] >= 1)
{
format(szMessage, sizeof(szMessage), "* Admin %s: %s", pName(playerid), params);
}
else if(playerVariables[playerid][pHelper] >= 1)
{
format(szMessage, sizeof(szMessage), "* Helper %s: %s", pName(playerid), params);
}
S(z, COLOR_YELLOW, szMessage);
}
haveQuestion[id] = 0;
}
}
else S(playerid, COLOR_ERROR, "Invalid question / user ID.");
}
else SS(playerid, COLOR_ERROR, "You don't have a question active.", "Nu ai nici o intrebare.");
}
return 1;
}
Un +1 ar merge? :D Comanda este facuta fix ca cea de la comunitatea Bugged.