SUPPORT - ЗАДАТЬ ВОПРОС
- Код:
if(strcmp(cmd, "/support", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Исп.: /support [support text]");
return 1;
}
format(string, sizeof(string), "* Вопрос от игрока %s[ID: %d]: %s", sendername,playerid, (result));
ABroadCast(COLOR_FLBLUE,string,1);
format(string, sizeof(string), "* Ваш вопрос: '%s' был отправлен.", (result));
SendClientMessage(playerid, COLOR_FLBLUE, string);
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Вы заткнуты Администратором!");
return 1;
}
Ответ на /support - (/as)upport
- Код:
if(strcmp(cmd, "/asupport", true) == 0 || strcmp(cmd, "/as", true) == 0)
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Введите пароль!");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Исп.: (/as)upport [ID или ИМЯ] [ответ на вопрос]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{ }
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Исп.: (/ar)eport [ID или ИМЯ] [ответ на вопрос]");
return 1;
}
format(string, sizeof(string), "* Отв. на вопрос: %s", (result));
SendClientMessage(giveplayerid, COLOR_FLBLUE, string);
format(string, sizeof(string), "* Ответ на вопрос %s[ID:%d]: %s", giveplayer, giveplayerid, (result));
SendClientMessage(playerid, COLOR_FLBLUE, string);
SBizzInfo[2][sbTill] += txtcost / 2;
ExtortionSBiz(2, txtcost / 2);
return 1;
}
}
else
{
format(string, sizeof(string), " Этого Игрока нет на сервере. [%d]", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
return 1;
}