Buenas, quisiera que me ayudasen en una cosa, veran, estoy haciendo un sistema de inventario, el cual puedes recoger cosas del piso, y al recoger va todo bien y demбs, la cosa es que no sй como hacer cuando el usuario preciona para tirar el objeto, їcomo vuelvo a re-crear el objeto que el usuario quiere tirar?, miren, asн tengo el de recoger las cosas:
pawn Код:
Pizza[0] = CreateDynamicObject(2814, 1742.993041, 2180.665283, 9.869498, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[1] = CreateDynamicObject(2814, 2353.307128, 2530.265380, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[2] = CreateDynamicObject(2814, 1940.785522, 2220.103759, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[3] = CreateDynamicObject(2814, 2874.058105, 2431.966064, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[4] = CreateDynamicObject(2814, 2822.558837, 2031.998657, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[5] = CreateDynamicObject(2814, 2540.867919, 2148.627685, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[6] = CreateDynamicObject(2814, 2463.142089, 2125.902587, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[7] = CreateDynamicObject(2814, 2451.086669, 2162.179443, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[8] = CreateDynamicObject(2814, 2082.915039, 2223.884521, 10.023437, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[9] = CreateDynamicObject(2814, -1519.313476, 2663.857910, 54.835937, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[10] = CreateDynamicObject(2814, 2054.458984, 2291.217041, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[11] = CreateDynamicObject(2814, 2809.353271, 1260.813964, 9.750000, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[12] = CreateDynamicObject(2814, 2235.641845, 2476.580322, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[13] = CreateDynamicObject(2814, 2270.417480, 2289.946044, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[14] = CreateDynamicObject(2814, 2166.024658, 2517.477050, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[15] = CreateDynamicObject(2814, -1532.940551, 2637.338378, 54.835937, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[16] = CreateDynamicObject(2814, 426.267608, 2531.151367, 15.618061, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[17] = CreateDynamicObject(2814, 423.491638, 2532.059082, 15.599662, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[18] = CreateDynamicObject(2814, 634.489929, 1249.137817, 10.682721, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[19] = CreateDynamicObject(2814, 43.465415, 1218.212402, 18.042713, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[20] = CreateDynamicObject(2814, 346.454650, 1392.000366, 5.857777, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[21] = CreateDynamicObject(2814, 499.432434, 1582.404541, 0.000000, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[22] = CreateDynamicObject(2814, 645.691833, 1680.938232, 6.187500, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[23] = CreateDynamicObject(2814, 118.020751, 1471.338623, 9.624464, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[24] = CreateDynamicObject(2814, 2157.224365, 747.162536, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[25] = CreateDynamicObject(2814, 316.760498, 1146.964477, 7.585937, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[26] = CreateDynamicObject(2814, 2350.437011, 2569.720947, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[27] = CreateDynamicObject(2814, 2043.253662, 733.550231, 10.460937, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[28] = CreateDynamicObject(2814, 2153.443359, 2580.195312, 5.602724, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[29] = CreateDynamicObject(2814, 1622.363159, 688.237731, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[30] = CreateDynamicObject(2814, 2334.336425, 2195.913574, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[31] = CreateDynamicObject(2814, 1264.885375, 738.318786, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[32] = CreateDynamicObject(2814, 2394.756591, 2687.858886, 9.939416, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[33] = CreateDynamicObject(2814, 1265.488647, 2608.064941, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[34] = CreateDynamicObject(2814, 1679.602783, 690.171569, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[35] = CreateDynamicObject(2814, 1588.134277, 2578.120605, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[36] = CreateDynamicObject(2814, 1604.115112, 720.901672, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[37] = CreateDynamicObject(2814, 2768.524169, 1274.744506, 9.750000, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[38] = CreateDynamicObject(2814, 1872.045043, 2645.199462, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[39] = CreateDynamicObject(2814, 1866.547485, 1636.182006, 8.856616, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[40] = CreateDynamicObject(2814, 2120.802978, 1784.140991, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
Pizza[41] = CreateDynamicObject(2814, 2349.930175, 2531.777587, 9.820312, 0.000000, 0.000000, 0.000000, -1, -1, -1, 500.0, 0.0);
else if(PRESSED(KEY_NO) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
new Float:Pos[3];
for(new i = 0; i < sizeof(Pizza); i++)
{
GetDynamicObjectPos(Pizza[i], Pos[0], Pos[1], Pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 1.0, Pos[0], Pos[1], Pos[2]+1))
{
if(IsValidDynamicObject(Pizza[i]))
{
ActualizarInventario(playerid, 0);
DestroyDynamicObject(Pizza[i]);
break;
}
}
}
}