11.04.2014, 23:14
So, im doing some job on the script, but i've got a problem, so, i wanna make a system when u get close to an object and press KEY FIRE u get a attachedobject in your hand, and its all cool for the first object, but when i get to a next one, i can get an object but also it shows me a message that that object is empty right after i picked up an object, with first one its all ok, but with others..awgh.
And also, the second object wont destroy after i got close to a trunk, but with the first one everything is ok.
And also, the second object wont destroy after i got close to a trunk, but with the first one everything is ok.
Код:
if(newkeys & KEY_FIRE) { if(!IsPlayerInAnyVehicle(playerid) && KupiSmece[playerid] == 1) { new Float:Pos[3]; for(new i = 0; i < sizeof(Kontenjer); i++) { GetDynamicObjectPos(Kontenjer[i], Pos[0],Pos[1],Pos[2]); if(IsPlayerInRangeOfPoint(playerid,3.0,Pos[0],Pos[1],Pos[2])) { if(Kontenjer[i] == 999) return SCM(playerid, TOMATO, " (greska) U ovom kontenjeru vise nema smeca !"); if(Ispraznjeno[playerid] == 1) return SCM(playerid, TOMATO, " (greska) Prvo morate da ubacite smece u kontenjer !"); SetPlayerAttachedObject(playerid, 1, 1265, 6, 0.298000, -0.031999, -0.050000, 0.000000, -104.599983, 0.000000, 0.683000, 0.648999, 1.077999, 0, 0); Kontenjer[i] = 999; PokupljenoSmeca[playerid] ++; Ispraznjeno[playerid] = 1; SCMF(playerid, WHITE, " (info) Uspesno ste ubacili smece u vozilo, trenutno ste ispraznili %d od 10 kontenjera !", PokupljenoSmeca); DestroyDynamicMapIcon(KontenjerIkona[i]); } } } if(!IsPlayerInAnyVehicle(playerid) && Ispraznjeno[playerid] == 1) { for(new i = 0; i < sizeof(SmecarVozila); i++) { new Float:Pos[3]; GetVehiclePos(SmecarVozila[i], Pos[0], Pos[1], Pos[2]); if(IsPlayerInRangeOfPoint(playerid, 2.0, Pos[0]+5, Pos[1], Pos[2])) { Ispraznjeno[playerid] = 0; if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1); SCM(playerid, MAROON, " (info) Uspesno ste ubacili vrecu za smece u vozilo, molimo nastavite dalje !"); } } } }