Martex

ADD stock

May 6th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. stock AddProperty(const name[], Float:X, Float:Y, Float:Z, price, sell)
  2. {
  3. PropertyCount++;
  4. new ID = PropertyCount;
  5. if(!strlen(name))
  6. {
  7. print("====================================================");
  8. printf("Property Error: You forgot to give property #%d a name!", ID);
  9. print(" This property will not be created ");
  10. print("====================================================");
  11. return 1;
  12. }
  13. if(price < 0)
  14. {
  15. print("=============================================================");
  16. print("Property Error: You cant give a property a price lower than 0");
  17. printf(" Property #%d will not be created ", ID);
  18. print("=============================================================");
  19. return 1;
  20. }
  21. if(sell < 0)
  22. {
  23. print("===============================================================");
  24. print("Property Error: You cant give players less than $0 when selling");
  25. printf(" Property #%d will not be created ", ID);
  26. print("===============================================================");
  27. return 1;
  28. }
  29.  
  30. PropInfo[ID][PropExists] = 1;
  31. format(PropInfo[ID][PropName], 60, "%s", name);
  32. PropInfo[ID][PropX] = X;
  33. PropInfo[ID][PropY] = Y;
  34. PropInfo[ID][PropZ] = Z;
  35. PropInfo[ID][PropPrice] = price;
  36. PropInfo[ID][PropSell] = sell;
  37. PropInfo[ID][PropOwner] = -1;
  38. PropertyPickup[ID] = CreatePickup(1273, 1, X, Y, Z);
  39. return ID;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment