Обычная команда /givegun для выдачи оружия с оповещением для всех администраторов!
Code
else if(strcmp(cmd, "/givegun", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 6) return send(playerid, col_grad1, "* Недостаточно прав!");
if(sscanf(params, "udd", params[0], params[1], params[2])) {
send(playerid, col_grad1, "Используйте: /givegun [ид игрока/часть ника] [ид оружия] [кол-во патронов(1-1000)]");
send(playerid, col_grad4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
send(playerid, col_grad3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)"); return 1; }
new ftext[20];
switch(PlayerInfo[playerid][pMember]) {
case 0: { ftext = "Civilian"; }
case 1: { ftext = "Police Departament"; }
case 2: { ftext = "FBI"; }
case 3: { ftext = "National Guard"; }
case 4: { ftext = "Ministry of Health "; }
case 5: { ftext = "Municipality"; }
case 6: { ftext = "Hitmans Agency"; }
case 7: { ftext = "Cable News Network"; }
case 8: { ftext = "Taxi Cab Company"; }
case 9: { ftext = "Licenzers"; }
case 10: { ftext = "El Coronos Gang"; }
case 11: { ftext = "The Rifa Gang"; }
case 12: { ftext = "Grove Street Gang"; }
case 13: { ftext = "The Ballas Gang"; }
case 14: { ftext = "Vagos"; }
case 15: { ftext = "Колхоз"; }
case 16: { ftext = "Flaming Cobra Gang"; }
case 17: { ftext = "Russian Mafia"; }
case 18: { ftext = "La Cosa Nostra"; }
case 19: { ftext = "Yakuza"; }
default: return 1; }
if(!IsPlayerConnected(params[0])) return send(playerid, col_grad2, "* Игрок не в игре.");
if(GetPVarInt(params[0],"IsAuthed") == 0) return send(playerid, col_grey, "* Игрок не авторизирован!");
if(params[1] < 1 || params[1] > 46 || params[1] == 27 || params[1] == 1 || params[1] == 2 || params[1] == 9 || params[1] == 17 || params[1] == 19 || params[1] == 20 || params[1] == 21 || params[1] == 36 || params[1] == 38 || params[1] == 39 || params[1] == 40 || params[1] == 44 || params[1] == 45) return send(playerid, col_grad1, "* Неверный id оружия.");
if(params[2] < 1 || params[2] > 1000) return send(playerid, col_grad1, "* Неверное количество патронов.");
if(params[0] == INVALID_PLAYER_ID) return 1;
GivePlayerWeapon(params[0], params[1], params[2]);
format(string, sizeof(string), "* [AdmWarn]: %s применил команду /givegun к игроку %s[%s].", getpl(playerid), getpl(params[0]), ftext); ABroadCast(col_yellow, string, 1);
return 1;
}
Автор: (McCoy). Идея: GameWorld.
Команда работает на sscanf.