SHOW:
|
|
- or go back to the newest paste.
1 | #include <a_samp> | |
2 | - | #define FILTERSCRIPT |
2 | + | #define FILTERSCRIPT |
3 | - | #define PRESSED(%0) \ |
3 | + | #define PRESSED(%0) \ |
4 | - | (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) |
4 | + | (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) |
5 | ||
6 | - | new Text:TextDrawFlip; |
6 | + | new Text:TextDrawFlip; |
7 | - | new Text:TextDrawRepair; |
7 | + | new Text:TextDrawRepair; |
8 | - | new Text:TextDrawNitro; |
8 | + | new Text:TextDrawNitro; |
9 | - | new Text:TextDrawJump; |
9 | + | new Text:TextDrawJump; |
10 | - | new Text:TextDrawBoost; |
10 | + | new Text:TextDrawBoost; |
11 | ||
12 | - | #define CYAN 0x00FFFFFF |
12 | + | #define CYAN 0x00FFFFFF |
13 | - | #define WHITE 0xFFFFFFAA |
13 | + | #define WHITE 0xFFFFFFAA |
14 | - | #define BLACK 0x000000AA |
14 | + | #define BLACK 0x000000AA |
15 | - | #define RED 0xFF0000AA |
15 | + | #define RED 0xFF0000AA |
16 | - | #define LIGHTRED 0xF95D5DAA |
16 | + | #define LIGHTRED 0xF95D5DAA |
17 | - | #define DARKRED 0x6F0000AA |
17 | + | #define DARKRED 0x6F0000AA |
18 | - | #define GREEN 0x15FF00AA |
18 | + | #define GREEN 0x15FF00AA |
19 | - | #define LIGHTGREEN 0x78FF6CAA |
19 | + | #define LIGHTGREEN 0x78FF6CAA |
20 | - | #define DARKGREEN 0x0C9000AA |
20 | + | #define DARKGREEN 0x0C9000AA |
21 | - | #define YELLOW 0xF2FF00AA |
21 | + | #define YELLOW 0xF2FF00AA |
22 | - | #define DARKYELLOW 0x727800AA |
22 | + | #define DARKYELLOW 0x727800AA |
23 | - | #define LIGHTYELLOW 0xF9FF88AA |
23 | + | #define LIGHTYELLOW 0xF9FF88AA |
24 | - | #define LIGHTBROWN 0xE2B35CAA |
24 | + | #define LIGHTBROWN 0xE2B35CAA |
25 | - | #define DARKBROWN 0x392501AA |
25 | + | #define DARKBROWN 0x392501AA |
26 | - | #define BLUE 0x0015FFAA |
26 | + | #define BLUE 0x0015FFAA |
27 | - | #define LIGHTBLUE 0x515BC7AA |
27 | + | #define LIGHTBLUE 0x515BC7AA |
28 | - | #define DARKBLUE 0x000A7AAA |
28 | + | #define DARKBLUE 0x000A7AAA |
29 | - | #define VERYDARKBLUE 0x010534AA |
29 | + | #define VERYDARKBLUE 0x010534AA |
30 | - | #define PINK 0xFD01FDAA |
30 | + | #define PINK 0xFD01FDAA |
31 | - | #define PURLPLE 0x690069AA |
31 | + | #define PURLPLE 0x690069AA |
32 | - | #define DARKPURPLE 0x3B013BAA |
32 | + | #define DARKPURPLE 0x3B013BAA |
33 | - | #define VERYDARKBLUE 0x010534AA |
33 | + | #define VERYDARKBLUE 0x010534AA |
34 | - | #define NAVY 0x00FBFFAA |
34 | + | #define NAVY 0x00FBFFAA |
35 | - | #define DARKNAVY 0x006566AA |
35 | + | #define DARKNAVY 0x006566AA |
36 | - | #define LIGHTNAVY 0x8FFDFFAA |
36 | + | #define LIGHTNAVY 0x8FFDFFAA |
37 | - | #define ORANGE 0xFFAF02AA |
37 | + | #define ORANGE 0xFFAF02AA |
38 | - | #define DARKORANGE 0x946E1DAA |
38 | + | #define DARKORANGE 0x946E1DAA |
39 | - | #define LIGHTORANGE 0xFECA5BAA |
39 | + | #define LIGHTORANGE 0xFECA5BAA |
40 | - | #define SKYBLUE 0x2685B4AA |
40 | + | #define SKYBLUE 0x2685B4AA |
41 | ||
42 | ||
43 | - | #if defined FILTERSCRIPT |
43 | + | #if defined FILTERSCRIPT |
44 | ||
45 | - | public OnFilterScriptInIt() |
45 | + | public OnFilterScriptInit() |
46 | - | { |
46 | + | { |
47 | ||
48 | - | ///// Textdraws |
48 | + | ///// Textdraws |
49 | - | TextDrawFlip = TextDrawCreate(480 ,108 , "Press caps lock to flip your car"); |
49 | + | TextDrawFlip = TextDrawCreate(480 ,108 , "Press caps lock to flip your car"); |
50 | - | TextDrawFont(TextDrawFlip , 0); |
50 | + | TextDrawFont(TextDrawFlip , 0); |
51 | - | TextDrawLetterSize(TextDrawFlip , 0.35, 1.5); |
51 | + | TextDrawLetterSize(TextDrawFlip , 0.35, 1.5); |
52 | - | TextDrawColor(TextDrawFlip , LIGHTYELLOW); |
52 | + | TextDrawColor(TextDrawFlip , LIGHTYELLOW); |
53 | - | TextDrawSetOutline(TextDrawFlip , true); |
53 | + | TextDrawSetOutline(TextDrawFlip , true); |
54 | - | TextDrawSetProportional(TextDrawFlip , true); |
54 | + | TextDrawSetProportional(TextDrawFlip , true); |
55 | - | TextDrawSetShadow(TextDrawFlip , 1); |
55 | + | TextDrawSetShadow(TextDrawFlip , 1); |
56 | ||
57 | - | TextDrawRepair = TextDrawCreate(28 ,341 , "Press 2 to repair your car"); |
57 | + | TextDrawRepair = TextDrawCreate(28 ,341 , "Press 2 to repair your car"); |
58 | - | TextDrawFont(TextDrawRepair , 0); |
58 | + | TextDrawFont(TextDrawRepair , 0); |
59 | - | TextDrawLetterSize(TextDrawRepair , 0.35, 1.5); |
59 | + | TextDrawLetterSize(TextDrawRepair , 0.35, 1.5); |
60 | - | TextDrawColor(TextDrawRepair , LIGHTYELLOW); |
60 | + | TextDrawColor(TextDrawRepair , LIGHTYELLOW); |
61 | - | TextDrawSetOutline(TextDrawRepair , true); |
61 | + | TextDrawSetOutline(TextDrawRepair , true); |
62 | - | TextDrawSetProportional(TextDrawRepair , true); |
62 | + | TextDrawSetProportional(TextDrawRepair , true); |
63 | - | TextDrawSetShadow(TextDrawRepair , 1); |
63 | + | TextDrawSetShadow(TextDrawRepair , 1); |
64 | ||
65 | - | TextDrawNitro = TextDrawCreate(28 ,317 , "Press FIRE to add NOS"); |
65 | + | TextDrawNitro = TextDrawCreate(28 ,317 , "Press FIRE to add NOS"); |
66 | - | TextDrawFont(TextDrawNitro , 0); |
66 | + | TextDrawFont(TextDrawNitro , 0); |
67 | - | TextDrawLetterSize(TextDrawNitro , 0.35, 1.5); |
67 | + | TextDrawLetterSize(TextDrawNitro , 0.35, 1.5); |
68 | - | TextDrawColor(TextDrawNitro , LIGHTRED); |
68 | + | TextDrawColor(TextDrawNitro , LIGHTRED); |
69 | - | TextDrawSetOutline(TextDrawNitro , true); |
69 | + | TextDrawSetOutline(TextDrawNitro , true); |
70 | - | TextDrawSetProportional(TextDrawNitro , true); |
70 | + | TextDrawSetProportional(TextDrawNitro , true); |
71 | - | TextDrawSetShadow(TextDrawNitro , 1); |
71 | + | TextDrawSetShadow(TextDrawNitro , 1); |
72 | - | |
72 | + | |
73 | ||
74 | - | TextDrawJump = TextDrawCreate(440.000000, 381.000000, "Press Y to hop your car"); |
74 | + | TextDrawJump = TextDrawCreate(440.000000, 381.000000, "Press Y to hop your car"); |
75 | - | TextDrawBackgroundColor(TextDrawJump, 16711935); |
75 | + | TextDrawBackgroundColor(TextDrawJump, 16711935); |
76 | - | TextDrawFont(TextDrawJump, 1); |
76 | + | TextDrawFont(TextDrawJump, 1); |
77 | - | TextDrawLetterSize(TextDrawJump, 0.500000, 1.800000); |
77 | + | TextDrawLetterSize(TextDrawJump, 0.500000, 1.800000); |
78 | - | TextDrawColor(TextDrawJump, 65535); |
78 | + | TextDrawColor(TextDrawJump, 65535); |
79 | - | TextDrawSetOutline(TextDrawJump, 0); |
79 | + | TextDrawSetOutline(TextDrawJump, 0); |
80 | - | TextDrawSetProportional(TextDrawJump, 1); |
80 | + | TextDrawSetProportional(TextDrawJump, 1); |
81 | - | TextDrawSetShadow(TextDrawJump, 1); |
81 | + | TextDrawSetShadow(TextDrawJump, 1); |
82 | ||
83 | - | TextDrawBoost = TextDrawCreate(414.000000, 353.000000, "Press N to use superboost!"); |
83 | + | TextDrawBoost = TextDrawCreate(414.000000, 353.000000, "Press N to use superboost!"); |
84 | - | TextDrawBackgroundColor(TextDrawBoost, 16711935); |
84 | + | TextDrawBackgroundColor(TextDrawBoost, 16711935); |
85 | - | TextDrawFont(TextDrawBoost, 1); |
85 | + | TextDrawFont(TextDrawBoost, 1); |
86 | - | TextDrawLetterSize(TextDrawBoost, 0.500000, 1.800000); |
86 | + | TextDrawLetterSize(TextDrawBoost, 0.500000, 1.800000); |
87 | - | TextDrawColor(TextDrawBoost, 65535); |
87 | + | TextDrawColor(TextDrawBoost, 65535); |
88 | - | TextDrawSetOutline(TextDrawBoost, 0); |
88 | + | TextDrawSetOutline(TextDrawBoost, 0); |
89 | - | TextDrawSetProportional(TextDrawBoost, 1); |
89 | + | TextDrawSetProportional(TextDrawBoost, 1); |
90 | - | TextDrawSetShadow(TextDrawBoost, 1); |
90 | + | TextDrawSetShadow(TextDrawBoost, 1); |
91 | - | |
91 | + | |
92 | - | SetTimer("VehicleAutoRepair", 500, true); |
92 | + | SetTimer("VehicleAutoRepair", 500, true); |
93 | return 1; | |
94 | - | return 0; |
94 | + | } |
95 | - | } |
95 | + | public OnFilterScriptExit() |
96 | { | |
97 | - | public OnFilterScriptExit() |
97 | + | return 0; |
98 | - | { |
98 | + | } |
99 | - | return 0; |
99 | + | |
100 | - | } |
100 | + | #endif |
101 | ||
102 | - | #endif |
102 | + | forward VehicleAutorepair(playerid); |
103 | public VehicleAutorepair(playerid) | |
104 | - | forward VehicleAutorepair(playerid); |
104 | + | { |
105 | - | public VehicleAutorepair(playerid) |
105 | + | if(IsPlayerInAnyVehicle(playerid)) |
106 | - | { |
106 | + | { |
107 | - | if(IsPlayerInAnyVehicle(playerid)) |
107 | + | new Float:health,vehicleid; |
108 | - | { |
108 | + | vehicleid = GetPlayerVehicleID(playerid); |
109 | - | new Float:health,vehicleid; |
109 | + | GetVehicleHealth(vehicleid,health); |
110 | - | vehicleid = GetPlayerVehicleID(playerid); |
110 | + | if(health <350) |
111 | - | GetVehicleHealth(vehicleid,health); |
111 | + | { |
112 | - | if(health <350) |
112 | + | SetVehicleHealth(vehicleid,1000); |
113 | - | { |
113 | + | RepairVehicle(vehicleid); |
114 | - | SetVehicleHealth(vehicleid,1000); |
114 | + | PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); |
115 | - | RepairVehicle(vehicleid); |
115 | + | } |
116 | - | PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); |
116 | + | } |
117 | - | } |
117 | + | } |
118 | - | } |
118 | + | |
119 | - | } |
119 | + | public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) |
120 | { | |
121 | - | public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) |
121 | + | if (PRESSED(KEY_FIRE)) |
122 | - | { |
122 | + | { |
123 | - | if (PRESSED(KEY_FIRE)) |
123 | + | if (IsPlayerInAnyVehicle(playerid)) |
124 | - | { |
124 | + | { |
125 | - | if (IsPlayerInAnyVehicle(playerid)) |
125 | + | AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); |
126 | - | { |
126 | + | } |
127 | - | AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); |
127 | + | } |
128 | - | } |
128 | + | |
129 | - | } |
129 | + | else if(PRESSED(KEY_CROUCH)) |
130 | { | |
131 | - | else if(PRESSED(KEY_CROUCH)) |
131 | + | if(!IsPlayerInAnyVehicle(playerid)) return 0; |
132 | - | { |
132 | + | { |
133 | - | if(!IsPlayerInAnyVehicle(playerid)) return 0; |
133 | + | new Float:zangle; |
134 | - | { |
134 | + | GetVehicleZAngle(GetPlayerVehicleID(playerid),zangle); |
135 | - | new Float:zangle; |
135 | + | SetVehicleZAngle(GetPlayerVehicleID(playerid),zangle); |
136 | - | GetVehicleZAngle(GetPlayerVehicleID(playerid),zangle); |
136 | + | } |
137 | - | SetVehicleZAngle(GetPlayerVehicleID(playerid),zangle); |
137 | + | } |
138 | - | } |
138 | + | |
139 | - | } |
139 | + | else if(PRESSED(KEY_SUBMISSION)) |
140 | { | |
141 | - | else if(PRESSED(KEY_SUBMISSION)) |
141 | + | new vehicleid = GetPlayerVehicleID(playerid); |
142 | - | { |
142 | + | if(IsPlayerInVehicle(playerid, vehicleid)) |
143 | - | new vehicleid = GetPlayerVehicleID(playerid); |
143 | + | { |
144 | - | if(IsPlayerInVehicle(playerid, vehicleid)) |
144 | + | SetVehicleHealth(vehicleid,1000.0); |
145 | - | { |
145 | + | RepairVehicle(GetPlayerVehicleID(playerid)); |
146 | - | SetVehicleHealth(vehicleid,1000.0); |
146 | + | PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); |
147 | - | RepairVehicle(GetPlayerVehicleID(playerid)); |
147 | + | } |
148 | - | PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); |
148 | + | } |
149 | - | } |
149 | + | |
150 | - | } |
150 | + | else if(PRESSED(KEY_YES)) |
151 | - | |
151 | + | { |
152 | - | else if(PRESSED(KEY_YES)) |
152 | + | new vehicleid = GetPlayerVehicleID(playerid); |
153 | - | { |
153 | + | if(IsPlayerInVehicle(playerid, vehicleid)) |
154 | - | new vehicleid = GetPlayerVehicleID(playerid); |
154 | + | { |
155 | - | if(IsPlayerInVehicle(playerid, vehicleid)) |
155 | + | SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.2); |
156 | - | { |
156 | + | } |
157 | - | SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.2); |
157 | + | } |
158 | - | } |
158 | + | |
159 | - | } |
159 | + | else if(PRESSED(KEY_NO)) |
160 | - | |
160 | + | { |
161 | - | else if(PRESSED(KEY_NO)) |
161 | + | new vehicleid = GetPlayerVehicleID(playerid); |
162 | - | { |
162 | + | if(IsPlayerInVehicle(playerid, vehicleid)) |
163 | - | new vehicleid = GetPlayerVehicleID(playerid); |
163 | + | { |
164 | - | if(IsPlayerInVehicle(playerid, vehicleid)) |
164 | + | new Float:vx,Float:vy,Float:vz; |
165 | - | { |
165 | + | GetVehicleVelocity(vehicleid,vx,vy,vz); |
166 | - | new Float:vx,Float:vy,Float:vz; |
166 | + | SetVehicleVelocity(vehicleid, vx * 1.8, vy *1.8, vz * 1.8); |
167 | - | GetVehicleVelocity(vehicleid,vx,vy,vz); |
167 | + | } |
168 | - | SetVehicleVelocity(vehicleid, vx * 1.8, vy *1.8, vz * 1.8); |
168 | + | } |
169 | - | } |
169 | + | return 0; |
170 | - | } |
170 | + | } |
171 | - | return 0; |
171 | + | |
172 | - | } |
172 | + | |
173 | public OnPlayerStateChange(playerid, newstate, oldstate) | |
174 | { | |
175 | - | public OnPlayerStateChange(playerid, newstate, oldstate) |
175 | + | if(newstate == PLAYER_STATE_DRIVER ) |
176 | - | { |
176 | + | { |
177 | - | if(newstate == PLAYER_STATE_DRIVER ) |
177 | + | TextDrawShowForPlayer(playerid, TextDrawFlip); |
178 | - | { |
178 | + | TextDrawShowForPlayer(playerid, TextDrawRepair); |
179 | - | TextDrawShowForPlayer(playerid, TextDrawFlip); |
179 | + | TextDrawShowForPlayer(playerid, TextDrawNitro); |
180 | - | TextDrawShowForPlayer(playerid, TextDrawRepair); |
180 | + | TextDrawShowForPlayer(playerid, TextDrawJump); |
181 | - | TextDrawShowForPlayer(playerid, TextDrawNitro); |
181 | + | TextDrawShowForPlayer(playerid, TextDrawBoost); |
182 | - | } |
182 | + | } |
183 | ||
184 | - | else if(newstate == PLAYER_STATE_ONFOOT) |
184 | + | else if(newstate == PLAYER_STATE_ONFOOT) |
185 | - | { |
185 | + | { |
186 | - | TextDrawHideForPlayer(playerid, TextDrawFlip); |
186 | + | TextDrawHideForPlayer(playerid, TextDrawFlip); |
187 | - | TextDrawHideForPlayer(playerid, TextDrawRepair); |
187 | + | TextDrawHideForPlayer(playerid, TextDrawRepair); |
188 | - | TextDrawHideForPlayer(playerid, TextDrawNitro); |
188 | + | TextDrawHideForPlayer(playerid, TextDrawNitro); |
189 | - | } |
189 | + | TextDrawShowForPlayer(playerid, TextDrawJump); |
190 | - | return 0; |
190 | + | TextDrawShowForPlayer(playerid, TextDrawBoost); |
191 | - | } |
191 | + | } |
192 | return 0; | |
193 | } |