Pessoal Criei este mйtodo para que dependendo do dano do carro ele perca velocidade mas na hora de compilar ele da erro? segui os exemplos do SAMP WIKI, o que tem de errado?
Код:
59 public AtualizaEstadoCarro(vehicleid)
60 {
61 new Float:health;
62 new floatcmp()vhealth;
63 new panels, doors,lights, tires;
64 vhealth = GetVehicleHealth(vehicleid, health);
65 GetVehicleDamageStatus(vehicleid,panels, doors,lights, tires);
66 new DanoPorcentagem[256];
67 format(DanoPorcentagem, sizeof(DanoPorcentagem),"%.2f\%%", health / 1000 * 100);
68 new stringDano[256];
69 format(stringDano, sizeof(stringDano), "Dano:%.2f\%%", health / 1000 * 100);
70
71 TextDrawSetString(Textdraw0, stringDano);
72
73 if (vhealth >= 899 && vhealth =< 1000)
74 {
75 format(stringDano, sizeof(stringDano), "Dano:%.2f\%%", health / 1000 * 100);
76 TextDrawColor(Textdraw0, 1)
77 TextDrawSetString(Textdraw0, stringDano);
78 }
79 else if (vhealth >= 699 && vhealth =< 899)
80 {
81 format(stringDano, sizeof(stringDano), "Dano:%.2f\%%", health / 1000 * 100);
82 TextDrawColor(Textdraw0, 1)
83 TextDrawSetString(Textdraw0, stringDano);
84 }
85 else if (vhealth >= 499 && vhealth =< 699)
86 {
87 format(stringDano, sizeof(stringDano), "Dano:%.2f\%%", health / 1000 * 100);
88 TextDrawColor(Textdraw0, 1)
89 TextDrawSetString(Textdraw0, stringDano);
90 new vSpeed;
91 vSpeed = GetSpeed(vehicleid, 1);
92 if (vSpeed > 86)
93 {
94 SetVehicleSpeed(vehicledid, 85, 1);
95 }
96 }
97 else if (vhealth >= 399 && vhealth =< 499)
98 {
99 format(stringDano, sizeof(stringDano), "Dano:%.2f\%%", health / 1000 * 100);
100 TextDrawColor(Textdraw0, 1)
101 TextDrawSetString(Textdraw0, stringDano);
102 new vSpeed;
103 vSpeed = GetSpeed(vehicleid, 1);
104 if (vSpeed > 51)
105 {
106 SetVehicleSpeed(vehicledid, 50, 1);
107 }
108 }
109 else if ( vhealth >= 299 && vhealth =< 399)
110 {
111 format(stringDano, sizeof(stringDano), "Dano:%.2f\%%", health / 1000 * 100);
112 TextDrawColor(Textdraw0, 1)
113 TextDrawSetString(Textdraw0, stringDano);
114 new vSpeed;
115 vSpeed = GetSpeed(vehicleid, 1);
116 if (vSpeed > 46)
117 {
118
119 SetVehicleSpeed(vehicledid, 45, 1);
120 }
121 }
122 else if (vhealth >= 199 && vhealth =< 299)
123 {
124 format(stringDano, sizeof(stringDano), "Dano:%.2f\%%", health / 1000 * 100);
125 TextDrawColor(Textdraw0, 1)
126 TextDrawSetString(Textdraw0, stringDano);
127 new vSpeed;
128 vSpeed = GetSpeed(vehicleid, 1);
129 if (vSpeed > 21)
130 {
131 SetVehicleSpeed(vehicledid, 20, 1);
132 }
133 }
134 else if (vhealth =< 199)
135 {
136 format(stringDano, sizeof(stringDano), "Dano:%.2f\%%", health / 1000 * 100);
137 TextDrawColor(Textdraw0, 1)
138 TextDrawSetString(Textdraw0, stringDano);
139 new vSpeed;
140 vSpeed = GetSpeed(vehicleid, 1);
141 if (vSpeed > 1)
142 {
143 SetVehicleSpeed(vehicledid, 0, 1);
144 }
145 }
146}