danis1125
Новичок
Всем привет,вот решил выложить команды /ans /mpgo /a /weap.
В чём суть команд?/ans-ответы на репорт ,/mpgo-узнать какое мп хотят игроки,/a-админ чат,/weap оружие у игрока(админа)
Начнем!
Ну вот и все!
Автор:Не знаю(Вырезка)
В чём суть команд?/ans-ответы на репорт ,/mpgo-узнать какое мп хотят игроки,/a-админ чат,/weap оружие у игрока(админа)
Начнем!
PHP:
if(strcmp(cmd, "/ans", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1) return SCM(playerid, COLOR_GRAD2, "Введите: /ans [id] [ответ]");
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SCM(playerid, COLOR_GRAD2, "Введите /ans [id] [ответ]");
if(strlen(result) >= 99) return SCM(playerid,COLOR_GRAD2, "Слишком длинное сообщение.");
format(query, sizeof(query), "Администратор %s[%i] для %s[%i]: %s", PlayerInfo[playerid][pName],playerid, PlayerInfo[giveplayerid][pName],giveplayerid, (result));
SendAdminMessage(0xff9945AA,query);
format(query, sizeof(query), "Администратор %s[%i] для %s[%i]: %s", PlayerInfo[playerid][pName],playerid, PlayerInfo[giveplayerid][pName],giveplayerid, (result));
SCM(giveplayerid, 0xff9945FF , query);
PlayerPlaySound(giveplayerid, 1085, 0.0, 0.0, 0.0);
return true;
}
}
else
{
SCM(playerid, COLOR_GRAD1, "Игрока с таким id нету на сервере.");
}
}
return true;
}
PHP:
if(strcmp(cmd, "/mpgo", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 8)
{
SendClientMessageToAll(0x33AA33FF, "Администраторы интересуются,какое мп вы хотите?Напишите в репорт.");
}
return 1;
}
PHP:
if(strcmp(cmd, "/a", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[80];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result) && PlayerInfo[playerid][pAdmin] >= 1) return SCM(playerid, COLOR_GRAD1, "Введите /a [текст]");
format(query, sizeof(query), "[A] %s[%i]: %s",PlayerInfo[playerid][pName] ,playerid ,result);
SendAdminMessage(0x99cc00AA, query);
}
return true;
}
PHP:
if(strcmp(cmd, "/weap", true) == 0)
{
new g;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1) return SCM(playerid, COLOR_GRAD2, "Введите /weap [id игрока]");
g = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(g))
{
if(g != INVALID_PLAYER_ID)
{
new weapons[14],ammos[14];
new bigstring[500];
GetPlayerWeaponData(g, 0, weapons[0], ammos[0]);
GetPlayerWeaponData(g, 1, weapons[1], ammos[1]);
GetPlayerWeaponData(g, 2, weapons[2], ammos[2]);
GetPlayerWeaponData(g, 3, weapons[3], ammos[3]);
GetPlayerWeaponData(g, 4, weapons[4], ammos[4]);
GetPlayerWeaponData(g, 5, weapons[5], ammos[5]);
GetPlayerWeaponData(g, 6, weapons[6], ammos[6]);
GetPlayerWeaponData(g, 7, weapons[7], ammos[7]);
GetPlayerWeaponData(g, 8, weapons[8], ammos[8]);
GetPlayerWeaponData(g, 9, weapons[9], ammos[9]);
GetPlayerWeaponData(g, 10, weapons[10], ammos[10]);
GetPlayerWeaponData(g, 11, weapons[11], ammos[11]);
GetPlayerWeaponData(g, 12, weapons[12], ammos[12]);
new temp[44];
format(bigstring,sizeof(bigstring),"{FFFFFF}Слот 0: \tWeaponid: %d\tAmmo: %d\n",weapons[0],ammos[0]);
format(temp, sizeof(temp), "Слот 1: \tWeaponid: %d\tAmmo: %d\n",weapons[1],ammos[1]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 2: \tWeaponid: %d\tAmmo: %d\n",weapons[2],ammos[2]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 3: \tWeaponid: %d\tAmmo: %d\n",weapons[3],ammos[3]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 4: \tWeaponid: %d\tAmmo: %d\n",weapons[4],ammos[4]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 5: \tWeaponid: %d\tAmmo: %d\n",weapons[5],ammos[5]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 6: \tWeaponid: %d\tAmmo: %d\n",weapons[6],ammos[6]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 7: \tWeaponid: %d\tAmmo: %d\n",weapons[7],ammos[7]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 8: \tWeaponid: %d\tAmmo: %d\n",weapons[8],ammos[8]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 9: \tWeaponid: %d\tAmmo: %d\n",weapons[9],ammos[9]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 10: \tWeaponid: %d\tAmmo: %d\n",weapons[10],ammos[10]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 11: \tWeaponid: %d\tAmmo: %d\n",weapons[11],ammos[11]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 12: \tWeaponid: %d\tAmmo: %d\n",weapons[12],ammos[12]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "\n\n{9ACD32}Слот 2: \t%d\n",GunAC[g][2]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 3: \t%d\n",GunAC[g][3]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 4: \t%d\n",GunAC[g][4]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 5: \t%d\n",GunAC[g][5]);
strcat(bigstring, temp, sizeof(bigstring));
format(temp, sizeof(temp), "Слот 6: \t%d\n",GunAC[g][6]);
strcat(bigstring, temp, sizeof(bigstring));
SPD(playerid, 1277, 0, PlayerInfo[g][pName], bigstring, "Закрыть", "");
return true;
}
}
else
{
SCM(playerid, COLOR_GRAD1, "Игрока с таким id нету");
}
}
return true;
}
Автор:Не знаю(Вырезка)
