Guest User

Untitled

a guest
May 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. new NeonInfo[MAX_VEHICLES][4];
  2.  
  3. public OnVehicleSpawn(vehicleid)
  4. {
  5. DisVehicleNeon(vehicleid);
  6. return 1;
  7. }
  8.  
  9. public OnVehicleDeath(vehicleid, killerid)
  10. {
  11. DisVehicleNeon(vehicleid);
  12. return 1;
  13. }
  14.  
  15. public OnPlayerCommandText(playerid, cmdtext[])
  16. {
  17. if (strcmp("/тюн неон", cmdtext, true, 10) == 0)
  18. {
  19. new neoncol=strtok(cmdtext,idx); // и прочая такая фигня...
  20. if(GetPlayerMoney(playerid)<5000)return SendClientMessage(playerid,COLOR_RED,"Надо $5.000");
  21. if(!neoncolor||neoncolor>6)return SendClientMessage(playerid,COLOR_WHITE,"Цвета неона: 1 - белый, 2 - красный, 3 - синий, 4 - зеленый, 5 - желтый, 6 - розовый");
  22. SetVehicleNeon(GetPlayerVehicleID(playerid),neoncol);
  23. GivePlayerMoney(playerid,-5000);
  24. return 1;
  25. }
  26. return 0;
  27. }
  28.  
  29. stock SetVehicleNeon(vehicleid,color){
  30. new colormodel;
  31. switch(color){
  32. case 1:colormodel = 18652; // белый
  33. case 2:colormodel = 18647; // красный
  34. case 3:colormodel = 18648; // синий
  35. case 4:colormodel = 18649; // зелёный
  36. case 5:colormodel = 18650; // жёлтый
  37. case 6:colormodel = 18651; // розовый
  38. default:{
  39. if(IsVehicleNeon(vehicleid)){
  40. DisVehicleNeon(vehicleid);
  41. return -1;
  42. }else return 0;
  43. }
  44. }
  45. DestroyObject(NeonInfo[vehicleid][0]);
  46. DestroyObject(NeonInfo[vehicleid][1]);
  47. DestroyObject(NeonInfo[vehicleid][2]);
  48. DestroyObject(NeonInfo[vehicleid][3]);
  49. NeonInfo[vehicleid][0] = CreateObject(colormodel,0,0,0,0,0,0,200);
  50. NeonInfo[vehicleid][1] = CreateObject(colormodel,0,0,0,0,0,0,200);
  51. NeonInfo[vehicleid][2] = CreateObject(colormodel,0,0,0,0,0,0,200);
  52. NeonInfo[vehicleid][3] = CreateObject(colormodel,0,0,0,0,0,0,200);
  53. AttachObjectToVehicle(NeonInfo[vehicleid][0],vehicleid, 1,0.1,-0.5,0,0,0);
  54. AttachObjectToVehicle(NeonInfo[vehicleid][1],vehicleid,-1,0.1,-0.5,0,0,0);
  55. AttachObjectToVehicle(NeonInfo[vehicleid][2],vehicleid, 0, 2.1,-0.5,0,0,90);
  56. AttachObjectToVehicle(NeonInfo[vehicleid][3],vehicleid, 0,-2.1,-0.5,0,0,90);
  57. return 1;
  58. }
  59.  
  60. stock DisVehicleNeon(vehicleid){
  61. DestroyObject(NeonInfo[vehicleid][0]);
  62. DestroyObject(NeonInfo[vehicleid][1]);
  63. DestroyObject(NeonInfo[vehicleid][2]);
  64. DestroyObject(NeonInfo[vehicleid][3]);
  65. NeonInfo[vehicleid][0] = -1;
  66. NeonInfo[vehicleid][1] = -1;
  67. NeonInfo[vehicleid][2] = -1;
  68. NeonInfo[vehicleid][3] = -1;
  69. return true;
  70. }
  71.  
  72. // by RAIDER | Skype: ru.raider
Add Comment
Please, Sign In to add comment