30.09.2018, 09:47
CMD:givegun(playerid, params[])
{
new targetid, weaponid;
if(PlayerInfo[playerid][pAdmin] < 4)
{
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
}
if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6)
{
return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty.");
}
if(sscanf(params, "ui", targetid, weaponid))
{
return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /givegun [playerid] [weaponid]");
}
if(!IsPlayerConnected(targetid))
{
return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected.");
}
if(PlayerInfo[targetid][pHours] < 2 || PlayerInfo[targetid][pWeaponRestricted] > 0)
{
return SendClientMessage(playerid, COLOR_GREY, "That player is either weapon restricted or played less than two playing hours.");
}
if(!(1 <= weaponid <= 46))
{
return SendClientMessage(playerid, COLOR_GREY, "Invalid weapon.");
}
if(weaponid == 38 && PlayerInfo[playerid][pAdmin] < 5)
{
return SendClientMessage(playerid, COLOR_GREY, "The minigun was disabled due to abuse.");
}
GivePlayerWeaponEx(targetid, weaponid);
SendClientMessageEx(targetid, COLOR_AQUA, "You have received a {00AA00}%s{33CCFF} from %s.", GetWeaponNameEx(weaponid), GetPlayerRPName(playerid));
SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given a %s to %s.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid), GetPlayerRPName(targetid));
Log_Write("log_givegun", "%s (uid: %i) gives a %s to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetWeaponNameEx(weaponid), GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]);
return 1;
}
{
new targetid, weaponid;
if(PlayerInfo[playerid][pAdmin] < 4)
{
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
}
if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6)
{
return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty.");
}
if(sscanf(params, "ui", targetid, weaponid))
{
return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /givegun [playerid] [weaponid]");
}
if(!IsPlayerConnected(targetid))
{
return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected.");
}
if(PlayerInfo[targetid][pHours] < 2 || PlayerInfo[targetid][pWeaponRestricted] > 0)
{
return SendClientMessage(playerid, COLOR_GREY, "That player is either weapon restricted or played less than two playing hours.");
}
if(!(1 <= weaponid <= 46))
{
return SendClientMessage(playerid, COLOR_GREY, "Invalid weapon.");
}
if(weaponid == 38 && PlayerInfo[playerid][pAdmin] < 5)
{
return SendClientMessage(playerid, COLOR_GREY, "The minigun was disabled due to abuse.");
}
GivePlayerWeaponEx(targetid, weaponid);
SendClientMessageEx(targetid, COLOR_AQUA, "You have received a {00AA00}%s{33CCFF} from %s.", GetWeaponNameEx(weaponid), GetPlayerRPName(playerid));
SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given a %s to %s.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid), GetPlayerRPName(targetid));
Log_Write("log_givegun", "%s (uid: %i) gives a %s to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetWeaponNameEx(weaponid), GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]);
return 1;
}