Advertisement
Guest User

Аренда велосипедов

a guest
May 4th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. --------------------- [ ВНИМАНИЕ ] ---------------------
  2.  
  3. PlayerInfo[playerid][pCash]/PlayerInfo[playerid][pName] - Заменить на свои переменные игрока
  4. 2229.8323,-1735.4303,21.9800,331.8725 - Заменить координаты где будет спавниться велосипед
  5. --------------------- [ ВНИМАНИЕ ] ---------------------
  6. //В начало мода | P.s Вставит после инклудов
  7. #define SCM SendClientMessage
  8. #define SPD ShowPlayerDialog
  9. #define white 0xFFFFFFFF
  10. #define cserver #FF9900
  11.  
  12. //Объявим переменную для динамического чекпоинта
  13. new ArendaPoint[MAX_PLAYERS];
  14.  
  15. //Переходим в OnGamemodeInit и вставим это:
  16. for(new i=0; i<MAX_PLAYERS; i++)
  17. {
  18. ArendaPoint[i] = CreateDynamicCP(2235.0520,-1731.2727,21.9800, 1.0, 0, 0, i, 15.0); // Аренда велосипеда
  19. }
  20. /*
  21. - 2235.0520,-1731.2727,21.9800 - Координаты где будет появляться checkpoint
  22. - 1.0 - Размер checkpoint'a
  23. - 0, 0 | 0 - Virtual World | 0 - Interior
  24. - i - Переменная игрока
  25. - 15.0 - Радиус появления checkpoint'a*/
  26.  
  27. //Перейдем в OnVehivleSpawn и в OnVehicleDeath
  28. //Вставим данный код
  29.  
  30. foreach(new i: Player)
  31. {
  32. if(GetPVarInt(i, #arenda_took) == vehicleid && GetPVarInt(i, #arenda_took) && GetPVarInt(i, #check_arenda_moped))
  33. {
  34. DestroyVehicle(vehicleid);
  35. DeletePVar(i, #arenda_took);
  36. DeletePVar(i, #check_arenda_moped);
  37. Delete3DTextLabel(vehicle3Dtext);
  38. SCM(i,white,"{"cserver"}[Информация]{FFFFFF} : Ваш арендованный мопед был удален!");
  39. break;
  40. }
  41. }
  42. /*- DestroyVehicle | Удаление автомобиля
  43. - Delete3DTextLabel | Удаление 3D Текст над автомобилем*/
  44. //Перейдем в public OnDialogResponse
  45. //Вставим данные действие диалога:
  46. case 200:// Аренда велосипеда
  47. {
  48. if(response)
  49. {
  50. if(GetPVarInt(playerid, "arenda_took") != 0) return SCM(playerid, white, "{FF0033}[Ошибка] {ffffff}Вы уже арендовали свой велосипед");
  51. if(GetPVarInt(playerid, "check_arenda_moped")) return 1;
  52. PlayerInfo[playerid][pCash] -= 150;
  53. SetPVarInt(playerid, "arenda_took", CreateVehicle(510, 2229.8323,-1735.4303,21.9800,331.8725, 1,1, 300));
  54. SetPVarInt(playerid, "check_arenda_moped",1); // vehicle3Dtext
  55. format(string, sizeof(string), "Арендован: %s", PlayerInfo[playerid][pName]);
  56. vehicle3Dtext = Create3DTextLabel(string, orange, 00.0, 00.0, -557.77, 5.0, 0, 1);
  57. Attach3DTextLabelToVehicle(vehicle3Dtext, GetPVarInt(playerid, "arenda_took"), 0.0, 0.0, 0.3);
  58. return SCM(playerid,white,"{FFA500}[Информация]{FFFFFF} : Вы успешно арендовали велосипед!");
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement