CreateDynamicObject issue (I Think).
#1

Hi, basically the only issue is that the object doesn't get created and I don't know why.

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);
                printf("GunObjectID: %d", GetGunObjectID(GunID));
                return 1;
            }
        }
        return 1;
    }
    return 1;
}
Everything works, I can go and pick it up etc, There is just no object. I've updated to the latest streamer, provided by Incognito, 0.3x version and I've even updated the include file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)