Guest User

Untitled

a guest
Oct 9th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. forward ActorCreated(playerid,actoridd); // bei Login
  2. public ActorCreated(playerid,actoridd)
  3. {
  4. printf("PlayerID %d erstellte actor ID %d",playerid,actorid);
  5. return 1;
  6. }
  7.  
  8. forward OnShopsLoad();
  9. public OnShopsLoad()
  10. {
  11. new num_rows;
  12. cache_get_row_count(num_rows);
  13. if(!num_rows)return 1;
  14. for(new i; i<num_rows; i++)
  15. {
  16. new id=getFreeShopID();
  17. cache_get_value_name_int(i, "shopid", ShopInfo[id][shopid]);
  18. cache_get_value_name_float(i, "h_enterx", ShopInfo[id][h_enterx]);
  19. cache_get_value_name_float(i, "h_entery", ShopInfo[id][h_entery]);
  20. cache_get_value_name_float(i, "h_enterz", ShopInfo[id][h_enterz]);
  21. cache_get_value_name_float(i, "h_exitx", ShopInfo[id][h_exitx]);
  22. cache_get_value_name_float(i, "h_exity", ShopInfo[id][h_exity]);
  23. cache_get_value_name_float(i, "h_exitz", ShopInfo[id][h_exitz]);
  24. cache_get_value_name_int(i, "robtime", ShopInfo[id][robtime]);
  25. cache_get_value_name_int(i, "owned", ShopInfo[id][owned]);
  26. cache_get_value_name_int(i, "Fee", ShopInfo[id][Fee]);
  27. cache_get_value_name_int(i, "shopkasse", ShopInfo[id][shopkasse]);
  28. cache_get_value_name_int(i, "price", ShopInfo[id][price]);
  29. cache_get_value_name_int(i, "cameras", ShopInfo[id][cameras]);
  30. // cache_get_value_name_int(i, "shopname247", ShopInfo[id][owned]);
  31. cache_get_value_name(i, "shopname247", ShopInfo[id][shopname247], MAX_PLAYER_NAME);
  32. cache_get_value_name_int(i, "interior", ShopInfo[id][interior]);
  33. // cache_get_value_name_int(i, "owned", ShopInfo[id][owned]);
  34. cache_get_value_name(i, "owner", ShopInfo[id][owner], MAX_PLAYER_NAME);
  35. cache_get_value_name(i, "wmessage", ShopInfo[id][wmessage], MAX_PLAYER_NAME);
  36.  
  37.  
  38. cache_get_value_name_float(i, "actorx", ShopInfo[id][actorx]);
  39. cache_get_value_name_float(i, "actory", ShopInfo[id][actory]);
  40. cache_get_value_name_float(i, "actorz", ShopInfo[id][actorz]);
  41. cache_get_value_name_float(i, "actora", ShopInfo[id][actora]);
  42. cache_get_value_name_int(i, "actorskin", ShopInfo[id][actorskin]);
  43. cache_get_value_name_int(i, "actorid", ShopInfo[id][actorid]);
  44. cache_get_value_name_int(i, "actoryes", ShopInfo[id][actoryes]);
  45. updateShop(id);
  46.  
  47. }
  48. return 1;
  49. }
  50.  
  51. updateShop(id) //continue?
  52. {
  53. new string[128];
  54. if(ShopInfo[id][spickup] != -1)
  55. {
  56. DestroyPickup(ShopInfo[id][spickup]);
  57. }
  58. if(ShopInfo[id][stext] != Text3D:-1)
  59. {
  60. Delete3DTextLabel(ShopInfo[id][stext]);
  61. }
  62. if(ShopInfo[id][pdownarrow] != -1)
  63. {
  64. DestroyPickup(ShopInfo[id][pdownarrow]);
  65. }
  66. if(ShopInfo[id][mapicon] != -1)
  67. {
  68. DestroyDynamicMapIcon(ShopInfo[id][mapicon]);
  69. }
  70. if(!strlen(ShopInfo[id][owner]))
  71. {
  72. ShopInfo[id][mapicon] = CreateDynamicMapIcon(ShopInfo[id][h_enterx],ShopInfo[id][h_entery],ShopInfo[id][h_enterz],17,-1,-1,-1,-1,10.0,MAPICON_LOCAL);
  73. ShopInfo[id][spickup]=CreatePickup(1272, 1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], -1); // davor -1
  74. format(string,sizeof(string), "{B18904}24/7 Shop\n{FFFFFF}For Sale\n{FFFFFF}Price: %i$\nShopID: %i\n[/buyshop] to Buy.", ShopInfo[id][price],ShopInfo[id][shopid]);
  75. ShopInfo[id][stext]=Create3DTextLabel(string, -1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], 10, 0, 1);
  76.  
  77. }
  78. else
  79. {
  80. ShopInfo[id][pdownarrow]=CreatePickup(1318, 1, ShopInfo[id][h_exitx], ShopInfo[id][h_exity], ShopInfo[id][h_exitz], ShopInfo[id][shopid]);
  81. ShopInfo[id][mapicon] = CreateDynamicMapIcon(ShopInfo[id][h_enterx],ShopInfo[id][h_entery],ShopInfo[id][h_enterz],17,-1,-1,-1,-1,100.0,MAPICON_LOCAL);
  82.  
  83. ShopInfo[id][spickup]=CreatePickup(1273, 1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], -1);
  84. // ShopInfo[id][spickup]=CreatePickup(1239, 1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], -1);
  85. format(string,sizeof(string), "{B18904}24/7 Shop\n{FFFFFF}Shop-Name: %s\nOwner: %s\nShopID: %i\nPress[F] to Enter.", ShopInfo[id][shopname247],ShopInfo[id][owner],ShopInfo[id][shopid]);
  86. ShopInfo[id][stext]=Create3DTextLabel(string, -1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], 10, 0, 1);
  87.  
  88. if(ShopInfo[id][actoryes] == 0) return 1;
  89. ShopInfo[id][actorid] = CreateDynamicActor(ShopInfo[id][actorid], ShopInfo[id][actorx],ShopInfo[id][actory],ShopInfo[id][actorz],ShopInfo[id][actora], true, 100.0, ShopInfo[id][shopid], -1, -1, 7.0, -1, 0);
  90. }
  91. return 1;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment