PHP код:
CMD:sethitman(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1339 && PlayerInfo[playerid][pShopTech] == 0) return Error(playerid, "You are not authorized to use this command.");
new giveplayerid, choice[32], string[128];
if(sscanf(params, "is[32]", giveplayerid, choice))
{
SendClientMessageEx(playerid, COLOR_GRAD1, "USAGE: /sethitman [playerid] [weapon]");
SendClientMessageEx(playerid, COLOR_GRAD2, "Available names: 9mm, Sawnoff, Uzi");
return 1;
}
if(strcmp(choice, "9mm", true) == 0)
{
if(PlayerInfo[giveplayerid][p9mmSkill] == 1)
{
PlayerInfo[giveplayerid][p9mmSkill] = 0;
SetPlayerSkillLevel(giveplayerid, WEAPONSKILL_PISTOL, 400);
format(STRING, "AdmCmd: %s has taken %s's hitman skill on the 9mm",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
SendAdminMessage(COLOR_LIGHTRED, string);
Log("logs/csr.log", string);
format(STRING, "Admin %s has taken your hitman skill on the 9mm",GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
}
else
{
PlayerInfo[giveplayerid][p9mmSkill] = 1;
SetPlayerSkillLevel(giveplayerid, WEAPONSKILL_PISTOL, 999);
format(STRING, "AdmCmd: %s has given %s hitman skill on the 9mm",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
SendAdminMessage(COLOR_LIGHTRED, string);
Log("logs/csr.log", string);
format(STRING, "Admin %s has given you hitman skill on the 9mm",GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
}
}
if(strcmp(choice, "sawnoff", true) == 0)
{
if(PlayerInfo[giveplayerid][pSawnoffSkill] == 1)
{
PlayerInfo[giveplayerid][pSawnoffSkill] = 0;
SetPlayerSkillLevel(giveplayerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 400);
format(STRING, "AdmCmd: %s has taken %s's hitman skill on the Sawnoff Shotgun",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
SendAdminMessage(COLOR_LIGHTRED, string);
Log("logs/csr.log", string);
format(STRING, "Admin %s has taken your hitman skill on the Sawnoff Shotgun",GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
}
else
{
PlayerInfo[giveplayerid][pSawnoffSkill] = 1;
SetPlayerSkillLevel(giveplayerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
format(STRING, "AdmCmd: %s has given %s hitman skill on the Sawnoff Shotgun",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
SendAdminMessage(COLOR_LIGHTRED, string);
Log("logs/csr.log", string);
format(STRING, "Admin %s has given you hitman skill on the Sawnoff Shotgun",GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
}
}
if(strcmp(choice, "uzi", true) == 0)
{
if(PlayerInfo[giveplayerid][pUziSkill] == 1)
{
PlayerInfo[giveplayerid][pUziSkill] = 0;
SetPlayerSkillLevel(giveplayerid, WEAPONSKILL_MICRO_UZI, 400);
format(STRING, "AdmCmd: %s has taken %s's hitman skill on the UZI",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
SendAdminMessage(COLOR_LIGHTRED, string);
Log("logs/csr.log", string);
format(STRING, "Admin %s has taken your hitman skill on the UZI",GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
}
else
{
PlayerInfo[giveplayerid][pUziSkill] = 1;
SetPlayerSkillLevel(giveplayerid, WEAPONSKILL_MICRO_UZI, 999);
format(STRING, "AdmCmd: %s has given %s hitman skill on the UZI",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
SendAdminMessage(COLOR_LIGHTRED, string);
Log("logs/csr.log", string);
format(STRING, "Admin %s has given you hitman skill on the UZI",GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
}
}
OnPlayerStatsUpdate(giveplayerid);
return 1;
}