not a playertopoint i don't want to use those cmd at some coord just want to give guns to a distance
Код:
CMD:rgivegun(playerid, params[])
{
new Float:x, Float:y, Float:z, dist;
if(pData[playerid][AdmLvl] > 3) // change to your own adm var
{
if(sscanf(params"ii", dist, wepid)) return SendClientMessage(playerid, 0xFF0000FF, "Usage:{FFFFFF} /rgivegun [radius] [weaponid]");
{
if(wepid < 0 || wepid > 46) return SendClientMessage(playerid, 0xFF0000FF, "Weapon ID can not be less than 0 or higher than 46!");
GetPlayerPos(playerid, x, y, z);
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(playerid, dist, x, y, z))
{
GivePlayerWeapon(i, wepid, 100);
SendClientMessage(playerid, 0x00BFFFFF, "You have been given a weapon!");
}
}
}
}
else return SendClientMessage(playerid, 0xFF0000FF, "You are not authorized for this command!");
return 1;
}