Advertisement
AlfarrHeimrik

Pegar o Item do chão.

Jul 15th, 2024
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | Source Code | 0 0
  1. CMD:pegaritem(playerid)
  2. {
  3. new Float:x, Float:y, Float:z, str[128];
  4. for(new i = 0; i < sizeof(DropItemSlot); i++)
  5. {
  6. GetDynamicObjectPos(DropItemSlot[i][DropItem], x,y,z);
  7. if(DropItemSlot[i][DropItem] != 0)
  8. {
  9. if(IsPlayerInRangeOfPoint(playerid, 1.5, x,y,z+1) && GetPlayerVirtualWorld(playerid) == DropItemSlot[i][Virtual] && GetPlayerInterior(playerid) == DropItemSlot[i][Interior])
  10. {
  11. if(!CheckInventario(playerid, DropItemSlot[i][DropItemID])) return SendClientMessage(playerid, COLOR_VERM, "[!] {FFFFFF}Sua mochila esta cheia.");
  12. GanharItem(playerid, DropItemSlot[i][DropItemID], DropItemSlot[i][DropItemUni]);
  13. format(str, 64, "{C2A2DA}*%s pegou um(a) %s do chao.", pName(playerid), ItemNomeInv(DropItemSlot[i][DropItemID]));
  14. ProxDetectorSilva(playerid, 12.0, 0xD7D7D7FF, str);
  15. DestroyDynamicObject(DropItemSlot[i][DropItem]);
  16. DestroyDynamic3DTextLabel(DropItemSlot[i][LabelItem]);
  17. DropItemSlot[i][DropItem] = 0;
  18. DropItemSlot[i][DropItemID] = -1;
  19. DropItemSlot[i][DropItemUni] = 0;
  20. DropItemSlot[i][Interior] = 0;
  21. DropItemSlot[i][Virtual] = 0;
  22. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 0, 1);
  23. return 1;
  24. }
  25. }
  26. }
  27. return 1;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement