Advertisement
unguru2009

Insurance

Mar 1st, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. if(dialogid == 22521)
  2. {
  3. if(response)
  4. {
  5. if(!isnull(inputtext))
  6. {
  7. new points = strval(inputtext);
  8. if(points > 10) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");
  9. if(playerVariables[playerid][pCarSelected] == 1)
  10. {
  11. if(playerVariables[playerid][pInsurance] != 10)
  12. {
  13. SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
  14. return 1;
  15. }
  16. if(points > 0)
  17. {
  18. new bani = playerVariables[playerid][pInsurance]*points;
  19. if(playerVariables[playerid][pMoney] > bani)
  20. {
  21. playerVariables[playerid][pInsurancePoints] += points;
  22. playerVariables[playerid][pMoney] -= bani;
  23. format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
  24. SCM(playerid,COLOR_ATTACK, szMessage);
  25. }
  26. else SCM(playerid, -1,"You don't have enought money.");
  27. }
  28. }
  29. else if(playerVariables[playerid][pCarSelected] == 2)
  30. {
  31. if(playerVariables[playerid][pInsurance] != 10)
  32. {
  33. SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
  34. return 1;
  35. }
  36. if(points > 0)
  37. {
  38. new bani = playerVariables[playerid][pInsurance2]*points;
  39. if(playerVariables[playerid][pMoney] > bani)
  40. {
  41. playerVariables[playerid][pInsurancePoints2] += points;
  42. playerVariables[playerid][pMoney] -= bani;
  43. format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
  44. SCM(playerid,COLOR_ATTACK, szMessage);
  45. }
  46. else SCM(playerid, -1,"You don't have enought money.");
  47. }
  48. }
  49. else if(playerVariables[playerid][pCarSelected] == 3)
  50. {
  51. if(playerVariables[playerid][pInsurance] != 10)
  52. {
  53. SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
  54. return 1;
  55. }
  56. if(points > 0)
  57. {
  58. new bani = playerVariables[playerid][pInsurance3]*points;
  59. if(playerVariables[playerid][pMoney] > bani)
  60. {
  61. playerVariables[playerid][pInsurancePoints3] += points;
  62. playerVariables[playerid][pMoney] -= bani;
  63. format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
  64. SCM(playerid,COLOR_ATTACK, szMessage);
  65. }
  66. else SCM(playerid, -1,"You don't have enought money.");
  67. }
  68. }
  69. else if(playerVariables[playerid][pCarSelected] == 4)
  70. {
  71. if(playerVariables[playerid][pInsurance] != 10)
  72. {
  73. SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
  74. return 1;
  75. }
  76. if(points > 0)
  77. {
  78. new bani = playerVariables[playerid][pInsurance4]*points;
  79. if(playerVariables[playerid][pMoney] > bani)
  80. {
  81. playerVariables[playerid][pInsurancePoints4] += points;
  82. playerVariables[playerid][pMoney] -= bani;
  83. format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
  84. SCM(playerid,COLOR_ATTACK, szMessage);
  85. }
  86. else SCM(playerid, -1,"You don't have enought money.");
  87. }
  88. }
  89. }
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement