pickgun command help
#1

Hello,
When i /pickgun from the ground, i take the gun but the object keeps in the ground, also there is
pawn Код:
DestroyObject(dGunData[f][ObjID]);
but its the same problem
Any help?
pawn Код:
CMD:pickgun(playerid, params[])
{
    if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
    new f = MAX_OBJ+1;
    for(new a = 0; a < MAX_OBJ; a++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, dGunData[a][ObjPos][0], dGunData[a][ObjPos][1], dGunData[a][ObjPos][2]))
        {
            f = a;
            break;
        }
    }
    if(f > MAX_OBJ) return SendClientMessage(playerid, COLOR_GREY, "You are not near the weapon which you can pick up.");
    GiveZaiatWeapon(playerid, dGunData[f][ObjData][0], dGunData[f][ObjData][1]);
    DestroyObject(dGunData[f][ObjID]);
    dGunData[f][ObjPos][0] = 0.0;
    dGunData[f][ObjPos][1] = 0.0;
    dGunData[f][ObjPos][2] = 0.0;
    dGunData[f][ObjID] = -1;
    //dGunData[f][ObjData][0] = 0;
    dGunData[f][ObjData][1] = 0;
    new string[128];
    format(string, sizeof(string), "* %s took a gun from the ground", RPN(playerid), GunNames[dGunData[f][ObjData][0]]);
    if(PlayerInfo[playerid][pMaskOn] == 1)
    {
        format(string, sizeof(string), "* Stranger took a gun from the ground", GunNames[dGunData[f][ObjData][0]]);
    }
    else
    {
        format(string, sizeof(string), "* %s took a gun from the ground", RPN(playerid), GunNames[dGunData[f][ObjData][0]]);
    }
    SendNearbyMessage(playerid, 15, string, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE);
    return 1;
}
Reply
#2

Aren't you using a streamer? If you are, replace :
Код:
DestroyObject(dGunData[f][ObjID]);
with:
Код:
DestroyDynamicObject(dGunData[f][ObjID]);
Reply
#3

Quote:
Originally Posted by Aly
Посмотреть сообщение
Aren't you using a streamer? If you are, replace :
Код:
DestroyObject(dGunData[f][ObjID]);
with:
Код:
DestroyDynamicObject(dGunData[f][ObjID]);
Thanks thanks! +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)