Guest User

Untitled

a guest
Nov 29th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. CMD:addentradahouse(playerid, params[])
  2. {
  3. if(Player[playerid][pAdmin] < 7)
  4. return SendClientMessage(playerid, COLOR_RED, "[ERRO] Você não tem permissão para usar este comando!");
  5. new idx;
  6. new tmp[24]; tmp = strtok(params, idx);
  7. if(!strlen(tmp))
  8. return SendClientMessage(playerid, COLOR_GREY, "[USO] /addentradacasa [houseid] - Move a casa até você.");
  9.  
  10. new h = strval(tmp);
  11. if(h > sizeof(HouseInfo) || h < 0)
  12. return SendClientMessage(playerid,COLOR_RED, "[ERRO] O ID da casa deve ser de 0 à 64.");
  13.  
  14. new Float:X,Float:Y,Float:Z;
  15. GetPlayerPos(playerid,X,Y,Z);
  16. format(thestring,sizeof(thestring)," %s mudou a entrada da casa %d para %f - %f - %f",Player[playerid][pName],h,X,Y,Z);
  17. WriteLog("rpedits", thestring);
  18. ABroadCast(COLOR_YELLOW,thestring,5);
  19. HouseInfo[h][hEntrancex] = X;
  20. HouseInfo[h][hEntrancey] = Y;
  21. HouseInfo[h][hEntrancez] = Z;
  22. DestroyDynamicPickup(HouseInfo[h][hIcon]);
  23. Delete3DTextLabel(HouseInfo[h][HouseLabel]);
  24. if(HouseInfo[h][hOwned] == 1)
  25. {
  26. HouseInfo[h][hIcon] = CreateDynamicPickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
  27. pickups++;
  28. if(HouseInfo[h][hRentabil] == 0)
  29. format(thestring, sizeof(thestring), "Proprietário da casa: %s \nLevel : %d",hOwner[h],HouseInfo[h][hLevel]);
  30. else
  31. format(thestring, sizeof(thestring), "Proprietário da casa: %s \nAluguel: R$ %d - Level : %d \nDigite /alugarcasa para alugar um quarto",hOwner[h],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
  32.  
  33. HouseInfo[h][HouseLabel] = Create3DTextLabel(thestring ,COLOR_WHITE, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1.0,30.0,0);
  34. }
  35. if(HouseInfo[h][hOwned] == 0)
  36. {
  37. HouseInfo[h][hIcon] = CreateDynamicPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
  38. pickups++;
  39. format(thestring, sizeof(thestring), "A casa está a venda \n Descricão: %s \n Preco: R$ %d - Level : %d\n Para comprar digite /comprarcasa",hDiscription[h],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
  40. HouseInfo[h][HouseLabel] = Create3DTextLabel(thestring ,COLOR_WHITE, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1.0,30.0,0);
  41. }
  42. //SaveProperty(h);
  43. OnPropUpdate();
  44. return 1;
  45. }
  46.  
  47. CMD:addspawn(playerid, params[])
  48. {
  49. if(Player[playerid][pAdmin] < 7)
  50. return SendClientMessage(playerid, COLOR_RED, "[ERRO] Você não tem permissão para usar este comando!");
  51. new idx;
  52. new tmp[24]; tmp = strtok(params, idx);
  53. if(!strlen(tmp))
  54. return SendClientMessage(playerid, COLOR_GREY, "[USO] /addspawn [houseid]");
  55.  
  56. new proplev = strval(tmp);
  57. if(proplev > sizeof(HouseInfo) || proplev < 0)
  58. return SendClientMessage(playerid,COLOR_RED, "[ERRO] O ID da casa deve ser de 0 à 91.");
  59. else
  60. {
  61. new Float:X,Float:Y,Float:Z;
  62. GetPlayerPos(playerid,X,Y,Z);
  63. format(thestring,sizeof(thestring),"Spawn da casa %d mudada %f - %f - %f",proplev,X,Y,Z);
  64. ABroadCast(COLOR_YELLOW,thestring,5);
  65. HouseInfo[proplev][hExitx] = X;
  66. HouseInfo[proplev][hExity] = Y;
  67. HouseInfo[proplev][hExitz] = Z;
  68. //SaveProperty(proplev);
  69. OnPropUpdate();
  70. }
  71. return 1;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment