forked from Paradise-Devs/pc-rpg-gamemode
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.pwn
330 lines (272 loc) · 10.4 KB
/
main.pwn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
/*******************************************************************************
* FILENAME : main.pwn
*
* DESCRIPTION :
* Linkage of all modules and includes, definiton of values.
*
* NOTES :
* This file is not intended to handle player's functions or anything.
* This file must only have links and constants.
*
* Copyright Paradise Devs 2015. All rights reserved.
*/
// Required to be at the top
#include <a_samp>
//------------------------------------------------------------------------------
// Script versioning
#define SCRIPT_VERSION_MAJOR "0"
#define SCRIPT_VERSION_MINOR "2"
#define SCRIPT_VERSION_PATCH ".45"
#define SCRIPT_VERSION_NAME "PC:RPG"
//------------------------------------------------------------------------------
// Undefining samp's default values
#if defined MAX_PLAYERS
#undef MAX_PLAYERS
#endif
#define MAX_PLAYERS 101
//------------------------------------------------------------------------------
#define MAX_LEVEL 15
#define MAX_PLAYER_PASSWORD 65
#define MAX_BUILDINGS 32
#define MAX_PICKUP_RANGE 40.0
#define MAX_TEXT3D_RANGE 20.0
#define MAX_MAPICON_RANGE 150.0
// Numbers of vehicles hardcoded
#define PRELOADED_VEHICLES 1
#define PICKUP_DELAY 4 // Seconds
#define INVALID_APARTMENT_ID -1
#define INVALID_HOUSE_ID -1
#define INVALID_BUSINESS_ID -1
#define HOSPITAL_TIME 90 // Seconds
#define HOSPITAL_PRICE 500
#define FUEL_PRICE 1 // * 100 / 0.2%
#define MAX_FACTIONS 32
#define MAX_BUSINESS 32
#define MAX_BUSINESS_NAME 64
#define MAX_HOUSES 64
#define MAX_HOUSE_NAME 64
#define MAX_HOUSE_MAPICON_RANGE 25.0
#define INTERVAL_BETWEEN_SERVER_MESSAGES 900000 // ms
#define LAST_POSITION 0
#define HOUSE_POSITION 1
//------------------------------------------------------------------------------
#define COLOR_WARNING 0xf14545ff
#define COLOR_ERROR 0xf14545ff
#define COLOR_SUCCESS 0x88aa62FF
#define COLOR_INFO 0xA9C4E4FF
#define COLOR_ACTION 0xDA70D6FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_TITLE 0xa5f413ff
#define COLOR_SPECIAL 0xa5f413ff
#define COLOR_ADMIN_ACTION 0x7dcfb6ff
#define COLOR_SUB_TITLE 0xe6e6e6ff
#define COLOR_SERVER 0xa5f413ff
#define COLOR_WALKIE_TALKIE 0x4FBBE0FF
#define COLOR_SERVER_ANN 0xf26363ff
#define COLOR_RANK_DEVELOPER 0x35a700ff
#define COLOR_RANK_ADMIN 0x00AEFFFF
#define COLOR_RANK_SUPERVISOR 0x009CE5FF
#define COLOR_RANK_MODERATOR 0x008BCCFF
#define COLOR_RANK_BETATESER 0x992A2AFF
#define COLOR_RANK_DESIGNER 0xe48200ff
#define COLOR_RANK_PARADISER 0xCE8500FF
//------------------------------------------------------------------------------
// Libraries
#include <crashdetect>
#include <a_mysql>
#include <YSI\y_hooks>
#include <YSI\y_timers>
#include <YSI\y_iterate>
#include <streamer>
#include <YSI\y_commands>
#include <YSI\y_va>
#include <progress2>
#include <fnumb>
#include <util>
#include <vcolor>
#include <zones>
#include <mSelection>
#include <radars>
#include <vending>
#include <cuffs>
#include <sscanf2>
#include <sscanffix>
#include <log>
//------------------------------------------------------------------------------
// ID of the model list for text draw of skins
new maleskinlist = mS_INVALID_LISTID;
new femaleskinlist = mS_INVALID_LISTID;
new g_RegisteredPlayers;
//------------------------------------------------------------------------------
hook OnGameModeInit()
{
// Gamemode start message
printf("\n\n============================================================\n");
printf("Initializing %s %s.%s%s...\n", SCRIPT_VERSION_NAME, SCRIPT_VERSION_MAJOR, SCRIPT_VERSION_MINOR, SCRIPT_VERSION_PATCH);
// Set the gamemode name to the current version
new rcon_command[32];
format(rcon_command, sizeof(rcon_command), "gamemodetext %s %s.%s%s", SCRIPT_VERSION_NAME, SCRIPT_VERSION_MAJOR, SCRIPT_VERSION_MINOR, SCRIPT_VERSION_PATCH);
SendRconCommand(rcon_command);
// Gamemode settings
ShowNameTags(1);
UsePlayerPedAnims();
DisableInteriorEnterExits();
SetNameTagDrawDistance(40.0);
EnableStuntBonusForAll(false);
ManualVehicleEngineAndLights();
ShowPlayerMarkers(PLAYER_MARKERS_MODE_OFF);
// Textdraw Model
printf("Loading textdraw model selection...");
maleskinlist = LoadModelSelectionMenu("civillian_male_skins.txt");
femaleskinlist = LoadModelSelectionMenu("civillian_female_skins.txt");
// Objects
printf("Creating objects...");
CreateDynamicObject(3089, 2160.5, 1603.3000488281, 1000.299987793, 0, 0, 270, -1, 1, -1, 25); // Phone Network inside door
CreateDynamicObject(1506, 365.80, 196.24, 1007.37, 0.00, 0.00, 0.00, 26);//CNN News inside door
// Door at SF-PD for advertising business
CreateDynamicObject(1535, 220.32, 115.85, 1002.22, 0.00, 0.00, 0.00);
CreateDynamicObject(1535, 223.34, 115.88, 1002.22, 0.00, 0.00, 180.00);
// Ground at The Welcome Pump
CreateDynamicObject(8664, 682.94452, -467.08691, -26.69240, 0.00000, 0.00000, 0.00000, -1, 1);
CreateDynamicObject(1501, 680.72339, -450.72391, -26.51500, 0.00000, 0.00000, 0.00000, -1, 1);
new ground = CreateDynamicObject(19377, 681.45459, -450.60699, -26.61890, 0.00000, 0.00000, 90.00000, -1, 1);
SetDynamicObjectMaterial(ground, 0, 14655, "ab_trukstpa", "bbar_wall1");
return 1;
}
//------------------------------------------------------------------------------
// Iterators
new Iterator:House<MAX_HOUSES>;
new Iterator:Business<MAX_HOUSES>;
//------------------------------------------------------------------------------
// Modules
/* Defs */
#include "../modules/def/checkpoint.pwn"
#include "../modules/def/achievement.pwn"
#include "../modules/def/ranks.pwn"
#include "../modules/def/buttons.pwn"
#include "../modules/def/job.pwn"
#include "../modules/def/dialogs.pwn"
#include "../modules/def/ftime.pwn"
#include "../modules/def/messages.pwn"
#include "../modules/def/missions.pwn"
#include "../modules/def/statscol.pwn"
#include "../modules/def/licenses.pwn"
/* Server - Required to be at the top*/
#include "../modules/data/connection.pwn"
//#include "../modules/anticheater/anticheater.pwn"
/* Data */
#include "../modules/data/building.pwn"
#include "../modules/data/vehicle.pwn"
#include "../modules/data/faction.pwn"
#include "../modules/data/player.pwn"
/* Properties */
#include "../modules/properties/vehicle.pwn"
#include "../modules/properties/apartment.pwn"
#include "../modules/properties/house.pwn"
#include "../modules/properties/business.pwn"
/* Vehicle */
#include "../modules/vehicle/control.pwn"
#include "../modules/vehicle/reserve.pwn"
#include "../modules/vehicle/dschool.pwn"
#include "../modules/vehicle/status.pwn"
#include "../modules/vehicle/fueling.pwn"
/* Game */
#include "../modules/game/mapicons.pwn"
#include "../modules/game/automsg.pwn"
#include "../modules/game/pause.pwn"
#include "../modules/game/clock.pwn"
#include "../modules/game/preloadanim.pwn"
#include "../modules/game/vending.pwn"
/* Gameplay */
#include "../modules/gameplay/8track.pwn"
#include "../modules/gameplay/motocross.pwn"
#include "../modules/gameplay/handshake.pwn"
#include "../modules/gameplay/blowjob.pwn"
#include "../modules/gameplay/kiss.pwn"
#include "../modules/gameplay/hospital.pwn"
#include "../modules/gameplay/lottery.pwn"
#include "../modules/gameplay/tutorial.pwn"
#include "../modules/gameplay/paintball.pwn"
#include "../modules/gameplay/weather.pwn"
#include "../modules/gameplay/phone.pwn"
#include "../modules/gameplay/shtrange.pwn"
#include "../modules/gameplay/gps.pwn"
#include "../modules/gameplay/radars.pwn"
#include "../modules/gameplay/fighting.pwn"
#include "../modules/gameplay/bank.pwn"
#include "../modules/gameplay/boxing.pwn"
#include "../modules/gameplay/gym.pwn"
#include "../modules/gameplay/prision.pwn"
#include "../modules/gameplay/rentbike.pwn"
#include "../modules/gameplay/anims.pwn"
#include "../modules/gameplay/pursuit.pwn"
/* Player */
#include "../modules/player/achievement.pwn"
#include "../modules/player/chat.pwn"
#include "../modules/player/commands.pwn"
#include "../modules/player/deadbody.pwn"
#include "../modules/player/needs.pwn"
#include "../modules/player/pets.pwn"
/* Admin */
#include "../modules/admin/funcs.pwn"
#include "../modules/admin/commands.pwn"
/* Factions */
#include "../modules/faction/general.pwn"
#include "../modules/faction/cnn.pwn"
#include "../modules/faction/lspd.pwn"
/* Visual */
#include "../modules/visual/fade.pwn"
#include "../modules/visual/speedo.pwn"
#include "../modules/visual/subtitles.pwn"
#include "../modules/visual/needs.pwn"
#include "../modules/visual/stats.pwn"
#include "../modules/visual/gps.pwn"
#include "../modules/visual/logo.pwn"
#include "../modules/visual/login.pwn"
#include "../modules/visual/businfo.pwn"
#include "../modules/visual/boxing.pwn"
#include "../modules/visual/licenses.pwn"
#include "../modules/visual/xpbar.pwn"
#include "../modules/visual/pursuit.pwn"
/* NPCs */
#include "../modules/npcs/actors.pwn"
#include "../modules/npcs/npcs.pwn"
/* Cutscenes */
#include "../modules/cutscenes/cityhall.pwn"
/* Jobs */
#include "../modules/job/pilot.pwn"
#include "../modules/job/trucker.pwn"
#include "../modules/job/lumberjack.pwn"
#include "../modules/job/navigator.pwn"
#include "../modules/job/paramedic.pwn"
#include "../modules/job/garbage.pwn"
#include "../modules/job/hotdog.pwn"
#include "../modules/job/icecream.pwn"
#include "../modules/job/fisher.pwn"
#include "../modules/job/taxi.pwn"
#include "../modules/job/technical.pwn"
#include "../modules/job/pizzaboy.pwn"
#include "../modules/job/busdriver.pwn"
#include "../modules/job/commands.pwn"
/* Missions */
#include "../modules/missions/gta.pwn"
#include "../modules/missions/colonel.pwn"
/* Objects */
#include "../modules/objects/hospital.pwn"
#include "../modules/objects/airport.pwn"
#include "../modules/objects/player.pwn" // a.k.a attachments
#include "../modules/objects/lspd.pwn"
#include "../modules/objects/bank.pwn"
#include "../modules/objects/petshop.pwn"
/* Core */
#include "../modules/core/timers.pwn"
/* Server */
#include "../modules/server/rcon.pwn"
//#include <nex-ac>
//------------------------------------------------------------------------------
main()
{
printf("\n\n%s %s.%s%s initialiazed.\n", SCRIPT_VERSION_NAME, SCRIPT_VERSION_MAJOR, SCRIPT_VERSION_MINOR, SCRIPT_VERSION_PATCH);
printf("============================================================\n");
}