Hey, is possible, to do a drop item/create an object instant? Like, when i use my command "/d(rop)gun", i have to move, to see the object on my foot.
How i can create the object/drop the item, and seeing him, without moving.
Код:
CMD:dgun(playerid, params[])
{
if(!IsPlayerHoldingWeapon(playerid)) return SCM(playerid, COLOR_LIGHTRED, "You're not holding a weapon.");
new weaponid = GetWeaponHolding(playerid);
new faction = PlayerInfo[playerid][pFaction];
if(faction == LSPD || faction == SASD || faction == LSFD || faction == GOV) return SCM(playerid, COLOR_YELLOWG,"Nu poti arunca arma pe jos cat timp esti intr-o factiune guvernamentala");
if(!HasWeapon(playerid, weaponid)) return 1;
new gunobject = GunObjects[weaponid][0];
new dropid = GetNextWepDropID();
WeaponDropInfo[dropid][gunObject] = CreateDynamicObject(gunobject, PlayerPosX(playerid), PlayerPosY(playerid), PlayerPosZ(playerid)-1, 93.7, 120.0, 120.0, GetWorld(playerid), GetInterior(playerid), -1, 200.0);
WeaponDropInfo[dropid][gunID] = weaponid;
WeaponDropInfo[dropid][gunAmmo] = GetWeaponAmmo(playerid, weaponid);
WeaponDropInfo[dropid][gunDropped] = 1;
WeaponDropInfo[dropid][gunPosX] = PlayerPosX(playerid);
WeaponDropInfo[dropid][gunPosY] = PlayerPosY(playerid);
WeaponDropInfo[dropid][gunPosZ] = PlayerPosZ(playerid)-1;
RemovePlayerWeapon(playerid, weaponid);
if(IsMeleeWeapon(weaponid))
{
PlayerInfo[playerid][pMeleeWep] = 0;
}
if(IsPrimaryWeapon(weaponid))
{
PlayerInfo[playerid][pPerm1] = 0;
PlayerInfo[playerid][pAmmo1] = 0;
}
if(IsSecondaryWeapon(weaponid))
{
PlayerInfo[playerid][pPerm2] = 0;
PlayerInfo[playerid][pAmmo2] = 0;
}
SetPlayerWeapons(playerid);
format(msg, sizeof(msg), "You have dropped your %s, ammo: %d, (/pgun) to get it back.", GetWeaponNameEx(weaponid), GetWeaponAmmo(playerid, weaponid));
SCM(playerid, COLOR_GREEN, msg);
format(msg, sizeof(msg), "has dropped his %s on the ground.", GetWeaponNameEx(weaponid));
ActionMessage(playerid,15.0,msg);
return 1;
}