21.02.2013, 00:41
I can still pick it up etc, it's just not creating the object.
pawn Код:
CMD:dropgun(playerid, params[])
{
new Float:x,Float:y,Float:z, string[128];
new GunID = GetPlayerWeapon(playerid);
new GunAmmo = GetPlayerAmmo(playerid);
if(GunID < 1) return SendClientMessage(playerid, COLOUR_GREY, "You do not have any weapons to drop.");
GetPlayerPos(playerid, x, y, z);
RemovePlayerWeapon(playerid, GunID);
DropGun(playerid, GunID,GunAmmo,x,y,z,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
format(string, sizeof(string), "* %s has dropped their weapon.", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
return 1;
}
pawn Код:
stock DropGun(playerid, GunID, GunAmmo, Float:x, Float:y, Float:z, world, interior)
{
if(GunID != 0 && GunAmmo != 0)
{
for(new i = 1; i < MAX_DROP_ITEMS; i++)
{
if(DropGunX[i] == 0.0 && DropGunY[i] == 0.0 && DropGunZ[i] == 0.0)
{
DropGunID[i] = GunID;
DropGunAmmo[i] = GunAmmo;
DropGunX[i] = x;
DropGunY[i] = y;
DropGunZ[i] = z;
DropGunVW[i] = world;
DropGunInterior[i] = interior;
//DropObject[i] = CreateDynamicObject(GetGunObjectID(GunID), x, y, z, 80.0, 0.0, 0.0, world, interior, INVALID_PLAYER_ID, 200.0);
DropObject[i] = CreateObject(GetGunObjectID(GunID),x,y,z, 0.0,0.0,0.0);
printf("GunObjectID: %d", GetGunObjectID(GunID));
}
}
}
return 1;
}