Advertisement
Guest User

/sellcarto

a guest
Nov 18th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. CMD:sellcarto(playerid, params[])
  2. {
  3. if(LogatPin[playerid] == 0) return SCM(playerid, -1, "Contul tau este {ff0000}blocat{ffffff}, foloseste {ff0000}/pin{ffffff} pentru a-l debloca");
  4. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  5. if(PlayerInfo[playerid][pPcarkey] == 0 && PlayerInfo[playerid][pmotokey] == 0 && PlayerInfo[playerid][phelikey] == 0 && PlayerInfo[playerid][pprcarkey] == 0 && PlayerInfo[playerid][pprcarkey2] == 0 && PlayerInfo[playerid][pPPluscarkey] == 0 && PlayerInfo[playerid][pPPluscarkey2] == 0) return SendClientMessage(playerid,COLOR_WHITE,"{FFB870}You do not have a vehicle.");
  6. new id,price,sendername[30],giveplayer[30],VehI = OwnedVeh(GetPlayerVehicleID(playerid)),other[128];
  7. if(sscanf(params, "uiS(NULL)", id,price,other)) return SCM(playerid,COLOR_WHITE,"{00FFFF}Syntax: {ffffff}/sellcarto <Name/Playerid> <price>");
  8. if(strcmp(other, "NULL", true)) return SCM(playerid,COLOR_WHITE,"Nu folosi spatii in pret.");
  9. if(id == playerid) return SendClientMessage(playerid,COLOR_WHITE,"Nu iti poti vinde masina singur.");
  10. if(price < 1 || price > 500000000) return SendClientMessage(playerid, COLOR_GREY, "{FFB870}Price not lower then 1 and not higher then $500,000,000.");
  11. new vid = GetPlayerVehicleID(playerid);
  12. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Nu esti in masina personala.");
  13. if(vid != personalcar[0][playerid] && vid != personalcar[1][playerid] && vid != personalcar[2][playerid] && vid != personalcar[3][playerid] && vid != personalcar[4][playerid] && vid != personalcar[5][playerid]) return SendClientMessage(playerid, COLOR_WHITE, "Nu esti in masina personala.");
  14. if(GetPlayerCash(id) < price) return SCM(playerid,COLOR_WHITE,"{FFB870}This player don't have money needed.");
  15. if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You don't have level 3.");
  16. if(PlayerInfo[id][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}That player doesn't have level 3.");
  17. if(VehI != PlayerInfo[playerid][pPcarkey] && VehI != PlayerInfo[playerid][pmotokey] && VehI != PlayerInfo[playerid][pprcarkey] && VehI != PlayerInfo[playerid][pprcarkey2] && VehI != PlayerInfo[playerid][pPPluscarkey] && VehI != PlayerInfo[playerid][pPPluscarkey2])
  18. return SendClientMessage(playerid, COLOR_WHITE, "This is not your car.");
  19. GetPlayerName(playerid, sendername, sizeof(sendername));
  20. GetPlayerName(id, giveplayer, sizeof(giveplayer));
  21. if(IsPlayerConnected(id))
  22. {
  23. if(IsPlayerInRangeOfPlayer(playerid, id, 5.0))
  24. {
  25. new vehh = GetPlayerVehicleID(playerid),string[256];
  26. if(vehh == personalcar[0][playerid])
  27. {
  28. primesccar[id] = 1;
  29. CarID[id] = OwnedVeh(personalcar[0][playerid]);
  30. }
  31. if(vehh == personalcar[1][playerid])
  32. {
  33. primesccar[id] = 2;
  34. CarID[id] = OwnedVeh(personalcar[1][playerid]);
  35. }
  36. if(vehh == personalcar[2][playerid])
  37. {
  38. primesccar[id] = 3;
  39. CarID[id] = OwnedVeh(personalcar[2][playerid]);
  40. }
  41. if(vehh == personalcar[3][playerid])
  42. {
  43. primesccar[id] = 4;
  44. CarID[id] = OwnedVeh(personalcar[3][playerid]);
  45. }
  46. if(vehh == personalcar[4][playerid])
  47. {
  48. primesccar[id] = 5;
  49. CarID[id] = OwnedVeh(personalcar[4][playerid]);
  50. }
  51. if(vehh == personalcar[5][playerid])
  52. {
  53. primesccar[id] = 6;
  54. CarID[id] = OwnedVeh(personalcar[5][playerid]);
  55. }
  56. new vehhh = OwnedVeh(GetPlayerVehicleID(playerid));
  57. if(vehhh == PlayerInfo[playerid][pPcarkey])
  58. {
  59. cartype[id] = 1;
  60. }
  61. if(vehhh == PlayerInfo[playerid][pmotokey])
  62. {
  63. cartype[id] = 2;
  64. }
  65. if(vehhh == PlayerInfo[playerid][pprcarkey])
  66. {
  67. cartype[id] = 3;
  68. }
  69. if(vehhh == PlayerInfo[playerid][pprcarkey2])
  70. {
  71. cartype[id] = 4;
  72. }
  73. if(vehhh == PlayerInfo[playerid][pPPluscarkey])
  74. {
  75. cartype[id] = 5;
  76. }
  77. if(vehhh == PlayerInfo[playerid][pPPluscarkey2])
  78. {
  79. cartype[id] = 6;
  80. }
  81. ofercar[id] = playerid;
  82. carprice[id] = price;
  83. format(string, sizeof(string), "* You have offered your car(%s) to %s(%d) for $%s.", CarInfo[vehhh][cDescription],giveplayer,id,FormatNumber(price));
  84. SendClientMessage(playerid, COLOR_GREEN, string);
  85. format(string, sizeof(string), "* %s offered his car(%s) to you for $%s (type /accept car %d) to buy.", sendername, CarInfo[vehhh][cDescription], FormatNumber(price),playerid);
  86. SendClientMessage(id, COLOR_GREEN, string);
  87. }
  88. else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Player is not near you.");
  89. }
  90. return 1;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement