if(newkeys & KEY_WALK) { for(new i; i < sizeof(ObjectInv); i++) { if(IsPlayerInRangeOfPoint(playerid, 2.0,ObjectInv[i][obiDropPos][0],ObjectInv[i][obiDropPos][1],ObjectInv[i][obiDropPos][2])) { GiveInv(playerid, ObjectInv[i][obiDrop][0], ObjectInv[i][obiDrop][1]); DestroyObject(ObjectInv[i][obiObject]); ObjectInv[i][obiDrop][0] = 0; ObjectInv[i][obiDrop][1] = 0; ObjectInv[i][obiDropPos][0] = 0.0; ObjectInv[i][obiDropPos][1] = 0.0; ObjectInv[i][obiDropPos][2] = 0.0; return 1; } } }
stock InvDrop(playerid) { new Float:InvX; new Float:InvY; new Float:InvZ; GetPlayerPos(playerid,InvX ,InvY, InvZ); for(new i; i < sizeof(ObjectInv); i++) { ObjectInv[i][obiDrop][0] = PlayerInfo[playerid][pInvSlot][GetPVarInt(playerid,"SelectSlot")]; ObjectInv[i][obiDrop][1] = PlayerInfo[playerid][pInvKol][GetPVarInt(playerid,"SelectSlot")]; ObjectInv[i][obiDropPos][0] = InvX; ObjectInv[i][obiDropPos][1] = InvY; ObjectInv[i][obiDropPos][2] = InvZ; ObjectInv[i][obiObject] = CreateObject(Items_All[PlayerInfo[playerid][pInvSlot][GetPVarInt(playerid,"SelectSlot")]][InvObject], ObjectInv[i][obiDropPos][0], ObjectInv[i][obiDropPos][1], ObjectInv[i][obiDropPos][2]-1, 80.0, 0.0, 0.0); PlayerTextDrawBackgroundColor(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], -2139062017); PlayerTextDrawSetPreviewModel(playerid,InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], 1649); PlayerTextDrawSetPreviewRot(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], 0.000000, 0.000000, 90.000000, 2.000000); PlayerTextDrawShow(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")]); PlayerInfo[playerid][pInvSlot][GetPVarInt(playerid,"SelectSlot")] = -1; PlayerInfo[playerid][pInvKol][GetPVarInt(playerid,"SelectSlot")] = -1; SetPVarInt(playerid, "SelectSlot", -1); SetPVarInt(playerid, "NewSelectSlot", -1); } return 1; }
for(new i; i < sizeof(ObjectInv); i++) { if(IsPlayerInRangeOfPoint(playerid, 2.0,ObjectInv[i][obiDropPos][0],ObjectInv[i][obiDropPos][1],ObjectInv[i][obiDropPos][2])) { GiveInv(playerid, ObjectInv[i][obiDrop][0], ObjectInv[i][obiDrop][1]); DestroyObject(ObjectInv[i][obiObject]); ObjectInv[i][obiDrop][0] = 0; ObjectInv[i][obiDrop][1] = 0; ObjectInv[i][obiDropPos][0] = 0.0; ObjectInv[i][obiDropPos][1] = 0.0; ObjectInv[i][obiDropPos][2] = 0.0; } return 1; }
так?
Код:
for(new i; i < sizeof(ObjectInv); i++) { if(IsPlayerInRangeOfPoint(playerid, 2.0,ObjectInv[i][obiDropPos][0],ObjectInv[i][obiDropPos][1],ObjectInv[i][obiDropPos][2])) { GiveInv(playerid, ObjectInv[i][obiDrop][0], ObjectInv[i][obiDrop][1]); DestroyObject(ObjectInv[i][obiObject]); ObjectInv[i][obiDrop][0] = 0; ObjectInv[i][obiDrop][1] = 0; ObjectInv[i][obiDropPos][0] = 0.0; ObjectInv[i][obiDropPos][1] = 0.0; ObjectInv[i][obiDropPos][2] = 0.0; } return 1; } |
ага, но что-то мне подсказывает что и правильный ретурн здесь погоду особо не исправит
|
for(new i; i < sizeof(ObjectInv); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0,ObjectInv[i][obiDropPos][0],ObjectInv[i][obiDropPos][1],ObjectInv[i][obiDropPos][2]))
{
GiveInv(playerid, ObjectInv[i][obiDrop][0], ObjectInv[i][obiDrop][1]);
DestroyObject(ObjectInv[i][obiObject]);
ObjectInv[i][obiDrop][0] = 0;
ObjectInv[i][obiDrop][1] = 0;
ObjectInv[i][obiDropPos][0] = 0.0;
ObjectInv[i][obiDropPos][1] = 0.0;
ObjectInv[i][obiDropPos][2] = 0.0;
}
}
return 1;
Не слушай его.
Вот так, за пределами цикла: pawn Код:
|
Не слушай его.
Вот так, за пределами цикла: pawn Код:
|