· 8 years ago · Dec 30, 2017, 10:20 AM
1#if defined server_updates
2 ("Update v0.0.1")
3
4- Serverul a fost trecut pe versiunea de MySQL r39-6
5- A fost adaugata functia OnServerKick(player) - Misc One
6- A fost implemnetat un sistem de DMV.
7- A fost implementat un logo de forma: PlayerName / BROH.GOOD2PLAY.RO.
8- A fost implementat un sistem de engine.
9- Acum sistemul de admini si helperi este creeat folosind iteratori.
10- Cand un admin / helper se conecteaza pe server ii va arata un mesaj de bun venit, iar in chat-ul adminilor va fi aratat un mesaj cum ca x s-a conectat pe server.
11- Au fost rescrise cateva comenzi intr-un format cu linii mai putine.
12- Am rescris sistemul de login / register.
13- Am implementat un sistem de language( limba ).
14- Am implementat o functie prin care se poate trimite un mesaj catre jucator in functie de limba sa intr-o singura linie de cod.
15 Syntaxa: SendLM(playerid, culoare, "Romana", "Engleza");
16- Am implementat un sistem de tutorial (BETA).
17- Am implementat un sistem de vehicule personale (BETA report all bugs :D)
18- Au fost eliminate unele sisteme care nu isi aveau rostul.
19- Am implementat comenzile : /gotols, /gotods, /gotospawn, /gotolv,/gotosf pentru admini.
20- A fost implementat un comanda [/flymode] pentru admini.
21- Am oferit un alt design comenzii [/a].
22- Am creeat comanda [/pm] pentru admini.
23
24 ("Update v0.0.2")
25- Design-ul erorilor de la comenzile de admini au fost refacute.
26- Comanda [/time] a fost rescrisa.
27- Am implementat comanda [/fv].
28- A fost implementata comanda [/addnos].
29- A fost implementata comanda [/spawncar].
30- A fost implementata comanda [/vre].
31- Sintaxa fiecarei comenzi va aparea acum subt un alt design.
32- Am implementat comenzile [/servername] [/serverpass] pentru Adminii de nivel 6+.
33- Am implementat comanda [/rac] pentru admini.
34- Au fost implementate comenzile [/up] si [/down] pentru admini.
35- Am implementat comenzile [/setadmin] si [/sethelper].
36- Am implementat comanda [/flip] pentru admini.
37- Am implementat comanda [/acolor] pentru admini.
38- Am implementat comanda [/changepass].
39
40#endif
41
42#include <a_samp>
43#include <a_mysql>
44#include <zcmd>
45#include <sscanf2>
46#include <YSI\y_iterate>
47#include <YSI_Coding\y_timers>
48#include <YSI\y_va>
49#include <streamer>
50#include <a_zones>
51#include <fly>
52
53#define MAX_HOUSES (550)
54#define MAX_TIMERS (5)
55#define MAX_TEXTDRAWS (10)
56#define MAX_JOBS (5)
57#define MAX_GROUPS (20)
58#define MAX_BUSINESSES (100)
59#define MAX_WEAPON_HACK_WARNINGS (3)
60#define MAX_ASSETS (4)
61#define MAX_SPIKES (10)
62#define MAX_LOGIN_ATTEMPTS (5)
63#define EX_SPLITLENGTH 113
64#define EX_SPLITLENGTHH 128
65
66new mysqlconnection = 1; // 0 = localhost | 1 = linux
67#define DB_LINUX_HOSTNAME "93.119.26.250"
68#define DB_LINUX_USERNAME "zp_hid15042"
69#define DB_LINUX_DATABASE "zp_hid15042"
70#define DB_LINUX_PASSWORD "XrRhuR6tecSsnBWs"
71
72#define DB_USERNAME "root"
73#define DB_HOSTNAME "localhost"
74#define DB_PASSWORD ""
75#define DB_DATABASE "g2p"
76
77#define SERVER_SPAWN 1673.3722,1447.8218,10.7856
78
79#define COLOR_GREEN3 0x6DB067AA
80#define COLOR_ADMCHAT 0xFFC266AA
81#define COLOR_LIGHTRED 0xFF6347AA
82#define COLOR_RED2 0xFF0000FF
83#define COLOR_LG3 0x8BBA2EAA
84#define COLOR_CYAN 0x5EB1B1FF
85#define COLOR_ADMCHAT 0xFFC266AA
86#define COLOR_YELLOW 0xFFFF00AA
87#define COLOR_RED 0xE60000FF
88#define COLOR_WHITE 0xFFFFFFAA
89#define COLOR_LIGHT 0xAFD9FAFF
90#define COLOR_GREY 0xCECECEFF
91#define COLOR_PURPLE 0xC2A2DAAA
92#define COLOR_NICESKY 0x00C2ECFF
93#define COLOR_GREEN 0x00FF00AA
94#define COLOR_TEAL 0x67AAB1FF
95#define COLOR_DCHAT 0xFFD7004A
96#define COLOR_CHATBUBBLE 0xFFFFFFCC
97#define COLOR_NEWBIE 0xBED9EFFF
98#define COLOR_RADIOCHAT 0x8D8DFFFF
99#define COLOR_GENANNOUNCE 0xA9C4E4FF
100#define COLOR_COOLBLUE 0x0064FFAA
101#define COLOR_HOTORANGE 0xF97804FF
102#define COLOR_SMS 0xD5EAFFFF
103#define EMBED_GREY "{CECECE}"
104#define EMBED_LIGHTRED "{FF8080}"
105#define EMBED_OOC "{AFD9FA}"
106#define R "{FF0000}"
107#define W "{FFFFFF}"
108#define G "{C0FF00}"
109#define B "{0C7FA6}"
110/* Functions & Redefine */
111#define function%0(%1) forward %0(%1); public %0(%1)
112#define SCM SendClientMessage
113#define Function::%0(%1) forward %0(%1);public %0(%1)
114#define TsToDays(%0) (floatround((gettime()-%0)/86400))
115#define GivePlayerCash GivePlayerMoney
116#define GetPlayerCash GetPlayerMoney
117#define OnlyAdmin SCM(playerid, COLOR_LG3, "You are not an admin.");
118
119/* Vehicle System Defines */
120#define DEFAULT_VEHICLE_SLOTS 2 //Default vehicle slots for player
121#define MAX_VEHICLE_SLOTS 10 //Max vehicle slots per player
122#define MAX_SPAWNED_TIME 600 //Max time till vehicle will be despawned(if vehicle is not used)
123#define VEHICLE_SLOT_COST 25 //Cost of a new vehicle slot. YOU USE PREMIUM POINTS, NOT USUAL MONEY !
124#define VIP_VEHICLE_COST 100//Cost of making a vehicle VIP.
125#define VEHICLE_TOW_COST 2500 //Cost of vehicle towing in dollars($)
126#define VEHICLE_INSURANCE_COST 5000 //Cost of vehicle insurance in dollars($)
127#define TOTAL_INSURANCE_POINTS 5 //How many times a personal vehicle can be destroyed
128#define FIND_VEHICLE 2000 //Checkpoint for /findcar command/dialog
129/* ----------------------------- [DIALOGS] ----------------------------- */
130enum {
131 DIALOG_LOGIN,
132 DIALOG_HOUSE_ENTER,
133 DIALOG_CREATEGUN,
134 DIALOG_GROUP_ENTER,
135 DIALOG_HELP,
136 DIALOG_HELP2,
137 DIALOG_GENDER_SELECTION,
138 DIALOG_TUTORIAL_DOB,
139 DIALOG_TUTORIAL,
140 DIALOG_REPORT,
141 DIALOG_TWENTYFOURSEVEN,
142 DIALOG_BUSINESS_ENTER,
143 DIALOG_BAR,
144 DIALOG_SEX_SHOP,
145 DIALOG_FIGHTSTYLE,
146 DIALOG_REGISTER,DIALOG_REGISTER1,DIALOG_REGISTER2,DIALOG_REGISTER3,DIALOG_REGISTER4,
147 DIALOG_SELL_FISH,
148 DIALOG_FOOD_ONE,
149 DIALOG_FOOD_TWO,
150 DIALOG_FOOD_THREE,
151 DIALOG_GMX,
152 /* Vehicle System Dialogs */
153 D_Veh,
154 D_Veh_Menu,
155 D_Veh_Menu_Info,
156 D_Veh_Menu_VIP,
157 D_Veh_Menu_VIP_CT,
158 D_Veh_Menu_VIP_CC,
159 D_Veh_Menu_VIP_CustomC,
160 DIALOG_SKIP,
161 DIALOG_ACOLOR,
162 DIALOG_NEWPASS, DIALOG_NEWPASS1
163};
164
165#define GROUP_VIRTUAL_WORLD (20000)
166#define HOUSE_VIRTUAL_WORLD (10000)
167#define BUSINESS_VIRTUAL_WORLD (30000)
168#define INTERIOR_WEATHER_ID (1) // Outdoor weather is used inside interiors too, blame San Andreas.
169#define MAX_WEATHER_POINTS (9)
170#define GOVERNMENT_GROUP_ID (4)
171#define SERVER_VERSION "v0.01"
172#define SERVER_NAME "BROH.GOOD2PLAY.RO"
173#define SYNTAX_MESSAGE "Syntax: {FFFFFF}"
174#define SpeedCheck(%0,%1,%2,%3,%4) floatround(floatsqroot(%4?(%0*%0+%1*%1+%2*%2):(%0*%0+%1*%1) ) *%3*1.6)
175//#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2) // strcpy(dest, source, length)
176
177native WP_Hash(buffer[], len, const str[]);
178
179
180main() { }
181
182
183enum systemE {
184 houseCount,
185 businessCount,
186 vehicleCounts[3],
187 reportSystem,
188 OOCStatus,
189}
190
191enum assetsE {
192 aAssetName[32],
193 aAssetValue,
194}
195
196enum vehicle_info{
197 vSQL,
198 vType,
199 vOwner,
200 szvOwner[MAX_PLAYER_NAME],
201 vModel,
202 vAge,
203 Float: vKM,
204 vCol[2],
205 vSlot,
206 vText,
207 vInsurancePoints,
208 vOwnerID,
209 vNeon[2],
210 bool: vLock
211};
212
213enum jobsE {
214 jJobType,
215 Float: jJobPosition[3],
216 jJobName[32],
217 jJobPickupID,
218 Text3D:jJobLabelID,
219}
220
221enum businessE {
222 bType,
223 bOwner[MAX_PLAYER_NAME],
224 bName[32],
225 Float: bExteriorPos[3],
226 Float: bInteriorPos[3],
227 bInterior,
228 bLocked,
229 Float: bMiscPos[3],
230 bVault,
231 Text3D: bLabelID,
232 bPickupID,
233 bPrice,
234}
235
236enum spikeE {
237 sObjID,
238 Float:sPos[4],
239 sDeployer[MAX_PLAYER_NAME],
240}
241
242enum vehicleE {
243 vVehicleModelID,
244 Float: vVehiclePosition[3],
245 Float: vVehicleRotation,
246 vVehicleGroup,
247 vVehicleColour[2],
248 vVehicleScriptID,
249}
250
251enum houseE {
252 Float: hHouseExteriorPos[3],
253 Float: hHouseInteriorPos[3],
254 hHouseInteriorID,
255 hHouseLocked,
256 hHouseExteriorID,
257 hHousePrice,
258 hPickupID,
259 Text3D:hLabelID,
260 hHouseOwner[MAX_PLAYER_NAME],
261 hMoney,
262 hWeapons[5],
263 hWardrobe[5],
264 hMaterials,
265}
266
267enum groupE {
268 gGroupName[64],
269 gGroupType,
270 Float: gGroupExteriorPos[3],
271 Float: gGroupInteriorPos[3],
272 gGroupHQInteriorID,
273 gGroupPickupID,
274 Float: gSafePos[3],
275 gSafePickupID,
276 Text3D: gSafeLabelID,
277 Text3D: gGroupLabelID,
278 gGroupHQLockStatus,
279 gSafe[2], // 0-1: Money, mats. pot, cocaine out for now
280 gswatInv,
281 gGroupMOTD[128],
282 gGroupRankName1[32], // 4d arrays aren't supported in pawn, so I'll have to continue it like this...
283 gGroupRankName2[32],
284 gGroupRankName3[32],
285 gGroupRankName4[32],
286 gGroupRankName5[32],
287 gGroupRankName6[32],
288}
289
290enum playervEnum {
291 Float: pHealth,
292 Float: pArmour,
293 pPassword[129],
294 pStatus,
295 pAge,
296 pMoney,
297 pNameUnbanning[MAX_PLAYER_NAME],
298 pAdmin,
299 pInterior,
300 pTabbed,
301 pSkinSet,
302 pCarID,
303 pAnticheatExemption,
304 pCarWeapons[5],
305 pCarTrunk[2], // Cash & mats
306 pPhoneCredit, // Will be done in seconds.
307 pWalkieTalkie, // -1 = no walkie, 0 = switched off
308 pSpectating,
309 pSpecSession,
310 pConnectedSeconds,
311 Text3D: pAFKLabel,
312 pSpamCount,
313 pFishing,
314 //Bar: pFishingBar,
315 pMuted,
316 pVirtualWorld,
317 pFish,
318 pBanned,
319 pEvent,
320 Float: pCarPos[4],
321 pReport,
322 pPrisonTime,
323 pPrisonID, // 3 = IN CHARACTER JAIL! (future reference)
324 pHackWarnTime,
325 pHelperDuty,
326 pReportMessage[64],
327 pPlayingHours,
328 pSkin,
329 pJob,
330 pRope,
331 pWarning1[32],
332 pWarning2[32],
333 pWarning3[32],
334 pPhoneNumber,
335 pSkinCount,
336 pSeeOOC,
337 pOOCMuted,
338 pNewbieTimeout,
339 pTutorial,
340 pWeapons[13],
341 pOutstandingWeaponRemovalSlot,
342 pJetpack,
343 pBankMoney,
344 pHackWarnings,
345 pEmail[255], // because this is the max length for a valid email.
346 pSeconds,
347 pFightStyle,
348 pSQL,
349 pJobDelay,
350 pGender,
351 pNewbieEnabled,
352 pFirstLogin,
353 pAdminDuty,
354 pHelper,
355 pCarColour[2],
356 pMatrunTime,
357 pNormalName[MAX_PLAYER_NAME],
358 pPhoneBook,
359 pCheckpoint,
360 pOnRequest,
361 pGroup,
362 pCarModel,
363 pCarMods[13],
364 pCarPaintjob,
365 pCarLock,
366 pGroupRank,
367 pDropCarTimeout,
368 pMaterials,
369 pJobSkill[2],
370 pFreezeTime, // Seconds. Set it to -1 if you want to permafreeze.
371 pFreezeType, // 0 = not frozen (obviously), 1 = tazed, 2 = cuffed, 3 = admin frozen, 4 = tied
372 pDrag,
373 pAnimation,
374 pPhoneStatus, // togged on/off
375 pPhoneCall,
376 pConnectionIP[32],
377 pSeeWhisper,
378 pCrimes,
379 pArrests,
380 pWarrants,
381 pBackup,
382 pCarLic,
383 pLanguage,
384 pColor,
385 pSex,
386 pPremiumPoints,
387 pVeh[MAX_VEHICLE_SLOTS],
388 v_Model[MAX_VEHICLE_SLOTS],
389 v_Col1[MAX_VEHICLE_SLOTS],
390 v_Col2[MAX_VEHICLE_SLOTS],
391 Float: v_PosX[MAX_VEHICLE_SLOTS],
392 Float: v_PosY[MAX_VEHICLE_SLOTS],
393 Float: v_PosZ[MAX_VEHICLE_SLOTS],
394 Float: v_PosA[MAX_VEHICLE_SLOTS],
395 v_SQL[MAX_VEHICLE_SLOTS],
396 Float: v_KM[MAX_VEHICLE_SLOTS],
397 v_Spawned[MAX_VEHICLE_SLOTS],
398 v_Age[MAX_VEHICLE_SLOTS],
399 v_VIP[MAX_VEHICLE_SLOTS],
400 v_Price[MAX_VEHICLE_SLOTS],
401 v_Paint[MAX_VEHICLE_SLOTS],
402 v_InsurancePoints[MAX_VEHICLE_SLOTS],
403 bool: v_vTextStatus[MAX_VEHICLE_SLOTS],
404 v_Slots
405}
406
407new
408 LSPDObjs[8][3], // 8 sets of doors. 0 = door1, 1 = door2, 2 = status (closed/open)
409 LSPDGates[2][2]; // Boom gate, garage (1 = status, closed/open).
410
411new Float:JailSpawns[4][3] = {
412
413 { 227.46, 110.0, 999.02 },
414 { 223.15, 110.0, 999.02 },
415 { 219.25, 110.0, 999.02 },
416 { 216.39, 110.0, 999.02 }
417};
418
419new validWeatherIDs[17] = { 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 20 };
420
421new WeaponNames[47][] = // As below
422{
423 "punch","brass knuckles","golf club","nitestick","knife","baseball bat","shovel","pool cue","katana","chainsaw","purple dildo","small white vibrator","large white vibrator","silver vibrator",
424 "bouquet of flowers","cane","grenade","tear gas grenade","molotov cocktail","jetpack"," "," ","Colt .45","silenced Colt .45","Desert Eagle","12-gauge shotgun","sawn-off shotgun","SPAS-12",
425 "Micro Uzi","MP5","AK-47","M4A1","TEC-9","rifle","sniper rifle","rocket launcher","heatseeker","flamethrower","minigun","satchel charge","detonator","spray can","fire extinguisher",
426 "camera","nightvision goggles", "thermal goggles","parachute"
427};
428
429new fishNames[5][] = {
430 "Carp", "Bass", "Cod", "Plaice", "Tuna"
431};
432
433new
434 SQL,
435 adTick,
436 weatherVariables[2],
437 gTime[3],
438 iGMXTimer,
439 iGMXTick,
440 systemVariables[systemE],
441 houseVariables[MAX_HOUSES][houseE],
442 Text:textdrawVariables[MAX_TEXTDRAWS],
443 jobVariables[MAX_JOBS][jobsE],
444 AdminSpawnedVehicles[MAX_VEHICLES],
445 assetVariables[MAX_ASSETS][assetsE],
446 businessVariables[MAX_BUSINESSES][businessE],
447 Float:PlayerPos[MAX_PLAYERS][6],
448 vehicleVariables[MAX_VEHICLES][vehicleE],
449 groupVariables[MAX_GROUPS][groupE],
450 P_DATA[MAX_PLAYERS][playervEnum],
451 spikeVariables[MAX_SPIKES][spikeE],
452 scriptTimers[MAX_TIMERS],
453 V_DATA[MAX_VEHICLES][vehicle_info],
454 v_Mod[MAX_PLAYERS][MAX_VEHICLE_SLOTS][14],
455 v_Dmg[MAX_PLAYERS][MAX_VEHICLE_SLOTS][4],
456 v_vText[MAX_PLAYERS][MAX_VEHICLE_SLOTS][11],
457 v_vTextColor[MAX_PLAYERS][MAX_VEHICLE_SLOTS],
458 v_Plate[MAX_PLAYERS][MAX_VEHICLE_SLOTS][32],
459 dSelectedSlot[MAX_PLAYERS][MAX_VEHICLE_SLOTS],
460 vMAction[MAX_PLAYERS],
461 CP[MAX_PLAYERS],
462 Float: vP[MAX_VEHICLES][3],
463 bool: FollowingCP[MAX_PLAYERS],
464 Iterator: pVehs<MAX_VEHICLES>,
465 VehicleNames[212][] ={
466 "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
467 "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
468 "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
469 "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
470 "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
471 "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
472 "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
473 "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
474 "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
475 "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
476 "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
477 "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
478 "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
479 "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
480 "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
481 "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
482 "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
483 },
484 vipTextDefaultColors[10] = {0xFFFFFFFF, 0xFF0000FF, 0x640000FF, 0x00FF00FF, 0x004B01FF, 0x008DFFFF, 0x001AFFFF, 0xFF6B00FF, 0x8A8A8AFF, 0x000000FF};
485
486
487//playerTexts
488new
489 PlayerText: logo,
490 PlayerText: DMV[2],
491 PlayerText: TutorialTD[2],
492 PlayerText: OwnerInfo;
493
494// New Variables
495new
496 InLesson[MAX_PLAYERS],masinaexamen[MAX_PLAYERS],
497 CarEngine[MAX_PLAYERS],
498 RegisterStats[MAX_PLAYERS], TutTime[MAX_PLAYERS],UsedFly[MAX_PLAYERS], Carspawn[MAX_VEHICLES];
499
500// Iterators
501new
502 Iterator: Admins<MAX_PLAYERS>,
503 Iterator: Helpers<MAX_PLAYERS>;
504
505task globalPlayerLoop[1000]() {
506 if(adTick >= 1) {
507 adTick--; // Counting down for the advertisement tick!
508 }
509
510 /* --------------------- WORLD TIME --------------------- */
511
512 gettime(gTime[0], gTime[1], gTime[2]);
513
514 if(gTime[1] >= 59 && gTime[2] >= 59) {
515
516 weatherVariables[1] += random(3) + 1; // Weather changes aren't regular.
517
518 SetWorldTime(gTime[0]); // Set the world time to keep the worldtime variable updated (and ensure it syncs instantly for connecting players).
519
520 if(weatherVariables[1] >= MAX_WEATHER_POINTS) {
521 weatherVariables[0] = validWeatherIDs[random(sizeof(validWeatherIDs))];
522 foreach(new i : Player) {
523 if(!GetPlayerInterior(i)) {
524 SetPlayerWeather(i, weatherVariables[0]);
525 }
526 else SetPlayerWeather(i, INTERIOR_WEATHER_ID);
527 }
528 weatherVariables[1] = 0;
529 }
530 }
531
532 /* ------------------------------------------------------ */
533
534 foreach(new x : Player) {
535
536 if(gTime[2] >= 59) syncPlayerTime(x);
537 if(P_DATA[x][pAdmin] >= 6) {
538 new string[64];
539 format(string,sizeof(string),"TICKS: ~g~%i~w~ / QUERIES: ~b~%d~w~ / ANIM: ~p~%d~w~",GetServerTickRate(),mysql_unprocessed_queries(),GetPlayerAnimationIndex(x));
540 PlayerTextDrawSetString(x, OwnerInfo, string);
541 PlayerTextDrawShow(x,OwnerInfo);
542 }
543 if(P_DATA[x][pStatus] == 1) {
544 P_DATA[x][pSeconds]++;
545
546 if(P_DATA[x][pMuted] >= 1) {
547 P_DATA[x][pMuted]--; // We don't need two variables for muting - just use -1 to permamute (admin mute) and a positive var for a temp mute.
548
549 if(P_DATA[x][pMuted] == 0) {
550 SendClientMessage(x, COLOR_GREY, "You have now been automatically unmuted.");
551 }
552 }
553
554 if(P_DATA[x][pAnticheatExemption] >= 1) {
555 P_DATA[x][pAnticheatExemption]--;
556 }
557
558 if(P_DATA[x][pPhoneCall] != -1) {
559
560 P_DATA[x][pPhoneCredit]--;
561
562 if(P_DATA[x][pPhoneCredit] == 60) {
563 SendClientMessage(x, COLOR_HOTORANGE, "You are close to running out of phone credit (60 seconds left).");
564 }
565 else if(P_DATA[x][pPhoneCredit] < 1) {
566 SendClientMessage(x, COLOR_WHITE, "You are out of credit.");
567
568 if(GetPlayerSpecialAction(x) == SPECIAL_ACTION_USECELLPHONE) {
569 SetPlayerSpecialAction(x, SPECIAL_ACTION_STOPUSECELLPHONE);
570 }
571 if(P_DATA[x][pPhoneCall] != -1 && P_DATA[x][pPhoneCall] < MAX_PLAYERS) {
572
573 SendClientMessage(P_DATA[x][pPhoneCall], COLOR_WHITE, "Your call has been terminated by the other party (ran out of credit).");
574
575 if(GetPlayerSpecialAction(P_DATA[x][pPhoneCall]) == SPECIAL_ACTION_USECELLPHONE) {
576 SetPlayerSpecialAction(P_DATA[x][pPhoneCall], SPECIAL_ACTION_STOPUSECELLPHONE);
577 }
578 P_DATA[P_DATA[x][pPhoneCall]][pPhoneCall] = -1;
579 }
580 P_DATA[x][pPhoneCall] = -1;
581 }
582 }
583 if(TutTime[x] >= 1)
584 {
585 TutTime[x] += 1;
586 new string[128];
587 if(TutTime[x] == 3)
588 {
589 PlayerTextDrawShow(x, TutorialTD[0]),PlayerTextDrawSetString(x, TutorialTD[0], "~w~Step: ~r~1~w~/~r~8"), PlayerTextDrawShow(x, TutorialTD[1]);
590 new Cache: ab = mysql_query(SQL, "SELECT * FROM playeraccounts");
591 cache_delete(ab);
592 SendClientMessage(x, COLOR_WHITE, ""),SendClientMessage(x, COLOR_WHITE, ""),SendClientMessage(x, COLOR_WHITE, ""),SendClientMessage(x, COLOR_WHITE, ""),SendClientMessage(x, COLOR_WHITE, "");
593 SetPlayerVirtualWorld(x, 0);
594 switch(P_DATA[x][pLanguage]) {
595 case 2: {
596 SetPlayerPos(x, 366.0407,-1892.6018,1.6999);
597 SetPlayerCameraPos(x, 558.3660,-1964.6206,85.2497);
598 SetPlayerCameraLookAt(x, 419.0543,-1888.1879,23.8108);
599 TogglePlayerControllable(x,0);
600 SCMF(x, COLOR_WHITE, "Salutare, %s! Bun venit pe server!", GetName(x));
601 SCM(x, COLOR_WHITE, "Daca joci pe serverul nostru, ai siguranta ca nu vor fi resetate niciodata datele(wipe) niciodata asa cum se intampla pe alte servere.");
602 SCM(x, COLOR_WHITE, "Se fac updateuri frecvente la server, iar bugurile aparute sunt reparate rapid.");
603 SCM(x, COLOR_WHITE, "Adminii si helperii sunt bine alesi si te pot ajuta cu orice problema.");
604 SCM(x, COLOR_WHITE, "Intrebarile despre server le poti pune pe /n, iar daca ai o problema poti folosi /report.");
605 SCM(x, COLOR_WHITE, "In continuare iti vom prezenta cateva informatii despre joc.");
606 }
607 case 1: {
608 format(string, sizeof(string), "Hi, %s! Welcome to BROH.GOOD2PLAY.RO!", GetName(x));
609 SCM(x, COLOR_WHITE, string);
610 SCM(x, COLOR_WHITE, string);
611 SCM(x, COLOR_WHITE, "There are 100 houses and 54 businesses on our server and there are 103 different car models that you can buy from our dealership.");
612 SCM(x, COLOR_WHITE, "If you play on BROH.GOOD2PLAY.RO!, you'll never have to worry about server wipes.");
613 SCM(x, COLOR_WHITE, "Our server is frequently updated and the bugs are fixed quickly.");
614 SCM(x, COLOR_WHITE, "The admins and helpers can help you with any problem you may have.");
615 SCM(x, COLOR_WHITE, "If you have any questions, use /n. If you have any problems, use /report.");
616 }
617 }
618 }
619 else if(TutTime[x] == 15)
620 {
621 PlayerTextDrawShow(x, TutorialTD[0]),PlayerTextDrawSetString(x, TutorialTD[0], "~w~Step: ~r~2~w~/~r~8");
622 SetPlayerPos(x, 1857.4175,-1847.2292,13.5815);
623 SetPlayerCameraPos(x, 1794.2242,-1819.9382,38.3741);
624 SetPlayerCameraLookAt(x, 1830.4750,-1840.9551,15.9818);
625 SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, "");
626 switch(P_DATA[x][pLanguage]) {
627 case 2: {
628 SCM(x, COLOR_WHITE, "- Acesta este un magazin 24/7, magazin de unde poti cumpara mai multe lucruri utile:");
629 SCM(x, COLOR_WHITE, " - telefon - dupa ce cumperi un telefon, vei putea suna un player sau ii poti da sms.");
630 SCM(x, COLOR_WHITE, " - agenda telefonica - vei putea afla numerele de telefon ale altor playeri folosind comanda /number.");
631 SCM(x, COLOR_WHITE, "- credit pentru telefon - pe serverul nostru telefoanele folosesc credit pentru apeluri si sms-uri.");
632 SCM(x, COLOR_WHITE, " - walkie-talkie - walkie-talkie poate fi folosit pentru a discuta cu un grup de prieteni.");
633 SCM(x, COLOR_WHITE, "- Te lasam pe tine sa descoperi ce altceva poti cumpara din magazine.");
634 }
635 case 1: {
636 SCM(x, COLOR_WHITE, "- This is a 24/7 store. You can buy the following products from here:");
637 SCM(x, COLOR_WHITE, "- phone - you can use the phone to make calls(/call) and send texts(/sms).");
638 SCM(x, COLOR_WHITE, "- phonebook - you'll be able to find the phone number another player using /number.");
639 SCM(x, COLOR_WHITE, "- prepay credit - on this server the phones use prepay credit. when it runs out, buy some more.");
640 SCM(x, COLOR_WHITE, "- walkie-talkie - this can be used to talk with a group of friends.");
641 SCM(x, COLOR_WHITE, "- We'll let you discover what else can be bought from the stores.");
642 }
643 }
644 }
645 else if(TutTime[x] == 27)
646 {
647 PlayerTextDrawShow(x, TutorialTD[0]),PlayerTextDrawSetString(x, TutorialTD[0], "~w~Step: ~r~3~w~/~r~8");
648 SetPlayerPos(x, 1223.5475,-1881.3280,30.6971);
649 SetPlayerCameraPos(x, 1199.0161,-1862.7023,46.3864);
650 SetPlayerCameraLookAt(x, 1220.9999,-1838.0793,29.3740);
651 SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, "");
652 switch(P_DATA[x][pLanguage]) {
653 case 2: {
654 SCM(x, COLOR_WHITE, " Aici poti da examen pentru a obtine permisul de conducere.");
655 SCM(x, COLOR_WHITE, " Nu stii cum sa ajungi aici? Nicio problema. Poti folosi comanda /gps si vei putea alege 'Los Santos DMV' din lista.");
656 SCM(x, COLOR_WHITE, " Comanda /gps poate fi folosita si pentru a afla unde sunt alte locatii importante de pe server.");
657 SCM(x, COLOR_WHITE, " Dupa ce vei lua examenul vei primi permisul de conducere, vei putea conduce masini, dar nu avioane sau barci.");
658 SCM(x, COLOR_WHITE, "Cand vei face level 3 vei putea cumpara si licenta pentru a putea conduce un avion, o barca sau pentru a cumpara arme.");
659 SCM(x, COLOR_WHITE, "Licentele vor expira dupa 100 ore de joc si va trebui sa dai examenele din nou pentru a le obtine.");
660 }
661 case 1: {
662 SCM(x, COLOR_WHITE, "Here is the place where you can get your driver's licence.");
663 SCM(x, COLOR_WHITE, "If you don't know to get here, you can use /gps and choose 'Los Santos DMV' from the list.");
664 SCM(x, COLOR_WHITE, "You can also use /gps to find out where other important locations are.Or you could call a cab using /service taxi.");
665 SCM(x, COLOR_WHITE, "Once you'll get your driver's license, you'll able to drive cars, but not planes or boats.");
666 SCM(x, COLOR_WHITE, "To be able to drive planes and boats, you'll need to contact an instructor once you reach level 3.");
667 SCM(x, COLOR_WHITE, "The licenses expires after 100 hours spent in game.");
668 }
669 }
670 }
671 else if(TutTime[x] == 39)
672 {
673 PlayerTextDrawShow(x, TutorialTD[0]),PlayerTextDrawSetString(x, TutorialTD[0], "~w~Step: ~r~4~w~/~r~8");
674 SetPlayerPos(x, 414.1995,-1512.3070,31.5960);
675 SetPlayerCameraPos(x, 428.3816,-1493.0682,69.4719);
676 SetPlayerCameraLookAt(x, 338.5612,-1515.7255,45.6690);
677 SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, "");
678 switch(P_DATA[x][pLanguage]) {
679 case 2: {
680 SCM(x, COLOR_WHITE, " Aici este Dealership-ul, adica locul de unde poti cumpara masini.");
681 SCM(x, COLOR_WHITE, " Pentru a cumpara o masina personala ai nevoie de level 3 si de bani suficienti.");
682 SCM(x, COLOR_WHITE, " Cea mai ieftina masina este Bike $250,000, iar cea mai scumpa este Infernus si are pretul de $50,000,000.");
683 SCM(x, COLOR_WHITE, " Sunt disponibile 103 modele diferite de masini in dealership.");
684 SCM(x, COLOR_WHITE, " Dupa ce vei cumpara o masina personala vei putea incuia usile, o vei putea parca unde vrei si o vei putea localiza.");
685 SCM(x, COLOR_WHITE, " Vei putea deasemenea sa vinzi masina sau sa faci schimb de masini cu un alt player.");
686 SCM(x, COLOR_WHITE, " Poti detine maxim 2 masini personale sau 4 daca ai cont premium, iar toate masinile vor ramane spawnate.");
687 SCM(x, COLOR_WHITE, " Pana ajungi la level 3 poti munci la unul in joburile disponibile.");
688 }
689 case 1: {
690 SCM(x, COLOR_WHITE, "That is the dealership, the place where players can buy personal vehicles.");
691 SCM(x, COLOR_WHITE, "To buy your own vehicle you need level 3 and enough money.");
692 SCM(x, COLOR_WHITE, "The cheapest car is Bike with price of $250,000 and the most expensive is Infernus and it costs $50,000,000.");
693 SCM(x, COLOR_WHITE, "There are 103 different car models available in our vehicle dealership.");
694 SCM(x, COLOR_WHITE, "Once you'll get your own car, you'll able to lock the doors of your car and you'll be able to park it wherever you want.");
695 SCM(x, COLOR_WHITE, "You can have 2 personal vehicles or 4 if you have a premium account.");
696 SCM(x, COLOR_WHITE, "Untill you reach level 3, you can use one of the 10+ jobs available.");
697 }
698 }
699 }
700 else if(TutTime[x] == 51)
701 {
702 PlayerTextDrawShow(x, TutorialTD[0]),PlayerTextDrawSetString(x, TutorialTD[0], "~w~Step: ~r~5~w~/~r~8");
703 SetPlayerPos(x, -35.6509,-1152.9932,1.1770);
704 SetPlayerCameraPos(x, 2849.9146,891.6600,10.7500);
705 SetPlayerCameraLookAt(x, 2829.8047,920.5195,37.9459);
706 SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, "");
707 switch(P_DATA[x][pLanguage]) {
708 case 2: {
709 SCM(x, COLOR_WHITE, "Trucker (sofer de tir) este unul din cele 11 job-uri disponibile pe serverul nostru.");
710 SCM(x, COLOR_WHITE, "La acest job trebuie sa livrezi marfa dintr-un oras in altul.");
711 SCM(x, COLOR_WHITE, "Pentru a vedea o lista cu joburile de pe server, foloseste comanda /jobs.");
712 SCM(x, COLOR_WHITE, "La toate joburile se castiga la fel de multi bani, cu exceptia jobului de detectiv unde nu se castiga bani.");
713 SCM(x, COLOR_WHITE, "Poti testa toate joburile pentru a testa care iti place mai mult.");
714 SCM(x, COLOR_WHITE, "Daca te plictisesti de un job, vei putea folosi comanda /quitjob pentru a renunta la el oricand.");
715 }
716 case 1: {
717 SCM(x, COLOR_WHITE, "Trucker is one of the 10+ jobs available on our server.");
718 SCM(x, COLOR_WHITE, "This job requires you to deliver stuff from one city to another.");
719 SCM(x, COLOR_WHITE, "");
720 SCM(x, COLOR_WHITE, "To see list of all available jobs, you can use the command /jobs.");
721 SCM(x, COLOR_WHITE, "One most jobs you'll earn the same ammount of money.");
722 SCM(x, COLOR_WHITE, "You can test all jobs to find out which one you like better.");
723 SCM(x, COLOR_WHITE, "If you get bored, you can use /quitjob and take another job.");
724 }
725 }
726 }
727 else if(TutTime[x] == 63)
728 {
729 PlayerTextDrawShow(x, TutorialTD[0]),PlayerTextDrawSetString(x, TutorialTD[0], "~w~Step: ~r~6~w~/~r~8");
730 SetPlayerPos(x, 1504.0387,-1664.6865,14.0031);
731 SetPlayerCameraPos(x, 1506.8416,-1697.2029,38.8016);
732 SetPlayerCameraLookAt(x, 1533.4709,-1680.9561,29.7199);
733 SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, "");
734 switch(P_DATA[x][pLanguage]) {
735 case 2: {
736 SCM(x, COLOR_WHITE, "Politistii sunt impartiti in 4 factiuni: Los Santos Police Department, Las Venturas Police Department, FBI si National Guard.");
737 SCM(x, COLOR_WHITE, "Vei putea aplica la una din cele 4 factiuni de politisti incepand cu level 7.");
738 SCM(x, COLOR_WHITE, "Pana ajungi la level 7, vei putea aplica la factiunile Taxi, Paramedic, News Reporters, School Instructors incepand cu level 5.");
739 SCM(x, COLOR_WHITE, "La factiunea Hitman Agency sau la una din cele 4 mafii, vei putea aplica incepand cu level 7.");
740 SCM(x, COLOR_WHITE, "Aplicatiile se fac pe panel (broh.good2play.ro/panel).");
741 SCM(x, COLOR_WHITE, "Cei care fac parte din factiuni primesc salarii saptamanale de la liderul factiunii.");
742 }
743 case 1: {
744 SCM(x, COLOR_WHITE, "Cops are divided in 4 factions: Los Santos Police Department, Las Venturas Police Department, FBI and National Guard.");
745 SCM(x, COLOR_WHITE, "You'll be able to apply to on of the cops factions once you get level 7.");
746 SCM(x, COLOR_WHITE, "You can apply to the factions Taxi, Paramedic, News Reporters and School Instructors once you get level 5.");
747 SCM(x, COLOR_WHITE, "You'll need level 7 to become a Hitman or a gang member.");
748 SCM(x, COLOR_WHITE, "You can apply to join a faction on our user panel (broh.good2play.ro/panel).");
749 }
750 }
751 }
752 else if(TutTime[x] == 75)
753 {
754 PlayerTextDrawShow(x, TutorialTD[0]),PlayerTextDrawSetString(x, TutorialTD[0], "~w~Step: ~r~7~w~/~r~8");
755 SetPlayerPos(x, 1463.5978,-1050.0614,24.0156);
756 SetPlayerCameraPos(x, 1484.4119,-1049.7178,39.7065);
757 SetPlayerCameraLookAt(x, 1465.3987,-1025.0939,29.2015);
758 SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, "");
759 switch(P_DATA[x][pLanguage]) {
760 case 2: {
761 SCM(x, COLOR_WHITE, "Aceasta este banca din orasul Las Venturas. Mai exista o banca si in orasul Los Santos.");
762 SCM(x, COLOR_WHITE, "Banca poate fi folosita pentru a depune si retrage bani sau pentru a transfera bani unui alt player.");
763 SCM(x, COLOR_WHITE, "Pentru banii depusi in banca vei primi dobanda odata pe ora.");
764 SCM(x, COLOR_WHITE, "Banii primiti din payday ajung in contul bancar si va trebui sa mergeti la banca pentru a-i retrage.");
765 SCM(x, COLOR_WHITE, "Te sfatuim sa nu imprumuti bani altor playeri deoarece nu au nicio garantie ca iti vor fi inapoiati.");
766 SCM(x, COLOR_WHITE, "De asemenea, afacerile cu bani reali sau bunuri ce nu tin de joc(conturi steam, conturi pe alte server) sunt interzise.");
767 SCM(x, COLOR_WHITE, "Daca cineva iti propune sa cumperi o masina in joc pentru bani reali, te sfatuim sa-l raportezi folosind comanda /report.");
768 SCM(x, COLOR_WHITE, "Playerii ce promit ca iti vor vinde bunuri in joc pentru bani reali nu iti vor da bunurile promise.");
769 }
770 case 1: {
771 SCM(x, COLOR_WHITE, "This is the Los Santos Bank. There is also a bank in Las Venturas.");
772 SCM(x, COLOR_WHITE, "The bank can be used to deposit and withdraw money from your bank account or transfer money to another player.");
773 SCM(x, COLOR_WHITE, "You'll get interest from the bank for the money you have deposited in your bank account.");
774 SCM(x, COLOR_WHITE, "Don't loan money for other players. You'll have no guaratees that you'll get them back.");
775 SCM(x, COLOR_WHITE, "Also, buying in game goods(money, cars, houses) with real life money from other players is forbidden.");
776 SCM(x, COLOR_WHITE, "Most People that offering in game goods for real money are scammers.");
777 SCM(x, COLOR_WHITE, "You can get some stuff by donating(broh.good2play.ro/panel/premium). The money from donations are used to support the server.");
778 }
779 }
780 }
781 else if(TutTime[x] == 87)
782 {
783 PlayerTextDrawShow(x, TutorialTD[0]),PlayerTextDrawSetString(x, TutorialTD[0], "~w~Step: ~r~8~w~/~r~8");
784 SetPlayerPos(x, 1093.7021,-1485.0731,15.7074);
785 SetPlayerCameraPos(x, 2128.2759,2006.7404,41.0071);
786 SetPlayerCameraLookAt(x, 2079.0659,2044.9436,11.0579);
787 SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, "");
788 switch(P_DATA[x][pLanguage]) {
789 case 2: {
790 SCM(x, COLOR_WHITE, "Aici este CNN Las Venturas, adica locul unde poti plasa anunturi pe server.");
791 SCM(x, COLOR_WHITE, "Anunturile sunt vazute de toti playerii de pe server si sunt folosite pentru a vinde/cumpara/schimba bunuri pe server.");
792 SCM(x, COLOR_WHITE, "Anunturile se folosesc doar pentru vanzari, cumparari si schimburi de bunuri.");
793 SCM(x, COLOR_WHITE, "Vei putea scrie un anunt incepand cu level 5.");
794 SCM(x, COLOR_WHITE, "Si pe forumul nostru good2play.ro/forum exista o sectiune de vanzari unde playerii pot posta anunturi.");
795 }
796 case 1: {
797 SCM(x, COLOR_WHITE, "This is CNN Los Santos, the place where players can place ads to buy, sell or trade stuff.");
798 SCM(x, COLOR_WHITE, "This ads are seen by all players on the server. You'll be able to place an /ad once you reach level 5.");
799 SCM(x, COLOR_WHITE, "Players can also use our forum (good2play.ro/forum) to advertise for stuff.");
800 }
801 }
802 }
803 if(TutTime[x] == 99)
804 {
805 PlayerTextDrawHide(x, TutorialTD[0]),PlayerTextDrawHide(x, TutorialTD[1]);
806 SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, ""),SCM(x, COLOR_WHITE, "");
807 switch(P_DATA[x][pLanguage]) {
808 case 2: {
809 SCM(x, COLOR_YELLOW, "Ai ajuns la sfarsitul tutorialului. Daca ai fost atent, ar trebui sa stii cateva lucruri despre joc.");
810 SCM(x, COLOR_YELLOW, "Daca ai vreo intrebare legata de joc, foloseste /n si helperii vor incerca sa te ajute.");
811 SCM(x, COLOR_YELLOW, "Poti folosi si /help pentru comenzi de baza.");
812 SCM(x, COLOR_YELLOW, "Ai primit din partea stafului 15.000.000$, 20premium points. Distractie placuta!");
813 }
814 case 1: {
815 SCM(x, COLOR_YELLOW, "We reached the end of the tutorial. We hope you learned something about the game.");
816 SCM(x, COLOR_YELLOW, "If you have any game-questions, you can use /n and our helpers will try to help you.");
817 SCM(x, COLOR_YELLOW, "You cand also use /help for basic commands.");
818 SCM(x, COLOR_YELLOW, "Have fun!");
819 }
820 }
821 P_DATA[x][pCheckpoint] = 43;
822 SetPlayerCheckpoint(x, 1930.8121,1346.1381,9.9688, 4.0),StopAudioStreamForPlayer(x);
823 }
824 else if(TutTime[x] == 101)
825 {
826 TutTime[x] = 0; P_DATA[x][pTutorial] = 1;
827 TogglePlayerControllable(x, 1),SetCameraBehindPlayer(x),TogglePlayerSpectating(x, 0);
828 SpawnPlayer(x);
829 ResetPlayerMoney(x),GivePlayerMoney(x,10000);
830 SetPlayerInterior(x,0),SetPlayerVirtualWorld(x,0),TogglePlayerControllable(x,true);
831 new str1[256];
832 mysql_format(SQL,str1,256,"UPDATE playeraccounts SET `playerFirstLogin`='0',`playerMoney`='10000' WHERE `playerName`='%s'",P_DATA[x][pNormalName]);
833 mysql_tquery(SQL,str1,"","");
834 SetSpawnInfo(x, 0, 250,SERVER_SPAWN,0,0,0,0,0,0,0);
835 SpawnPlayer(x);
836 }
837 }
838 if(P_DATA[x][pFishing] >= 1) {
839 P_DATA[x][pFishing]++;
840 /*SetProgressBarValue(P_DATA[x][pFishingBar], GetProgressBarValue(P_DATA[x][pFishingBar])+10);
841 UpdateProgressBar(P_DATA[x][pFishingBar], x);*/
842
843 if(P_DATA[x][pFishing] == 10) {
844 //HideProgressBarForPlayer(x, P_DATA[x][pFishingBar]);
845 //DestroyProgressBar(P_DATA[x][pFishingBar]);
846
847 new
848 msgSz[32],
849 randFish = random(5);
850
851 P_DATA[x][pFish] = randFish;
852
853 format(msgSz, sizeof(msgSz), "You have reeled in a %s.", fishNames[randFish]);
854 SendClientMessage(x, COLOR_WHITE, msgSz);
855
856 switch(randFish) {
857 case 0: SendClientMessage(x, COLOR_WHITE, "The fish that you collected is worth $1000. To sell your fish, please visit a 24/7.");
858 case 1: SendClientMessage(x, COLOR_WHITE, "The fish that you collected is worth $750. To sell your fish, please visit a 24/7.");
859 case 2: SendClientMessage(x, COLOR_WHITE, "The fish that you collected is worth $250. To sell your fish, please visit a 24/7.");
860 case 3: SendClientMessage(x, COLOR_WHITE, "The fish that you collected is worth $900. To sell your fish, please visit a 24/7.");
861 case 4: SendClientMessage(x, COLOR_WHITE, "The fish that you collected is worth $500. To sell your fish, please visit a 24/7.");
862 }
863
864 P_DATA[x][pJobDelay] = 900;
865 }
866 }
867
868 if(P_DATA[x][pSpectating] != INVALID_PLAYER_ID) { // OnPlayerInteriorChange doesn't work properly when spectating.
869 if(GetPlayerInterior(x) != GetPlayerInterior(P_DATA[x][pSpectating])){
870 SetPlayerInterior(x, GetPlayerInterior(P_DATA[x][pSpectating]));
871 }
872 if(GetPlayerVirtualWorld(x) != GetPlayerVirtualWorld(P_DATA[x][pSpectating])){
873 SetPlayerVirtualWorld(x, GetPlayerVirtualWorld(P_DATA[x][pSpectating]));
874 }
875 }
876
877 if(P_DATA[x][pMatrunTime] >= 1) {
878 P_DATA[x][pMatrunTime]++;
879 }
880
881 if(P_DATA[x][pJobDelay] >= 1) {
882 P_DATA[x][pJobDelay]--;
883 if(P_DATA[x][pJobDelay] == 0) SendClientMessage(x, COLOR_WHITE, "Your job reload time is over.");
884 }
885
886 if(P_DATA[x][pNewbieTimeout] > 0) {
887 P_DATA[x][pNewbieTimeout]--;
888 if(P_DATA[x][pNewbieTimeout] == 0) SendClientMessage(x, COLOR_WHITE, "You may now speak in the newbie chat channel again.");
889 }
890
891 if(P_DATA[x][pHackWarnings] >= 1) {
892 P_DATA[x][pHackWarnTime]++;
893
894 if(P_DATA[x][pHackWarnTime] >= 10) {
895 P_DATA[x][pHackWarnings] = 0;
896 P_DATA[x][pHackWarnTime] = 0;
897 }
898 }
899
900 if(P_DATA[x][pDropCarTimeout] >= 1) {
901 P_DATA[x][pDropCarTimeout]--;
902 if(P_DATA[x][pDropCarTimeout] == 1) {
903 P_DATA[x][pDropCarTimeout] = 0;
904 SendClientMessage(x, COLOR_WHITE, "You can now drop vehicles again at the crane.");
905 }
906 }
907
908 if(P_DATA[x][pSkinSet] >= 1) {
909 P_DATA[x][pSkinSet]++;
910 if(P_DATA[x][pSkinSet] == 3 && GetPlayerSkin(x) != P_DATA[x][pSkin]) {
911 SetPlayerSkin(x, P_DATA[x][pSkin]); // Set the skin first.
912 }
913 if(P_DATA[x][pSkinSet] == 4) {
914 givePlayerWeapons(x); // Then give the player their weapons. Seems like a SA-MP bug? Pain in the arse might I add!
915 P_DATA[x][pSkinSet] = 0;
916 TogglePlayerControllable(x, true);
917 }
918 }
919
920 if(P_DATA[x][pFreezeTime] != 0) {
921 TogglePlayerControllable(x, 0);
922 if(P_DATA[x][pFreezeType] == 5) ApplyAnimation(x, "FAT", "IDLE_TIRED", 4.1, 1, 1, 1, 1, 0, 1);
923 if(P_DATA[x][pFreezeTime] > 0) {
924 P_DATA[x][pFreezeTime]--;
925 if(P_DATA[x][pFreezeTime] == 0) {
926 if(P_DATA[x][pFreezeType] == 5) {
927 SetPlayerDrunkLevel(x, 0);
928 ClearAnimations(x);
929 }
930 P_DATA[x][pFreezeType] = 0;
931 TogglePlayerControllable(x, true);
932 }
933 }
934
935 }
936
937 if(P_DATA[x][pPrisonID] > 0) {
938 new
939 messageString[128];
940
941 P_DATA[x][pPrisonTime]--;
942
943 switch(P_DATA[x][pPrisonID]) {
944 case 1: {
945 format(messageString, sizeof(messageString), "~n~~n~~n~~n~~n~~n~~n~ ~r~Prisoned!~n~~w~%d seconds (%d minutes) left", P_DATA[x][pPrisonTime], P_DATA[x][pPrisonTime]/60);
946 }
947 case 2, 3: { // We're going to be using 3 for IC jail, so... yeah
948 format(messageString, sizeof(messageString), "~n~~n~~n~~n~~n~~n~~n~ ~r~Jailed!~n~~w~%d seconds (%d minutes) left", P_DATA[x][pPrisonTime], P_DATA[x][pPrisonTime]/60);
949 }
950 }
951
952 GameTextForPlayer(x, messageString, 2000, 3); // Always specify the game text time longer than the intended time; it always fades out before it should, causing an annoying flash.
953
954 if(P_DATA[x][pPrisonTime] == 1 && P_DATA[x][pPrisonID] >= 1) {
955 P_DATA[x][pPrisonID] = 0;
956 P_DATA[x][pPrisonTime] = 0;
957 SendClientMessage(x, COLOR_WHITE, "Your time is up! You have been released from jail/prison.");
958 SetPlayerPos(x, 738.9963, -1417.2211, 13.5234);
959 SetPlayerVirtualWorld(x, 0);
960 SetPlayerInterior(x, 0);
961 }
962 }
963
964 if(P_DATA[x][pSpamCount] >= 1) P_DATA[x][pSpamCount]--;
965
966 if(P_DATA[x][pSpamCount] >= 5 && P_DATA[x][pAdmin] == 0) {
967 P_DATA[x][pMuted] = 10;
968 P_DATA[x][pSpamCount] = 0;
969 SendClientMessage(x, COLOR_GREY, "You have been auto-muted for spamming. You will be unmuted in 10 seconds.");
970 }
971
972 if(P_DATA[x][pSeconds] >= 3600) {
973
974 P_DATA[x][pSeconds] = 0;
975 P_DATA[x][pPlayingHours]++;
976
977 new
978 string[128],
979 BankInterest = P_DATA[x][pBankMoney] / 1000,
980 RandPay = (random(495) + 5) * (P_DATA[x][pPlayingHours]/60) + random(5000) + 500,
981 TotalPay = BankInterest + RandPay;
982
983 if(P_DATA[x][pBankMoney]+P_DATA[x][pMoney] > -5000000) {
984 SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");
985 SendClientMessage(x, COLOR_WHITE, "Your paycheck has arrived; please visit the bank to withdraw your money.");
986 P_DATA[x][pBankMoney] += TotalPay;
987 new taxamount = ((TotalPay/100) * assetVariables[1][aAssetValue]);
988 if(taxamount > 1) {
989 P_DATA[x][pBankMoney] -= taxamount;
990 groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] += taxamount;
991 saveGroup(GOVERNMENT_GROUP_ID);
992 }
993 format(string, sizeof(string), "Paycheck: $%d | Bank balance: $%d | Bank interest: $%d | Tax: $%d (%d percent) | Total earnings: $%d", RandPay, P_DATA[x][pBankMoney], BankInterest, taxamount, assetVariables[1][aAssetValue], TotalPay-taxamount);
994 SendClientMessage(x, COLOR_GREY, string);
995 SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");
996
997 savePlayerData(x);
998 }
999 else {
1000 SendClientMessage(x, COLOR_WHITE, "You're too poor to obtain a paycheck.");
1001 }
1002 }
1003
1004 if(GetPlayerMoney(x) != P_DATA[x][pMoney]) {
1005 ResetPlayerMoney(x);
1006 GivePlayerMoney(x, P_DATA[x][pMoney]);
1007 }
1008 }
1009 }
1010
1011 return true;
1012}
1013
1014task antiCheat[1000]() {
1015 foreach(new i : Player) {
1016 if(P_DATA[i][pStatus] >= 1) {
1017 if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && P_DATA[i][pJetpack] == 0 && P_DATA[i][pAdmin] < 3) {
1018 scriptBan(i, "Hacking (Jetpack)");
1019 }
1020 if(P_DATA[i][pAdmin] < 3 && P_DATA[i][pEvent] == 0 && P_DATA[i][pAnticheatExemption] == 0) {
1021 if(GetPlayerWeapon(i) >= 1 && GetPlayerState(i) == 1) {
1022 if(P_DATA[i][pWeapons][0] != 1 && GetPlayerWeapon(i) == 1) hackerTrigger(i);
1023
1024 if(P_DATA[i][pWeapons][1] != 2 && GetPlayerWeapon(i) == 2) hackerTrigger(i);
1025 if(P_DATA[i][pWeapons][1] != 3 && GetPlayerWeapon(i) == 3) hackerTrigger(i);
1026 if(P_DATA[i][pWeapons][1] != 4 && GetPlayerWeapon(i) == 4) hackerTrigger(i);
1027 if(P_DATA[i][pWeapons][1] != 5 && GetPlayerWeapon(i) == 5) hackerTrigger(i);
1028 if(P_DATA[i][pWeapons][1] != 6 && GetPlayerWeapon(i) == 6) hackerTrigger(i);
1029 if(P_DATA[i][pWeapons][1] != 7 && GetPlayerWeapon(i) == 7) hackerTrigger(i);
1030 if(P_DATA[i][pWeapons][1] != 8 && GetPlayerWeapon(i) == 8) hackerTrigger(i);
1031 if(P_DATA[i][pWeapons][1] != 9 && GetPlayerWeapon(i) == 9) hackerTrigger(i);
1032
1033 if(P_DATA[i][pWeapons][2] != 22 && GetPlayerWeapon(i) == 22) hackerTrigger(i);
1034 if(P_DATA[i][pWeapons][2] != 23 && GetPlayerWeapon(i) == 23) hackerTrigger(i);
1035 if(P_DATA[i][pWeapons][2] != 24 && GetPlayerWeapon(i) == 24) hackerTrigger(i);
1036
1037 if(P_DATA[i][pWeapons][3] != 25 && GetPlayerWeapon(i) == 25) hackerTrigger(i);
1038 if(P_DATA[i][pWeapons][3] != 26 && GetPlayerWeapon(i) == 26) hackerTrigger(i);
1039 if(P_DATA[i][pWeapons][3] != 27 && GetPlayerWeapon(i) == 27) hackerTrigger(i);
1040
1041 if(P_DATA[i][pWeapons][4] != 28 && GetPlayerWeapon(i) == 28) hackerTrigger(i);
1042 if(P_DATA[i][pWeapons][4] != 29 && GetPlayerWeapon(i) == 29) hackerTrigger(i);
1043 if(P_DATA[i][pWeapons][4] != 32 && GetPlayerWeapon(i) == 32) hackerTrigger(i);
1044
1045 if(P_DATA[i][pWeapons][5] != 30 && GetPlayerWeapon(i) == 30) hackerTrigger(i);
1046 if(P_DATA[i][pWeapons][5] != 31 && GetPlayerWeapon(i) == 31) hackerTrigger(i);
1047
1048 if(P_DATA[i][pWeapons][6] != 33 && GetPlayerWeapon(i) == 33) hackerTrigger(i);
1049 if(P_DATA[i][pWeapons][6] != 34 && GetPlayerWeapon(i) == 34) hackerTrigger(i);
1050
1051 if(P_DATA[i][pWeapons][7] != 35 && GetPlayerWeapon(i) == 35) hackerTrigger(i);
1052 if(P_DATA[i][pWeapons][7] != 36 && GetPlayerWeapon(i) == 36) hackerTrigger(i);
1053 if(P_DATA[i][pWeapons][7] != 37 && GetPlayerWeapon(i) == 37) hackerTrigger(i);
1054 if(P_DATA[i][pWeapons][7] != 38 && GetPlayerWeapon(i) == 38) hackerTrigger(i);
1055
1056 if(P_DATA[i][pWeapons][8] != 16 && GetPlayerWeapon(i) == 16) hackerTrigger(i);
1057 if(P_DATA[i][pWeapons][8] != 17 && GetPlayerWeapon(i) == 17) hackerTrigger(i);
1058 if(P_DATA[i][pWeapons][8] != 18 && GetPlayerWeapon(i) == 18) hackerTrigger(i);
1059 if(P_DATA[i][pWeapons][8] != 39 && GetPlayerWeapon(i) == 39) hackerTrigger(i);
1060
1061 if(P_DATA[i][pWeapons][9] != 41 && GetPlayerWeapon(i) == 41) hackerTrigger(i);
1062 if(P_DATA[i][pWeapons][9] != 42 && GetPlayerWeapon(i) == 42) hackerTrigger(i);
1063 if(P_DATA[i][pWeapons][9] != 43 && GetPlayerWeapon(i) == 43) hackerTrigger(i);
1064
1065 if(P_DATA[i][pWeapons][10] != 10 && GetPlayerWeapon(i) == 10) hackerTrigger(i);
1066 if(P_DATA[i][pWeapons][10] != 11 && GetPlayerWeapon(i) == 11) hackerTrigger(i);
1067 if(P_DATA[i][pWeapons][10] != 12 && GetPlayerWeapon(i) == 12) hackerTrigger(i);
1068 if(P_DATA[i][pWeapons][10] != 13 && GetPlayerWeapon(i) == 13) hackerTrigger(i);
1069 if(P_DATA[i][pWeapons][10] != 14 && GetPlayerWeapon(i) == 14) hackerTrigger(i);
1070 if(P_DATA[i][pWeapons][10] != 15 && GetPlayerWeapon(i) == 15) hackerTrigger(i);
1071
1072 if(P_DATA[i][pWeapons][11] != 44 && GetPlayerWeapon(i) == 44) hackerTrigger(i);
1073 if(P_DATA[i][pWeapons][11] != 45 && GetPlayerWeapon(i) == 45) hackerTrigger(i);
1074 if(P_DATA[i][pWeapons][11] != 46 && GetPlayerWeapon(i) == 46) hackerTrigger(i);
1075
1076 if(P_DATA[i][pWeapons][12] != 40 && GetPlayerWeapon(i) == 40) hackerTrigger(i);
1077 }
1078 }
1079 }
1080 }
1081
1082 return 1;
1083}
1084
1085task AFKTimer[60000]() {
1086 foreach(new i : Player) {
1087 if(P_DATA[i][pAdmin] < 1) {
1088 GetPlayerPos(i, PlayerPos[i][0], PlayerPos[i][1], PlayerPos[i][2]);
1089 PlayerPos[i][3] = PlayerPos[i][0];
1090 PlayerPos[i][4] = PlayerPos[i][1];
1091 PlayerPos[i][5] = PlayerPos[i][2];
1092 }
1093 }
1094
1095 return 1;
1096}
1097task CheckVehicles[5000]() {
1098 foreach(new playerid : Player)
1099 {
1100 if(CP[playerid] == FIND_VEHICLE && FollowingCP[playerid] == true)
1101 {
1102 new Float: pos[3];
1103 GetVehiclePos(P_DATA[playerid][pVeh][GetPVarInt(playerid, "toFindVehicle")], pos[0], pos[1], pos[2]);
1104 SetPlayerCheckpoint(playerid, pos[0], pos[1], pos[2], 5.0);
1105 }
1106 for(new x = 0; x < P_DATA[playerid][v_Slots]; x++)
1107 {
1108 if(P_DATA[playerid][v_SQL][x] == 0 || P_DATA[playerid][v_Spawned][x] == 0)
1109 continue;
1110
1111 if(P_DATA[playerid][v_Spawned][x] < gettime() && !IsVehicleOccupied(P_DATA[playerid][pVeh][x]))
1112 {
1113 DespawnVehicle(playerid, x);
1114 SCM(playerid, -1, ""B"(Server)"W": Your vehicle was despawned because of unusage !");
1115 }
1116 else P_DATA[playerid][v_Spawned][x] = gettime() + MAX_SPAWNED_TIME;
1117 }
1118 }
1119 return 1;
1120}
1121task KMCounter[1000]() {
1122 new Float: pos[3], Float: dist;
1123 foreach(new v : pVehs)
1124 {
1125 if(!IsVehicleOccupied(v))
1126 continue;
1127
1128 pos[0] = vP[v][0];
1129 pos[1] = vP[v][1];
1130 pos[2] = vP[v][2];
1131
1132 GetVehiclePos(v, vP[v][0], vP[v][1], vP[v][2]);
1133 pos[0] -= vP[v][0];
1134 pos[1] -= vP[v][1];
1135 pos[2] -= vP[v][2];
1136
1137 dist = ((floatsqroot((pos[0] * pos[0]) + (pos[1] * pos[1]))) / 1000.0);
1138 if(dist < 1){
1139 V_DATA[v][vKM] += dist;
1140 }
1141 }
1142 return 1;
1143}
1144public OnGameModeInit() {
1145 AntiDeAMX();
1146
1147 #if defined DEBUG
1148 mysql_debug(1);
1149 #endif
1150
1151 mysql_query(SQL, "UPDATE playeraccounts SET playerStatus = '0' WHERE playerStatus = '1'");
1152
1153 scriptTimers[0] = globalPlayerLoop();
1154 scriptTimers[1] = antiCheat();
1155 scriptTimers[2] = AFKTimer();
1156 scriptTimers[3] = CheckVehicles();
1157 scriptTimers[4] = KMCounter();
1158
1159 initiateConnections();
1160 initiateVehicleSpawns();
1161 initiateHouseSpawns();
1162 initiateJobs();
1163 initiateGroups();
1164 initiateAssets();
1165 initiateBusinesses();
1166
1167 ShowPlayerMarkers(0);
1168 EnableStuntBonusForAll(0);
1169 DisableInteriorEnterExits();
1170 UsePlayerPedAnims();
1171
1172 SetGameModeText(SERVER_VERSION);
1173
1174 weatherVariables[0] = validWeatherIDs[random(sizeof(validWeatherIDs))];
1175 SetWeather(weatherVariables[0]);
1176
1177 textdrawVariables[3] = TextDrawCreate(149.000000, 370.000000, "Press ~r~left~w~ to go back a step~n~press ~r~right~w~ arrow to proceed ~n~press ~r~ ~k~~VEHICLE_ENTER_EXIT~ to skip the tutorial");
1178 TextDrawBackgroundColor(textdrawVariables[3], 255);
1179 TextDrawFont(textdrawVariables[3], 2);
1180 TextDrawLetterSize(textdrawVariables[3], 0.390000, 1.200000);
1181 TextDrawColor(textdrawVariables[3], -1);
1182 TextDrawSetOutline(textdrawVariables[3], 0);
1183 TextDrawSetProportional(textdrawVariables[3], 1);
1184 TextDrawSetShadow(textdrawVariables[3], 1);
1185
1186 textdrawVariables[4] = TextDrawCreate(149.000000, 420.000000, "Press ~r~~k~~SNEAK_ABOUT~~w~ to quit the spectator tool."); // Moved it down a little, it was actually fairly obtrusive.
1187 TextDrawBackgroundColor(textdrawVariables[4], 255);
1188 TextDrawFont(textdrawVariables[4], 2);
1189 TextDrawLetterSize(textdrawVariables[4], 0.390000, 1.200000);
1190 TextDrawColor(textdrawVariables[4], -1);
1191 TextDrawSetOutline(textdrawVariables[4], 0);
1192 TextDrawSetProportional(textdrawVariables[4], 1);
1193 TextDrawSetShadow(textdrawVariables[4], 1);
1194
1195 textdrawVariables[5] = TextDrawCreate(610.0, 420.0, "Type ~r~/stopanim~w~ to stop your animation.");
1196 TextDrawUseBox(textdrawVariables[5], 0);
1197 TextDrawFont(textdrawVariables[5], 2);
1198 TextDrawSetShadow(textdrawVariables[5], 0);
1199 TextDrawSetOutline(textdrawVariables[5], 1);
1200 TextDrawBackgroundColor(textdrawVariables[5], 0x000000FF);
1201 TextDrawColor(textdrawVariables[5], 0xFFFFFFFF);
1202 TextDrawAlignment(textdrawVariables[5], 3);
1203
1204 textdrawVariables[6] = TextDrawCreate(610.0, 420.0, "Press ~r~DOWN~w~ to return to your previous position");
1205 TextDrawUseBox(textdrawVariables[6], 0);
1206 TextDrawFont(textdrawVariables[6], 2);
1207 TextDrawSetShadow(textdrawVariables[6], 0);
1208 TextDrawSetOutline(textdrawVariables[6], 1);
1209 TextDrawBackgroundColor(textdrawVariables[6], 0x000000FF);
1210 TextDrawColor(textdrawVariables[6], 0xFFFFFFFF);
1211 TextDrawAlignment(textdrawVariables[6], 3);
1212
1213 CreateDynamic3DTextLabel("Materials Pickup!\n\nType /getmats as an Arms Dealer \nto collect materials!", COLOR_YELLOW, 1423.9871, -1319.2954, 13.5547, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
1214 CreateDynamicPickup(1239, 23, 1423.9871, -1319.2954, 13.5547, 0, -1, -1, 50);
1215 Create3DTextLabel("Driving School!\n \nType /exam\nto start the test!",0xFFFF00D1,1930.8121,1346.1381,9.9688, 15.0, 0, 0);
1216 CreatePickup(1239, 23, 1930.8121,1346.1381,9.9688);
1217 /* -------------------------------------- Mapping shit (objects, static 3D texts, static pickups) -------------------------------------- */
1218
1219 /* Bank */
1220 CreateDynamicPickup(1239, 23, 595.5443,-1250.3405,18.2836, 0, -1, -1, 50);
1221 CreateDynamic3DTextLabel("Bank of Los Santos\nPress CROUCH to enter", COLOR_YELLOW, 595.5443,-1250.3405,18.2836, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
1222 /* /arrest */
1223 CreateDynamic3DTextLabel("Los Santos Police Department\nProcessing Entrance\n\n(/arrest)", COLOR_COOLBLUE, 1528.5240,-1678.2472,5.8906, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 15.0);
1224
1225 /* Exterior LSPD gates */
1226 LSPDGates[0][0] = CreateDynamicObject(968, 1544.681640625, -1630.8924560547, 13.15, 0.0, 90.0, 90.0, 0, 0, _, 200.0);
1227 LSPDGates[1][0] = CreateDynamicObject(10184,1589.19995117,-1637.98498535,14.69999981,0.00000000,0.00000000,270.00000000, 0, 0, _, 200.0);
1228
1229 /* LSPD doors */
1230 LSPDObjs[0][0] = CreateDynamicObject(1569,232.89999390,107.57499695,1009.21179199,0.00000000,0.00000000,90.00000000, _, 10, _, 200.0); //commander south
1231 LSPDObjs[0][1] = CreateDynamicObject(1569,232.89941406,110.57499695,1009.21179199,0.00000000,0.00000000,270.00000000, _, 10, _, 200.0); //commander north
1232 LSPDObjs[1][0] = CreateDynamicObject(1569,275.75000000,118.89941406,1003.61718750,0.00000000,0.00000000,270.00000000, _, 10, _, 200.0); // interrogation north
1233 LSPDObjs[1][1] = CreateDynamicObject(1569,275.75000000,115.89941406,1003.61718750,0.00000000,0.00000000,90.00000000, _, 10, _, 200.0); // interrogation south
1234 LSPDObjs[2][0] = CreateDynamicObject(1569,253.20410156,107.59960938,1002.22070312,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); // north west lobby door
1235 LSPDObjs[2][1] = CreateDynamicObject(1569,253.19921875,110.59960938,1002.22070312,0.00000000,0.00000000,270.00000000, _,10, _, 200.0); // north east lobby door
1236 LSPDObjs[3][0] = CreateDynamicObject(1569,239.56933594,116.09960938,1002.22070312,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); // south west lobby door
1237 LSPDObjs[3][1] = CreateDynamicObject(1569,239.56445312,119.09960938,1002.22070312,0.00000000,0.00000000,269.98901367, _,10, _, 200.0); // south east lobby door
1238 LSPDObjs[4][0] = CreateDynamicObject(1569,264.45019531,115.82421875,1003.62286377,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorext15) (3)
1239 LSPDObjs[4][1] = CreateDynamicObject(1569,267.45214844,115.82910156,1003.62286377,0.00000000,0.00000000,179.99450684, _,10, _, 200.0); //object(gen_doorext15) (8)
1240 LSPDObjs[5][0] = CreateDynamicObject(1569,267.32000732,112.53222656,1003.62286377,0.00000000,0.00000000,179.99450684, _,10, _, 200.0); //object(gen_doorext15) (4)
1241 LSPDObjs[5][1] = CreateDynamicObject(1569,264.32000732,112.52929688,1003.62286377,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorext15) (5)
1242 LSPDObjs[6][0] = CreateDynamicObject(1569,229.59960938,119.52929688,1009.22442627,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorext15) (9)
1243 LSPDObjs[6][1] = CreateDynamicObject(1569,232.59960938,119.53515625,1009.22442627,0.00000000,0.00000000,179.99450684, _,10, _, 200.0); //object(gen_doorext15) (10)
1244 LSPDObjs[7][0] = CreateDynamicObject(1569,219.30000305,116.52999878,998.01562500,0.00000000,0.00000000,180.00000000, _,10, _, 200.0); //cell east door
1245 LSPDObjs[7][1] = CreateDynamicObject(1569,216.30000305,116.52929688,998.01562500,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //cell west door
1246
1247 /* LSPD interior objects (1st version) */
1248 CreateDynamicObject(1886,240.39999390,107.69999695,1010.70001221,35.00000000,0.00000000,135.00000000, _,10, _, 200.0); //object(nt_securecam1_01) (1)
1249 CreateDynamicObject(2058,262.23831177,107.09999847,1006.12506104,270.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(cj_gun_docs) (1)
1250 CreateDynamicObject(1491,222.17500305,119.45999908,1009.21502686,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorint01) (1)
1251 CreateDynamicObject(1491,258.54980469,117.67968750,1007.82000732,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorint01) (3)
1252 CreateDynamicObject(1491,260.73925781,117.67968750,1007.82000732,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorint01) (4)
1253 CreateDynamicObject(2612,263.50000000,112.34960938,1005.50000000,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(police_nb2) (1)
1254 CreateDynamicObject(3857,233.04499817,124.00000000,1013.00000000,0.00000000,0.00000000,315.00000000, _,10, _, 200.0); //object(ottosmash3) (1)
1255 CreateDynamicObject(3857,232.73730469,124.00000000,1013.00000000,0.00000000,0.00000000,135.00012207, _,10, _, 200.0); //object(ottosmash3) (2)
1256 CreateDynamicObject(1491,225.05999756,115.94999695,1002.22998047,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorint01) (2)
1257 CreateDynamicObject(1491,233.11000061,119.25000000,1002.22998047,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorint01) (5)
1258 CreateDynamicObject(1491,236.80957031,119.25000000,1002.22998047,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gen_doorint01) (6)
1259 CreateDynamicObject(3051,275.77499390,122.65599823,1004.97937012,0.00000000,0.00000000,46.00000000, _,10, _, 200.0); //object(lift_dr) (1)
1260 CreateDynamicObject(3051,275.75000000,121.50000000,1004.97937012,0.00000000,0.00000000,45.00000000, _,10, _, 200.0); //object(lift_dr) (2)
1261 CreateDynamicObject(1485,227.89999390,125.30000305,1010.21002197,50.00000000,10.00000000,2.00000000, _,10, _, 200.0); //object(cj_ciggy) (1)
1262 CreateDynamicObject(1510,228.07321167,125.27845001,1010.15997314,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(dyn_ashtry) (1)
1263 CreateDynamicObject(2196,228.40014648,125.53178406,1010.13958740,0.00000000,0.00000000,29.77478027, _,10, _, 200.0); //object(work_lamp1) (1)
1264 CreateDynamicObject(2063,262.95996094,107.40136719,1004.53997803,0.00000000,0.00000000,179.99450684, _,10, _, 200.0); //object(cj_greenshelves) (1)
1265 CreateDynamicObject(2043,262.29138184,107.46166229,1004.09997559,0.00000000,0.00000000,294.36035156, _,10, _, 200.0); //object(ammo_box_m4) (1)
1266 CreateDynamicObject(353,262.79998779297,107.68000030518,1004.9,91.9,89,240, _,10, _, 200.0); //object(cj_mp5k) (2)
1267 CreateDynamicObject(1672,262.62597656,107.59999847,1005.37500000,0.00000000,90.00000000,0.00000000, _,10, _, 200.0); //object(gasgrenade) (1)
1268 CreateDynamicObject(1672,262.81585693,107.48020935,1005.41998291,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(gasgrenade) (2)
1269 CreateDynamicObject(14782,267.76998901,109.30000305,1004.63323975,0.00000000,0.00000000,270.00000000, _,10, _, 200.0); //object(int3int_boxing30) (2)
1270 CreateDynamicObject(14782,260.79980469,108.75000000,1004.63323975,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); //object(int3int_boxing30) (3)
1271 CreateDynamicObject(2359,263.54296875,107.39648438,1005.53002930,0.00000000,0.00000000,183.89465332, _,10, _, 200.0); //object(ammo_box_c5) (1)
1272 CreateDynamicObject(2038,263.47906494,107.32552338,1004.51000977,270.00000000,0.00000000,29.91000366, _,10, _, 200.0); //object(ammo_box_s2) (1)
1273 CreateDynamicObject(356,262.60000610352,107.30000305176,1004.4799804688,96, 90, 290, _,10, _, 200.0); //object(cj_m16) (1)
1274 CreateDynamicObject(2690,267.92782593,108.53081512,1003.97998047,0.00000000,0.00000000,312.13256836, _,10, _, 200.0); //object(cj_fire_ext) (1)
1275 CreateDynamicObject(2058,262.98568726,107.09528351,1005.36926270,90.00000000,180.00549316,359.98352051, _,10, _, 200.0); //object(cj_gun_docs) (1)
1276 CreateDynamicObject(11631,269.81250000,118.18945312,1004.86309814,0.00000000,0.00000000,270.00000000, _,10, _, 200.0); //object(ranch_desk) (1)
1277 CreateDynamicObject(2356,269.14312744,117.66873169,1003.61718750,0.00000000,0.00000000,294.49548340, _,10, _, 200.0); //object(police_off_chair) (1)
1278 CreateDynamicObject(2094,262.86523438,110.89941406,1003.60998535,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(swank_cabinet_4) (1)
1279 CreateDynamicObject(1886,267.73999023,107.50000000,1007.40002441,20.00000000,0.00000000,235.00000000, _,10, _, 200.0); //object(shop_sec_cam) (1)
1280 CreateDynamicObject(2606,267.36914062,120.50683594,1004.59997559,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(cj_police_counter2) (1)
1281 CreateDynamicObject(2606,267.36914062,120.50683594,1005.04998779,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(cj_police_counter2) (2)
1282 CreateDynamicObject(1738,270.29000854,120.00000000,1004.27178955,0.00000000,0.00000000,269.27026367, _,10, _, 200.0); //object(cj_radiator_old) (1)
1283 CreateDynamicObject(2180,265.50552368,120.27999878,1003.61718750,0.00000000,0.00000000,180.54052734, _,10, _, 200.0); //object(med_office5_desk_3) (1)
1284 CreateDynamicObject(1788,265.60000610,120.50000000,1004.48681641,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(swank_video_1) (1)
1285 CreateDynamicObject(1782,265.59960938,120.50000000,1004.65002441,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(med_video_2) (1)
1286 CreateDynamicObject(2595,264.21002197,120.37789154,1004.77404785,0.00000000,0.00000000,314.65002441, _,10, _, 200.0); //object(cj_shop_tv_video) (1)
1287 CreateDynamicObject(1785,265.59960938,120.50976562,1004.84997559,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(low_video_1) (1)
1288 CreateDynamicObject(1840,264.81204224,120.58029938,1004.41882324,0.00000000,0.00000000,105.60998535, _,10, _, 200.0); //object(speaker_2) (1)
1289 CreateDynamicObject(1840,265.70001221,120.55999756,1004.96264648,0.00000000,0.00000000,75.00000000, _,10, _, 200.0); //object(speaker_2) (2)
1290 CreateDynamicObject(2356,265.15481567,119.43829346,1003.61718750,0.00000000,0.00000000,34.19393921, _,10, _, 200.0); //object(police_off_chair) (2)
1291 CreateDynamicObject(1775,238.87988281,115.59960938,1010.32000732,0.00000000,0.00000000,270.26916504, _,10, _, 200.0); //object(vendmach) (1)
1292 CreateDynamicObject(4100,246.51953125,119.39941406,1005.40002441,0.00000000,179.99450684,219.99023438, _,10, _, 200.0); //object(meshfence1_lan) (1)
1293 CreateDynamicObject(4100,253.19999695,117.80000305,1010.50000000,320.00000000,90.00000000,90.00000000, _,10, _, 200.0); //object(pol_comp_gate) (1)
1294 CreateDynamicObject(2101,266.74893188,120.49598694,1005.28363037,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(med_hi_fi_3) (1)
1295 CreateDynamicObject(1886,264.25000000,116.55000305,1007.29998779,30.00000000,0.00000000,140.00000000, _,10, _, 200.0); //object(shop_sec_cam) (2)
1296 CreateDynamicObject(2611,268.47473145,116.05200195,1005.25000000,0.00000000,0.00000000,180.00000000, _,10, _, 200.0); //object(police_nb1) (1)
1297 CreateDynamicObject(4100,232.84960938,128.50000000,1011.91998291,0.00000000,0.00000000,49.99877930, _,10, _, 200.0); //object(meshfence1_lan) (4)
1298 CreateDynamicObject(2595,226.24514771,120.27544403,1011.28753662,0.00000000,0.00000000,77.72994995, _,10, _, 200.0); //object(cj_shop_tv_video) (2)
1299 CreateDynamicObject(3934,1563.90014648,-1700.00000000,27.40211487,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(helipad01) (2)
1300 CreateDynamicObject(1496,1564.14257812,-1667.36914062,27.39560699,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(gen_doorshop02) (1)
1301 CreateDynamicObject(2953,228.27796936,125.20470428,1010.14331055,0.00000000,0.00000000,143.45983887, _,10, _, 200.0); //object(kmb_paper_code) (1)
1302 CreateDynamicObject(4100,239.60000610,113.19999695,1010.50000000,319.99877930,90.00000000,90.00000000, _,10, _, 200.0); //object(pol_comp_gate) (1)
1303 CreateDynamicObject(2054,263.76342773,112.13343811,1004.64001465,0.00000000,0.00000000,36.00000000, _,10, _, 200.0); //object(cj_capt_hat) (1)
1304 CreateDynamicObject(2053,264.10845947,112.14072418,1004.66998291,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(cj_jerry_hat) (1)
1305 CreateDynamicObject(351,262.85000610352,111.90000152588,1004.6599731445,275,90,106, _,10, _, 200.0); //object(cj_m16) (2)
1306 CreateDynamicObject(2040,262.57006836,112.05036163,1004.72113037,0.00000000,0.00000000,342.13513184, _,10, _, 200.0); //object(ammo_box_m1) (1)
1307 CreateDynamicObject(2068,264.29998779,109.19999695,1007.00000000,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); //object(cj_cammo_net) (1)
1308 CreateDynamicObject(1516,272.90374756,118.44168854,1003.79998779,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(dyn_table_03) (1)
1309 CreateDynamicObject(1810,272.74725342,117.44008636,1003.61718750,0.00000000,0.00000000,183.70996094, _,10, _, 200.0); //object(cj_foldchair) (1)
1310 CreateDynamicObject(1810,273.19308472,119.28445435,1003.61718750,0.00000000,0.00000000,2.00000000, _,10, _, 200.0); //object(cj_foldchair) (2)
1311 CreateDynamicObject(2953,272.84149170,118.41313934,1004.34997559,0.00000000,0.00000000,89.00000000, _,10, _, 200.0); //object(kmb_paper_code) (2)
1312 CreateDynamicObject(2953,272.89001465,118.30000305,1004.34997559,0.00000000,0.00000000,13.00000000, _,10, _, 200.0); //object(kmb_paper_code) (3)
1313 CreateDynamicObject(2196,273.04998779,118.69999695,1004.32000732,0.00000000,0.00000000,335.00000000, _,10, _, 200.0); //object(work_lamp1) (2)
1314 CreateDynamicObject(1886,228.80000305,116.00000000,1002.20001221,10.00000000,0.00000000,290.00000000, _,10, _, 200.0); //object(shop_sec_cam) (3)
1315 CreateDynamicObject(1491,265.17999268,112.68000031,1007.82000732,0.00000000,0.00000000,270.00000000, _,10, _, 200.0); //object(gen_doorint01) (4)
1316 CreateDynamicObject(2954,224.00000000,107.40000153,998.70062256,0.00000000,90.00000000,89.99993896, _,10, _, 200.0); //object(kmb_ot) (1)
1317 CreateDynamicObject(2954,228.19999695,107.39941406,998.70062256,0.00000000,90.00000000,90.00000000, _,10, _, 200.0); //object(kmb_ot) (2)
1318 CreateDynamicObject(2954,220.09960938,107.39941406,998.70062256,0.00000000,90.00000000,89.99996948, _,10, _, 200.0); //object(kmb_ot) (3)
1319 CreateDynamicObject(2954,216.10000610,107.39941406,998.70062256,0.00000000,90.00000000,90.00000000, _,10, _, 200.0); //object(kmb_ot) (4)
1320 CreateDynamicObject(1235,225.47909546,121.89310455,1009.72180176,0.00000000,0.00000000,0.00000000, _,10, _, 200.0); //object(wastebin) (1)
1321 CreateDynamicObject(2602,226.00000000,108.50000000,998.53906250,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); //object(police_cell_toilet) (1)
1322 CreateDynamicObject(2602,214.00000000,108.50000000,998.53906250,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); //object(police_cell_toilet) (2)
1323 CreateDynamicObject(2602,222.09960938,108.50000000,998.53906250,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); //object(police_cell_toilet) (3)
1324 CreateDynamicObject(2602,218.10000610,108.50000000,998.53906250,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); //object(police_cell_toilet) (4)
1325 CreateDynamicObject(8167,218.50000000,112.50000000,999.20001221,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); //object(apgate1_vegs01) (1)
1326 CreateDynamicObject(8167,226.34960938,112.50000000,999.20001221,0.00000000,0.00000000,90.00000000, _,10, _, 200.0); //object(apgate1_vegs01) (2)
1327 CreateDynamicObject(3785,215.50000000,109.90000153,1001.40997314,0.00000000,90.00000000,0.00000000, _,10, _, 200.0); //object(bulkheadlight) (1)
1328 CreateDynamicObject(3785,219.50000000,109.89941406,1001.40997314,0.00000000,90.00000000,0.00000000, _,10, _, 200.0); //object(bulkheadlight) (2)
1329 CreateDynamicObject(3785,223.50000000,109.89941406,1001.40997314,0.00000000,90.00000000,0.00000000, _,10, _, 200.0); //object(bulkheadlight) (3)
1330 CreateDynamicObject(3785,227.50000000,109.89941406,1001.40997314,0.00000000,90.00000000,0.00000000, _,10, _, 200.0); //object(bulkheadlight) (4)
1331
1332 /* Exterior LSPD objects */
1333 CreateDynamicObject(3934,1563.89941406,-1650.34277344,27.40211487,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(helipad01) (2)
1334 CreateDynamicObject(1496,1563.84997559,-1671.13000488,51.45027542,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(gen_doorshop02) (2)
1335 CreateDynamicObject(982,1577.75000000,-1701.50000000,28.07836533,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(fenceshit) (1)
1336 CreateDynamicObject(982,1577.75000000,-1650.30004883,28.07836533,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(fenceshit) (3)
1337 CreateDynamicObject(982,1565.00000000,-1637.50000000,28.07836533,0.00000000,0.00000000,90.00000000, 0, 0, _, 200.0); //object(fenceshit) (4)
1338 CreateDynamicObject(984,1549.02502441,-1637.50000000,28.03879547,0.00000000,0.00000000,90.00000000, 0, 0, _, 200.0); //object(fenceshit2) (1)
1339 CreateDynamicObject(982,1565.00000000,-1714.30004883,28.07836533,0.00000000,0.00000000,90.00000000, 0, 0, _, 200.0); //object(fenceshit) (5)
1340 CreateDynamicObject(982,1577.75000000,-1675.89941406,28.07836533,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(fenceshit) (6)
1341 CreateDynamicObject(984,1549.02441406,-1714.29980469,28.03879547,0.00000000,0.00000000,90.00000000, 0, 0, _, 200.0); //object(fenceshit2) (3)
1342 CreateDynamicObject(983,1550.59997559,-1701.50000000,28.07836533,0.00000000,0.00000000,90.00000000, 0, 0, _, 200.0); //object(fenceshit3) (2)
1343 CreateDynamicObject(984,1542.59960938,-1643.89941406,28.03879547,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(fenceshit2) (6)
1344 CreateDynamicObject(983,1545.79980469,-1701.50000000,28.07836533,0.00000000,0.00000000,90.00000000, 0, 0, _, 200.0); //object(fenceshit3) (3)
1345 CreateDynamicObject(983,1550.59997559,-1650.30004883,28.07836533,0.00000000,0.00000000,90.00000000, 0, 0, _, 200.0); //object(fenceshit3) (4)
1346 CreateDynamicObject(983,1545.79980469,-1650.30004883,28.07836533,0.00000000,0.00000000,90.00000000, 0, 0, _, 200.0); //object(fenceshit3) (5)
1347 CreateDynamicObject(984,1542.59960938,-1707.89941406,28.03879547,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(fenceshit2) (7)
1348 CreateDynamicObject(984,1553.80004883,-1695.09997559,28.03000069,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(fenceshit2) (8)
1349 CreateDynamicObject(984,1553.79980469,-1656.69995117,28.03000069,0.00000000,0.00000000,0.00000000, 0, 0, _, 200.0); //object(fenceshit2) (9)
1350 CreateDynamicObject(983,1544.69995117,-1620.58996582,13.02000046,0.00000000,0.00000000,0.00000000); //object(fenceshit3) (1)
1351 CreateDynamicObject(1331,1544.54602051,-1616.99133301,13.10000038,0.00000000,0.00000000,0.00000000); //object(binnt01_la) (1)
1352 CreateDynamicObject(2952,1582.00000000,-1637.88598633,12.39045906,0.00000000,0.00000000,90.00000000); //object(kmb_gimpdoor) (1)
1353 CreateDynamicObject(983,1544.69921875,-1636.00000000,13.02000046,0.00000000,0.00000000,0.00000000); //object(fenceshit3) (6)
1354 CreateDynamicObject(2952,1582.00000000,-1638.30004883,12.39045906,0.00000000,0.00000000,90.00000000); //object(kmb_gimpdoor) (2)
1355
1356 /* Moar super sexy shit for me */
1357 CreateDynamicObject(2842,2320.79003906,-1021.39941406,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (2)
1358 CreateDynamicObject(2842,2320.79003906,-1023.19921875,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (3)
1359 CreateDynamicObject(2842,2320.79003906,-1025.00000000,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (4)
1360 CreateDynamicObject(2842,2319.87500000,-1019.59997559,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (5)
1361 CreateDynamicObject(2842,2319.87500000,-1017.79998779,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (6)
1362 CreateDynamicObject(2842,2319.87500000,-1016.00000000,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (7)
1363 CreateDynamicObject(2842,2319.87500000,-1014.20001221,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (8)
1364 CreateDynamicObject(2842,2319.87500000,-1012.40002441,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (9)
1365 CreateDynamicObject(2842,2319.87500000,-1010.59997559,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (10)
1366 CreateDynamicObject(2842,2320.79003906,-1010.59960938,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (11)
1367 CreateDynamicObject(2842,2320.79003906,-1012.39941406,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (12)
1368 CreateDynamicObject(2842,2320.79003906,-1014.19921875,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (13)
1369 CreateDynamicObject(2842,2320.79003906,-1016.00000000,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (14)
1370 CreateDynamicObject(2842,2320.79003906,-1017.79980469,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (15)
1371 CreateDynamicObject(2842,2320.79003906,-1019.59960938,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (16)
1372 CreateDynamicObject(2842,2319.87500000,-1021.39941406,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (17)
1373 CreateDynamicObject(2842,2319.87500000,-1023.19921875,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (18)
1374 CreateDynamicObject(2842,2319.87500000,-1025.00000000,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_bedrug04) (19)
1375 CreateDynamicObject(2069,2322.39306641,-1007.62664795,1049.30004883,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(cj_mlight7) (1)
1376 CreateDynamicObject(2297,2322.41992188,-1018.77001953,1049.21997070,0.00000000,0.00000000,356.03002930, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(tv_unit_2) (1)
1377 CreateDynamicObject(2069,2322.28906250,-1021.15917969,1049.26501465,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(cj_mlight7) (2)
1378 CreateDynamicObject(2073,2319.97973633,-1013.20001221,1052.93005371,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(cj_mlight1) (1)
1379 CreateDynamicObject(2332,2328.48388672,-1016.84997559,1054.50000000,0.00000000,0.00000000,180.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(kev_safe) (1)
1380 CreateDynamicObject(2833,2325.89990234,-1010.70001221,1053.71875000,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_livingrug02) (1)
1381 CreateDynamicObject(1210,2322.50390625,-1009.73980713,1054.77001953,90.00000000,0.00000000,23.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(briefcase) (1)
1382 CreateDynamicObject(1742,2323.39990234,-1006.62500000,1053.70996094,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(med_bookshelf) (1)
1383 CreateDynamicObject(2894,2322.46752930,-1009.14672852,1054.67187500,0.00000000,0.00000000,89.73001099, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(kmb_rhymesbook) (1)
1384 CreateDynamicObject(1502,2321.91992188,-1023.88201904,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gen_doorint04) (1)
1385 CreateDynamicObject(1502,2317.95996094,-1013.89001465,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gen_doorint04) (2)
1386 CreateDynamicObject(1502,2321.91992188,-1013.88964844,1049.21093750,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gen_doorint04) (3)
1387 CreateDynamicObject(2069,2316.20019531,-1026.69848633,1049.25000000,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(cj_mlight7) (2)
1388 CreateDynamicObject(2267,2322.00000000,-1010.00000000,1051.36096191,0.00000000,0.00000000,90.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(frame_wood_3) (1)
1389 CreateDynamicObject(2813,2326.06225586,-1016.13732910,1050.25781250,0.00000000,0.00000000,308.25524902, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(gb_novels01) (1)
1390 CreateDynamicObject(1667,2324.96020508,-1011.50372314,1049.79870605,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(propwineglass1) (1)
1391 CreateDynamicObject(1667,2324.88867188,-1011.38964844,1049.79870605,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(propwineglass1) (2)
1392 CreateDynamicObject(1665,2324.96142578,-1011.71868896,1049.72058105,0.00000000,0.00000000,0.00000000, HOUSE_VIRTUAL_WORLD + 6, 9, _, 200.0); //object(propashtray1) (1)
1393
1394 /* LSPD interior additions */
1395 CreateDynamicObject(1742,239.44921875,109.50000000,1009.21179199,0.00000000,0.00000000,270.26916504, _, 10, _, 200.0); //object(med_bookshelf) (1)
1396 CreateDynamicObject(2259,233.53700256,111.30000305,1010.52191162,0.00000000,0.00000000,90.00000000, _, 10, _, 200.0); //object(frame_clip_6) (1)
1397 CreateDynamicObject(1510,237.27488708,110.47866058,1010.05999756,0.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(dyn_ashtry) (1)
1398 CreateDynamicObject(3044,237.19999695,110.61499786,1010.16998291,25.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(cigar) (2)
1399 CreateDynamicObject(2894,237.23359680,109.39933777,1010.05700684,0.00000000,0.00000000,105.56491089, _, 10, _, 200.0); //object(kmb_rhymesbook) (1)
1400 CreateDynamicObject(16780,236.00000000,110.00000000,1012.85998535,0.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(ufo_light03) (2)
1401 CreateDynamicObject(1744,237.30000305,113.25000000,1010.70001221,0.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(med_shelf) (1)
1402 CreateDynamicObject(1235,238.86370850,112.72632599,1009.72180176,0.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(wastebin) (1)
1403 CreateDynamicObject(1520,237.29576111,110.73871613,1010.05700684,0.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(dyn_wine_bounce) (1)
1404 CreateDynamicObject(1742,239.44921875,108.06933594,1009.21179199,0.00000000,0.00000000,270.26916504, _, 10, _, 200.0); //object(med_bookshelf) (1)
1405 CreateDynamicObject(2833,238.00000000,109.40000153,1009.22998047,0.00000000,0.00000000,90.00000000, _, 10, _, 200.0); //object(gb_livingrug02) (1)
1406 CreateDynamicObject(2813,237.22207642,112.88127136,1011.04052734,0.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(gb_novels01) (1)
1407 CreateDynamicObject(2332,239.60000610,111.50000000,1011.04998779,0.00000000,0.00000000,270.00000000, _, 10, _, 200.0); //object(kev_safe) (1)
1408 CreateDynamicObject(2558,238.82000732,112.00000000,1010.50000000,0.00000000,0.00000000,270.00000000, _, 10, _, 200.0); //object(curtain_1_closed) (1)
1409 CreateDynamicObject(2289,237.42500305,107.12000275,1011.24859619,0.00000000,0.00000000,179.99450684, _, 10, _, 200.0); //object(frame_2) (1)
1410 CreateDynamicObject(2267,231.40335083,128.39999390,1011.29760742,0.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(frame_wood_3) (1)
1411 CreateDynamicObject(2894,229.15087891,125.28470612,1010.13958740,0.00000000,0.00000000,0.00000000, _, 10, _, 200.0); //object(kmb_rhymesbook) (2)
1412
1413 /* LSPD 3D Text Labels */
1414 CreateDynamic3DTextLabel("Department building elevator\n(/elevator)", COLOR_YELLOW, 276.0980, 122.1232, 1004.6172, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
1415 CreateDynamic3DTextLabel("Upper roof elevator\n(/elevator)", COLOR_YELLOW, 1564.6584,-1670.2607,52.4503, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
1416 CreateDynamic3DTextLabel("Lower roof elevator\n(/elevator)", COLOR_YELLOW, 1564.8, -1666.2, 28.3, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
1417 CreateDynamic3DTextLabel("Police garage elevator\n(/elevator)", COLOR_YELLOW, 1568.6676, -1689.9708, 6.2188, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
1418
1419 /* -------------------------------------- END OF RAEP. -------------------------------------- */
1420
1421 print("_____________________________________________________________Server Credits__________________________________________________________________________");
1422 print("Base Mode(Start Mode): Vortex RP 2; Created by Calg00ne (Frederick Wright) and Brian. (Stefan Rosic).");
1423 print("Actual Mode: Good2Play RPG; Created by TheRoW, Dennis12, Vlad @ good2play rightful owners.");
1424 print("If you are gonna to use this gamemode be advised, this mode is under MPL 1.1 license !");
1425 print("_____________________________________________________________________________________________________________________________________________________");
1426 return 1;
1427}
1428
1429function ShowSyntax(playerid, text[]) {
1430 SCMF(playerid,COLOR_WHITE, "{950000}Syntax: {ffffff}%s",text);
1431 return 1;
1432}
1433function restartTimer() {
1434 iGMXTick--;
1435
1436 foreach(new playerid : Player) {
1437 if(iGMXTick == 5) GameTextForPlayer(playerid, "~w~The server will restart in...~n~ ~r~00:05.", 1010, 5);
1438 if(iGMXTick == 4) GameTextForPlayer(playerid, "~w~The server will restart in...~n~ ~r~00:04.", 1010, 5);
1439 if(iGMXTick == 3) GameTextForPlayer(playerid, "~w~The server will restart in...~n~ ~r~00:03.", 1010, 5);
1440 if(iGMXTick == 2) GameTextForPlayer(playerid, "~w~The server will restart in...~n~ ~r~00:02.", 1010, 5);
1441 if(iGMXTick == 1) GameTextForPlayer(playerid, "~w~The server will restart in...~n~ ~r~00:01.", 1010, 5);
1442 if(iGMXTick == 0) GameTextForPlayer(playerid, "~w~The server is now restarting...", 9000, 5);
1443 }
1444
1445 if(iGMXTick == 0) {
1446 SendClientMessageToAll(COLOR_LIGHTRED, "GMX: {FFFFFF}The server is now restarting. "EMBED_GREY"Please wait for the server to restart.");
1447 mysql_close();
1448 KillTimer(iGMXTimer);
1449 SendRconCommand("gmx");
1450 }
1451
1452 return 1;
1453}
1454
1455AntiDeAMX()
1456{
1457 new a[][] = {
1458 "Unarmed (Fist)",
1459 "Brass K"
1460 };
1461 #pragma unused a
1462}
1463
1464public OnRconLoginAttempt(ip[], password[], success) {
1465 new
1466 pip[32];
1467
1468 foreach(new i : Player) {
1469 GetPlayerIp(i, pip, sizeof(pip));
1470 if(!strcmp(ip, pip, true)) {
1471 SendClientMessage(i, COLOR_WHITE, "RCON is disabled. You have been kicked from the server to prevent your RCON connection from continuing.");
1472 Kick(i);
1473 }
1474 }
1475
1476 return 1;
1477}
1478
1479public OnPlayerCommandReceived(playerid, cmdtext[]) {
1480
1481 if(P_DATA[playerid][pStatus] == 0) return 0;
1482 printf("[server] [cmd] %s (ID %d): %s", GetName(playerid), playerid, cmdtext);
1483 if(P_DATA[playerid][pMuted] > 0) {
1484 SendClientMessage(playerid, COLOR_GREY, "You cannot submit any commands or text at the moment, as you have been muted.");
1485 return 0;
1486 }
1487 P_DATA[playerid][pSpamCount]++;
1488 new charCount[3];
1489 for(new i; i < strlen(cmdtext); i++) switch(cmdtext[i]) {
1490 case '0' .. '9': charCount[0]++;
1491 case '.': charCount[1]++;
1492 case ':': charCount[2]++;
1493 }
1494 if(charCount[0] > 8 && charCount[1] >= 3 && charCount[2] >= 1 && P_DATA[playerid][pAdmin] < 1) {
1495 new
1496 string[128];
1497 format(string,sizeof(string),"Warning: {FFFFFF}%s may be server advertising: '%s'.", GetName(playerid), cmdtext);
1498 submitToAdmins(string, COLOR_HOTORANGE);
1499 return 0;
1500 }
1501 return 1;
1502}
1503
1504public OnVehicleSpawn(vehicleid) {
1505 switch(GetVehicleModel(vehicleid)) {
1506 case 427, 428, 432, 601, 528: SetVehicleHealth(vehicleid, 5000.0); // Enforcer, Securicar, Rhino, SWAT Tank, FBI truck - this is the armour plating dream come true.
1507 }
1508 if(IsAnOwnableVehicle(vehicleid))
1509 {
1510 new playerid = V_DATA[vehicleid][vOwnerID];
1511 ChangeVipTextState(playerid, V_DATA[vehicleid][vSlot], P_DATA[playerid][v_vTextStatus][V_DATA[vehicleid][vSlot]]);
1512 SetVehicleNumberPlate(vehicleid, v_Plate[playerid][V_DATA[vehicleid][vSlot]]);
1513 }
1514 systemVariables[vehicleCounts][1] = 0;
1515 return 1;
1516}
1517
1518public OnVehicleDeath(vehicleid, killerid) {
1519 new engine,lights,alarm,doors,bonnet,boot,objective;
1520 CarEngine[vehicleid] = 0, GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective),SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
1521 if(IsAnOwnableVehicle(vehicleid))
1522 {
1523 V_DATA[vehicleid][vInsurancePoints] --;
1524 DestroyObject(V_DATA[vehicleid][vText]);
1525 new szQuery[128];
1526 format(szQuery, sizeof(szQuery), "UPDATE `vehs` SET `InsurancePoints` = %d WHERE `ID` = %d", V_DATA[vehicleid][vInsurancePoints], V_DATA[vehicleid][vSQL]);
1527 mysql_tquery(SQL, szQuery);
1528 }
1529 return 1;
1530}
1531
1532function ShutUp(slot) { // One function for eight doors. A WINRAR IS YOU!
1533 if(LSPDObjs[slot][2] == 1) switch(slot) {
1534 case 0: {
1535 MoveDynamicObject(LSPDObjs[0][0],232.89999390,107.57499695,1009.21179199,3.5); //commander south
1536 MoveDynamicObject(LSPDObjs[0][1],232.89941406,110.57499695,1009.21179199,3.5); //commander north
1537 LSPDObjs[0][2] = 0;
1538 }
1539 case 1: {
1540 MoveDynamicObject(LSPDObjs[1][0],275.75000000,118.89941406,1003.61718750,3.5); // interrogation north
1541 MoveDynamicObject(LSPDObjs[1][1],275.75000000,115.89941406,1003.61718750,3.5); // interrogation south
1542 LSPDObjs[1][2] = 0;
1543 }
1544 case 2: {
1545 MoveDynamicObject(LSPDObjs[2][0],253.20410156,107.59960938,1002.22070312,3.5); // north west lobby door
1546 MoveDynamicObject(LSPDObjs[2][1],253.19921875,110.59960938,1002.22070312,3.5); // north east lobby door
1547 LSPDObjs[2][2] = 0;
1548 }
1549 case 3: {
1550 MoveDynamicObject(LSPDObjs[3][0],239.56933594,116.09960938,1002.22070312,3.5); // south west lobby door
1551 MoveDynamicObject(LSPDObjs[3][1],239.56445312,119.09960938,1002.22070312,3.5); // south east lobby door
1552 LSPDObjs[3][2] = 0;
1553 }
1554 case 4: {
1555 MoveDynamicObject(LSPDObjs[4][0],264.45019531,115.82421875,1003.62286377,3.5); //object(gen_doorext15) (3)
1556 MoveDynamicObject(LSPDObjs[4][1],267.45214844,115.82910156,1003.62286377,3.5); //object(gen_doorext15) (8)
1557 LSPDObjs[4][2] = 0;
1558 }
1559 case 5: {
1560 MoveDynamicObject(LSPDObjs[5][0],267.32000732,112.53222656,1003.62286377,3.5); //object(gen_doorext15) (4)
1561 MoveDynamicObject(LSPDObjs[5][1],264.32000732,112.52929688,1003.62286377,3.5); //object(gen_doorext15) (5)
1562 LSPDObjs[5][2] = 0;
1563 }
1564 case 6: {
1565 MoveDynamicObject(LSPDObjs[6][0],229.59960938,119.52929688,1009.22442627,3.5); //object(gen_doorext15) (9)
1566 MoveDynamicObject(LSPDObjs[6][1],232.59960938,119.53515625,1009.22442627,3.5); //object(gen_doorext15) (10)
1567 LSPDObjs[6][2] = 0;
1568 }
1569 case 7: {
1570 MoveDynamicObject(LSPDObjs[7][0],219.30000305,116.52999878,998.01562500,3.5); //cell east door
1571 MoveDynamicObject(LSPDObjs[7][1],216.30000305,116.52929688,998.01562500,3.5); //cell west door
1572 LSPDObjs[7][2] = 0;
1573 }
1574 }
1575 return 1;
1576}
1577
1578public OnGameModeExit() {
1579 new
1580 x;
1581
1582 while(x < MAX_TIMERS) {
1583 KillTimer(scriptTimers[x]);
1584 x++;
1585 }
1586
1587 mysql_close(SQL);
1588
1589 return 1;
1590}
1591
1592stock CheckCountIP(ip[]) {
1593 new c = 0;
1594 foreach(new i : Player) if(IsPlayerConnected(i) && !strcmp(GetPlayerIP(i),ip)) c++;
1595 return c;
1596}
1597stock GetPlayerIP(playerid) {
1598 new ip[16];
1599 GetPlayerIp(playerid,ip,sizeof(ip));
1600 return ip;
1601}
1602stock IsMail(email[]) {
1603 new len=strlen(email),cstate=0,i;
1604 for(i=0;i<len;i++) {
1605 if ((cstate==0 || cstate==1) && (email[i]>='A' && email[i]<='Z')||(email[i]>='0' && email[i]<='9') || (email[i]>='a' && email[i]<='z') || (email[i]=='.') || (email[i]=='-') || (email[i]=='_'))
1606 {
1607 }
1608 else {
1609 if ((cstate==0) &&(email[i]=='@')) { cstate=1; }
1610 else return false;
1611 }
1612 }
1613 if(cstate<1) return false;
1614 if(len<6) return false;
1615 if((email[len-3]=='.') || (email[len-4]=='.') || (email[len-5]=='.')) return true;
1616 return false;
1617}
1618stock SendSplitMessage(playerid, color, final[]) {
1619 new len = strlen(final),_iL = len / EX_SPLITLENGTHH;
1620 if( ( len % EX_SPLITLENGTHH ) ) _iL++;
1621 new _Line[EX_SPLITLENGTHH+5];
1622 new _:_i@Index;
1623 while(_i@Index < _iL) {
1624 if(_i@Index == 0)
1625 strmid( _Line, final, ( _i@Index * EX_SPLITLENGTHH ), ( _i@Index * EX_SPLITLENGTHH ) + EX_SPLITLENGTHH );
1626 else
1627 strmid( _Line, final, ( _i@Index * EX_SPLITLENGTHH ), ( _i@Index * EX_SPLITLENGTHH ) + EX_SPLITLENGTHH );
1628 if( _iL > 1 ) {
1629 if( _i@Index > 0 ) format( _Line, sizeof _Line, "... %s", _Line );
1630 }
1631 SendClientMessage(playerid, color, _Line);
1632 _i@Index++;
1633 }
1634 return 1;
1635}
1636stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z) {
1637 if(IsPlayerConnected(playerid)) {
1638 new Float:oldposx, Float:oldposy, Float:oldposz;
1639 new Float:tempposx, Float:tempposy, Float:tempposz;
1640 GetPlayerPos(playerid, oldposx, oldposy, oldposz);
1641 tempposx = (oldposx -x);
1642 tempposy = (oldposy -y);
1643 tempposz = (oldposz -z);
1644 if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
1645 {
1646 return 1;
1647 }
1648 }
1649 return 0;
1650}
1651
1652stock GetWeaponSlot(weaponid) {
1653 switch(weaponid) {
1654
1655 case 0, 1: return 0;
1656 case 2 .. 9: return 1;
1657 case 22 .. 24: return 2;
1658 case 25 .. 27: return 3;
1659 case 28, 29, 32: return 4;
1660 case 30, 31: return 5;
1661 case 33, 34: return 6;
1662 case 35 .. 38: return 7;
1663 case 16, 17, 18, 39, 40: return 8;
1664 case 41 .. 43: return 9;
1665 case 10 .. 15: return 10;
1666 case 44 .. 46: return 11;
1667 }
1668 return -1;
1669}
1670
1671stock PlayerPlaySoundEx(soundid, Float:x, Float:y, Float:z) { // Realistic sound playback!1
1672 foreach(new i : Player) {
1673 if(IsPlayerInRangeOfPoint(i, 30.0, x, y, z))
1674 PlayerPlaySound(i, soundid, x, y, z);
1675 }
1676}
1677
1678stock GetClosestPlayer(playerid) {
1679
1680 new
1681 Float:Distance,
1682 target = -1;
1683
1684 foreach(new i : Player) {
1685 if (playerid != i && P_DATA[i][pSpectating] == INVALID_PLAYER_ID && (target < 0 || Distance > GetDistanceBetweenPlayers(playerid, i))) {
1686 target = i;
1687 Distance = GetDistanceBetweenPlayers(playerid, i);
1688 }
1689 }
1690 return target;
1691}
1692
1693stock GetClosestVehicle(playerid, exception = INVALID_VEHICLE_ID) {
1694
1695 new
1696 Float:Distance,
1697 target = -1;
1698
1699 for(new v; v < MAX_VEHICLES; v++) if(doesVehicleExist(v)) {
1700 if(v != exception && (target < 0 || Distance > GetDistancePlayerVeh(playerid, v))) {
1701 target = v;
1702 Distance = GetDistancePlayerVeh(playerid, v);
1703 }
1704 }
1705 return target;
1706}
1707
1708stock checkVehicleSeat(vehicleid, seatid) {
1709 foreach(new x : Player) {
1710 if(GetPlayerVehicleID(x) == vehicleid && GetPlayerVehicleSeat(x) == seatid) return 1;
1711 }
1712 return 0;
1713}
1714
1715stock IsValidSkin(skinid)
1716{
1717 if(skinid < 0 || skinid > 299) return false;
1718
1719 switch(skinid) {
1720 case 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289: return false;
1721 }
1722 return true;
1723}
1724
1725stock IsPublicSkin(skinid)
1726{
1727 if(!IsValidSkin(skinid)) return false;
1728
1729 switch(skinid) {
1730 case 274 .. 288, 265 .. 267, 71: return false;
1731 }
1732 return true;
1733}
1734
1735public OnPlayerEnterRaceCheckpoint(playerid) {
1736 new string[128];
1737 if(P_DATA[playerid][pCheckpoint] == 100 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1738 {
1739 DisablePlayerRaceCheckpoint(playerid),SetPlayerRaceCheckpoint(playerid, 0, 1989.1528,1443.0236,10.6484, 2033.3976,1451.4266,10.6772,4.0);
1740 P_DATA[playerid][pCheckpoint] = 101;
1741 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~1~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1742 }
1743 else if(P_DATA[playerid][pCheckpoint] == 101 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1744 {
1745 DisablePlayerRaceCheckpoint(playerid);
1746 SetPlayerRaceCheckpoint(playerid,0, 2033.3976,1451.4266,10.6772, 2070.7686,1483.0371,10.6719, 4.0);
1747 P_DATA[playerid][pCheckpoint] = 102;
1748 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~2~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1749 }
1750 else if(P_DATA[playerid][pCheckpoint] == 102 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1751 {
1752 DisablePlayerRaceCheckpoint(playerid);
1753 SetPlayerRaceCheckpoint(playerid,0, 2070.7686,1483.0371,10.6719, 2120.7573,1531.0118,10.6719, 4.0);
1754 P_DATA[playerid][pCheckpoint] = 103;
1755 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~3~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1756 }
1757 else if(P_DATA[playerid][pCheckpoint] == 103 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1758 {
1759 DisablePlayerRaceCheckpoint(playerid);
1760 SetPlayerRaceCheckpoint(playerid,0, 2120.7573,1531.0118,10.6719, 2241.1641,1531.1173,10.7548, 4.0);
1761 P_DATA[playerid][pCheckpoint] = 104;
1762 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~4~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1763 }
1764 else if(P_DATA[playerid][pCheckpoint] == 104 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1765 {
1766 DisablePlayerRaceCheckpoint(playerid);
1767 SetPlayerRaceCheckpoint(playerid,0, 2241.1641,1531.1173,10.7548, 2245.0500,1383.1528,10.6719, 4.0);
1768 P_DATA[playerid][pCheckpoint] = 105;
1769 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~5~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1770 }
1771 else if(P_DATA[playerid][pCheckpoint] == 105 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1772 {
1773 DisablePlayerRaceCheckpoint(playerid);
1774 SetPlayerRaceCheckpoint(playerid,0, 2245.0500,1383.1528,10.6719, 2081.1414,1375.4355,10.6741, 4.0);
1775 P_DATA[playerid][pCheckpoint] = 106;
1776 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~6~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1777 }
1778 else if(P_DATA[playerid][pCheckpoint] == 106 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1779 {
1780 DisablePlayerRaceCheckpoint(playerid);
1781 SetPlayerRaceCheckpoint(playerid,0, 2081.1414,1375.4355,10.6741, 2044.8596,1281.0787,10.6719, 4.0);
1782 P_DATA[playerid][pCheckpoint] = 107;
1783 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~7~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1784 }
1785 else if(P_DATA[playerid][pCheckpoint] == 107 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1786 {
1787 DisablePlayerRaceCheckpoint(playerid);
1788 SetPlayerRaceCheckpoint(playerid,0, 2044.8596,1281.0787,10.6719, 1953.3984,1275.5695,10.7530, 4.0);
1789 P_DATA[playerid][pCheckpoint] = 108;
1790 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~8~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1791 }
1792 else if(P_DATA[playerid][pCheckpoint] == 108 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1793 {
1794 DisablePlayerRaceCheckpoint(playerid);
1795 SetPlayerRaceCheckpoint(playerid, 0,1953.3984,1275.5695,10.7530, 1949.2585,1343.7274,9.1094, 4.0);
1796 P_DATA[playerid][pCheckpoint] = 109;
1797 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~9~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1798 }
1799 else if(P_DATA[playerid][pCheckpoint] == 109 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1800 {
1801 DisablePlayerRaceCheckpoint(playerid);
1802 SetPlayerRaceCheckpoint(playerid, 0,1949.1769,1343.0763,9.1094, 1949.1769,1343.0763,9.1094, 4.0);
1803 P_DATA[playerid][pCheckpoint] = 110;
1804 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~10~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1805 }
1806 else if(P_DATA[playerid][pCheckpoint] == 110 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1807 {
1808 DisablePlayerRaceCheckpoint(playerid);
1809 SetPlayerRaceCheckpoint(playerid, 0,1949.1769,1343.0763,9.1094, 1949.1769,1343.0763,9.1094, 4.0);
1810 P_DATA[playerid][pCheckpoint] = 111;
1811 format(string, sizeof(string), "~w~CHECKPOINTS: ~r~11~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1], string);
1812 }
1813 else if(P_DATA[playerid][pCheckpoint] == 111 && IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(playerid, masinaexamen[playerid]))
1814 {
1815 PlayerTextDrawHide(playerid, DMV[0]),PlayerTextDrawHide(playerid, DMV[1]),DisablePlayerRaceCheckpoint(playerid),StopAudioStreamForPlayer(playerid);
1816 P_DATA[playerid][pCarLic] = 1;
1817 InLesson[playerid] = 0;
1818 DestroyVehicle(masinaexamen[playerid]),DisableRemoteVehicleCollisions(playerid, 0),masinaexamen[playerid] = -1;
1819 new query[128];
1820 mysql_format(SQL,query,sizeof(query),"UPDATE playeraccounts SET `playerCarLic`='1' WHERE `playerName`='%s'",P_DATA[playerid][pNormalName]),mysql_tquery(SQL,query,"","");
1821 SCM(playerid, COLOR_WHITE, "({950000}Server{ffffff}): Exam finished! You can now drive any car!");
1822 P_DATA[playerid][pCheckpoint] = 0;
1823 }
1824 return 1;
1825}
1826function SendLM(playerid, color, ro[], en[]) {
1827 switch(P_DATA[playerid][pLanguage]) {
1828 case 1: SendSplitMessage(playerid, color, en);
1829 case 2: SendSplitMessage(playerid, color, ro);
1830 default: SendSplitMessage(playerid, color, ro);
1831 }
1832 return 1;
1833}
1834function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) {
1835 new Float:posx, Float:posy, Float:posz;
1836 new Float:oldposx, Float:oldposy, Float:oldposz;
1837 new Float:tempposx, Float:tempposy, Float:tempposz;
1838 GetPlayerPos(playerid, oldposx, oldposy, oldposz);
1839 foreach(new i : Player) {
1840 if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)) {
1841 GetPlayerPos(i, posx, posy, posz);
1842 tempposx = (oldposx -posx);
1843 tempposy = (oldposy -posy);
1844 tempposz = (oldposz -posz);
1845 if(((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
1846 SendClientMessage(i, col1, string);
1847 else if(((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
1848 SendClientMessage(i, col2, string);
1849 else if(((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
1850 SendClientMessage(i, col3, string);
1851 else if(((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
1852 SendClientMessage(i, col4, string);
1853 else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
1854 SendClientMessage(i, col5, string);
1855 }
1856 }
1857 return 1;
1858}
1859function IsABike(carid) {
1860 if(GetVehicleModel(carid) == 481 || GetVehicleModel(carid) == 509 || GetVehicleModel(carid) == 510)
1861 {
1862 return 1;
1863 }
1864 return 0;
1865}
1866
1867public OnPlayerConnect(playerid) {
1868 if(CheckCountIP(GetPlayerIP(playerid)) >= 3 && strcmp(GetPlayerIP(playerid), "127.0.0.1", true) != 0) {
1869 SCM(playerid, COLOR_LIGHTRED, "There are already 2 players connected with same IP."),KickEx(playerid);
1870 return 1;
1871 }
1872 GameTextForPlayer(playerid, "~r~CHECKING BAN STATUS", 3500, 3);
1873 if(P_DATA[playerid][pAdmin] != 0) Iter_Add(Admins, playerid);
1874 SetPlayerColor(playerid, COLOR_WHITE);
1875 resetP_DATA(playerid);
1876 InterpolateCameraPos(playerid, 2054.828125, 734.962219, 65.399948, 2076.729003, 1727.329589, 34.379482, 25000);
1877 InterpolateCameraLookAt(playerid, 2054.854248, 739.947143, 65.012481, 2078.880126, 1731.840942, 34.237743, 25000);
1878 PlayerTextDrawSetString(playerid, logo, SERVER_NAME),PlayerTextDrawShow(playerid, logo);
1879
1880 new
1881 queryString[120],
1882 playerIP[16];
1883
1884 GetPlayerIp(playerid, playerIP, sizeof(playerIP));
1885
1886 format(queryString, sizeof(queryString), "SELECT `banID` FROM `bans` WHERE `IPBanned` = '%s'", playerIP);
1887 mysql_tquery(SQL, queryString, "CheckPlayerBan", "d", playerid);
1888
1889 SetPlayerMapIcon(playerid, 10, 595.5443, -1250.3405, 18.2836, 52, 0);
1890 syncPlayerTime(playerid);
1891 SetPlayerWeather(playerid, weatherVariables[0]); // Keep it all in sync (weather bugged out sometimes until we fixed it this way).
1892
1893 logo = CreatePlayerTextDraw(playerid, 635.000610, 435.555603, "Dennis12/_GOOD2PLAY");
1894 PlayerTextDrawLetterSize(playerid, logo, 0.245000, 1.164443);
1895 PlayerTextDrawAlignment(playerid, logo, 3);
1896 PlayerTextDrawColor(playerid, logo, -1);
1897 PlayerTextDrawSetShadow(playerid, logo, 1);
1898 PlayerTextDrawSetOutline(playerid, logo, 0);
1899 PlayerTextDrawBackgroundColor(playerid, logo, 51);
1900 PlayerTextDrawFont(playerid, logo, 2);
1901 PlayerTextDrawSetProportional(playerid, logo, 1);
1902
1903 OwnerInfo = CreatePlayerTextDraw(playerid,2.666624, 430.236938, " ");
1904 PlayerTextDrawLetterSize(playerid, OwnerInfo, 0.191333, 1.960887);
1905 PlayerTextDrawAlignment(playerid, OwnerInfo, 1);
1906 PlayerTextDrawColor(playerid, OwnerInfo, -1);
1907 PlayerTextDrawSetShadow(playerid, OwnerInfo, 0);
1908 PlayerTextDrawSetOutline(playerid, OwnerInfo, 1);
1909 PlayerTextDrawBackgroundColor(playerid, OwnerInfo, 51);
1910 PlayerTextDrawFont(playerid, OwnerInfo, 2);
1911 PlayerTextDrawSetProportional(playerid, OwnerInfo, 1);
1912
1913 TutorialTD[1] = CreatePlayerTextDraw(playerid, 280.000000, 377.000000, "~y~Tutorial");
1914 PlayerTextDrawLetterSize(playerid, TutorialTD[1], 0.420000, 1.500000);
1915 PlayerTextDrawSetShadow(playerid, TutorialTD[1], 0);
1916 PlayerTextDrawSetOutline(playerid, TutorialTD[1], 1);
1917 PlayerTextDrawFont(playerid, TutorialTD[1], 2);
1918
1919 TutorialTD[0] = CreatePlayerTextDraw(playerid, 282.000000, 390.000000, " ");
1920 PlayerTextDrawLetterSize(playerid, TutorialTD[0], 0.470000, 1.500000);
1921 PlayerTextDrawSetShadow(playerid, TutorialTD[0], 0);
1922 PlayerTextDrawSetOutline(playerid, TutorialTD[0], 1);
1923 PlayerTextDrawFont(playerid, TutorialTD[0], 2);
1924
1925 DMV[0] = CreatePlayerTextDraw(playerid, 200.799987, 356.906677, "~y~DRIVING SCHOOL EXAM");
1926 PlayerTextDrawLetterSize(playerid, DMV[0], 0.497200, 1.950933);
1927 PlayerTextDrawAlignment(playerid, DMV[0], 1);
1928 PlayerTextDrawColor(playerid, DMV[0], -1);
1929 PlayerTextDrawSetShadow(playerid, DMV[0], 0);
1930 PlayerTextDrawSetOutline(playerid, DMV[0], 1);
1931 PlayerTextDrawBackgroundColor(playerid, DMV[0], 255);
1932 PlayerTextDrawFont(playerid, DMV[0], 2);
1933 PlayerTextDrawSetProportional(playerid, DMV[0], 1);
1934
1935 DMV[1] = CreatePlayerTextDraw(playerid, 201.600006, 373.333343, " ");
1936 PlayerTextDrawLetterSize(playerid, DMV[1], 0.467599, 2.152534);
1937 PlayerTextDrawAlignment(playerid, DMV[1], 1);
1938 PlayerTextDrawColor(playerid, DMV[1], -1);
1939 PlayerTextDrawSetShadow(playerid, DMV[1], 0);
1940 PlayerTextDrawSetOutline(playerid, DMV[1], 1);
1941 PlayerTextDrawBackgroundColor(playerid, DMV[1], 255);
1942 PlayerTextDrawFont(playerid, DMV[1], 2);
1943 PlayerTextDrawSetProportional(playerid, DMV[1], 1);
1944
1945 return 1;
1946}
1947
1948function CheckPlayerBan(const playerid)
1949{
1950 if(cache_get_row_count()){
1951 SendClientMessage(playerid, COLOR_RED, "You're banned from this server.");
1952 Kick(playerid);
1953 }
1954 else {
1955 new
1956 szQuery[150],
1957 Cache: r;
1958 mysql_format(SQL, szQuery, sizeof(szQuery), "SELECT `playerID` FROM `playeraccounts` WHERE `playerName` = '%e'", GetName(playerid));
1959 r = mysql_query(SQL, szQuery, true);
1960 if(cache_get_row_count())
1961 {
1962 P_DATA[playerid][pSQL] = cache_get_field_content_int(0, "playerID");
1963 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "SERVER: Login", "Welcome to the "SERVER_NAME" Server.\n\nPlease enter your password below!", "Login", "Cancel");
1964 }
1965 else ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "SERVER: Registration", "Welcome to the "SERVER_NAME" Server.\n\nPlease enter your desired password below!", "Register", "Cancel");
1966
1967 cache_delete(r);
1968 }
1969 return 1;
1970}
1971
1972GetName(const p)
1973{
1974 new szName[MAX_PLAYER_NAME];
1975 GetPlayerName(p, szName, MAX_PLAYER_NAME);
1976 return szName;
1977}
1978
1979KickEx(const playerid)
1980 return SetTimerEx("OnServerKick", 500, 0, "d", playerid);
1981
1982function OnServerKick(const playerid)
1983{
1984 Kick(playerid);
1985 return 1;
1986}
1987
1988stock SendToGroup(groupid, colour, string[]) {
1989 if(groupid > 0) {
1990 foreach(new i : Player) {
1991 if(P_DATA[i][pStatus] == 1 && P_DATA[i][pGroup] == groupid) {
1992 SendClientMessage(i, colour, string);
1993 }
1994 }
1995 }
1996 return 1;
1997}
1998
1999stock SendToEvent(colour, string[]) {
2000 foreach(new i : Player) {
2001 if(P_DATA[i][pEvent] >= 1) SendClientMessage(i, colour, string);
2002 }
2003 return 1;
2004}
2005
2006stock SendToFrequency(frequency, colour, string[]) {
2007 if(frequency > 0) {
2008 foreach(new i : Player) {
2009 if(P_DATA[i][pStatus] == 1 && P_DATA[i][pWalkieTalkie] == frequency) {
2010 SendClientMessage(i, colour, string);
2011 }
2012 }
2013 }
2014 return 1;
2015}
2016
2017stock sendDepartmentMessage(colour, string[]) {
2018 foreach(new i : Player) {
2019 if(P_DATA[i][pStatus] == 1 && (groupVariables[P_DATA[i][pGroup]][gGroupType] == 1 || groupVariables[P_DATA[i][pGroup]][gGroupType] == 2)) {
2020 SendClientMessage(i, colour, string);
2021 }
2022 }
2023 return 1;
2024}
2025
2026IsKeyJustDown(key, newkeys, oldkeys)
2027{
2028 if((newkeys & key) && !(oldkeys & key)) return 1;
2029 return 0;
2030}
2031
2032stock IsPlayerInInvalidNosVehicle(playerid) {
2033 switch(GetVehicleModel(GetPlayerVehicleID(playerid))) {
2034 case 581, 523, 462, 521, 463, 522, 461, 448, 468, 586, 509, 481, 510, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 590, 569, 537, 538, 570, 449: return true;
2035 }
2036 return false;
2037}
2038
2039stock IsPlayerConnectedEx(playerid) {
2040 if(IsPlayerConnected(playerid) && P_DATA[playerid][pStatus] == 1) return 1;
2041 return 0;
2042}
2043
2044stock givePlayerValidWeapon(playerid, weapon) {
2045 switch(weapon) {
2046 case 0, 1: {
2047 P_DATA[playerid][pWeapons][0] = weapon;
2048 GivePlayerWeapon(playerid, weapon, 99999);
2049 }
2050 case 2, 3, 4, 5, 6, 7, 8, 9: {
2051 P_DATA[playerid][pWeapons][1] = weapon;
2052 GivePlayerWeapon(playerid, weapon, 99999);
2053 }
2054 case 22, 23, 24: {
2055 P_DATA[playerid][pWeapons][2] = weapon;
2056 GivePlayerWeapon(playerid, weapon, 99999);
2057 }
2058 case 25, 26, 27: {
2059 P_DATA[playerid][pWeapons][3] = weapon;
2060 GivePlayerWeapon(playerid, weapon, 99999);
2061 }
2062 case 28, 29, 32: {
2063 P_DATA[playerid][pWeapons][4] = weapon;
2064 GivePlayerWeapon(playerid, weapon, 99999);
2065 }
2066 case 30, 31: {
2067 P_DATA[playerid][pWeapons][5] = weapon;
2068 GivePlayerWeapon(playerid, weapon, 99999);
2069 }
2070 case 33, 34: {
2071 P_DATA[playerid][pWeapons][6] = weapon;
2072 GivePlayerWeapon(playerid, weapon, 99999);
2073 }
2074 case 35, 36, 37, 38: {
2075 P_DATA[playerid][pWeapons][7] = weapon;
2076 GivePlayerWeapon(playerid, weapon, 99999);
2077 }
2078 case 16, 17, 18, 39: {
2079 P_DATA[playerid][pWeapons][8] = weapon;
2080 GivePlayerWeapon(playerid, weapon, 99999);
2081 }
2082 case 41, 42, 43: {
2083 P_DATA[playerid][pWeapons][9] = weapon;
2084 GivePlayerWeapon(playerid, weapon, 99999);
2085 }
2086 case 10, 11, 12, 13, 14, 15: {
2087 P_DATA[playerid][pWeapons][10] = weapon;
2088 GivePlayerWeapon(playerid, weapon, 99999);
2089 }
2090 case 44, 45, 46: {
2091 P_DATA[playerid][pWeapons][11] = weapon;
2092 GivePlayerWeapon(playerid, weapon, 99999);
2093 }
2094 case 40: {
2095 P_DATA[playerid][pWeapons][12] = weapon;
2096 GivePlayerWeapon(playerid, weapon, 99999);
2097 }
2098 }
2099 return 1;
2100}
2101
2102stock firstPlayerSpawn(playerid) {
2103 P_DATA[playerid][pTutorial] = 0;
2104 P_DATA[playerid][pFirstLogin] = 0;
2105 P_DATA[playerid][pInterior] = 0;
2106 P_DATA[playerid][pVirtualWorld] = 0;
2107 SetSpawnInfo(playerid, 0, P_DATA[playerid][pSkin], SERVER_SPAWN, 0, 0, 0, 0, 0, 0, 0);
2108 SpawnPlayer(playerid);
2109 return 1;
2110}
2111
2112stock initiateTutorial(playerid) {
2113 TogglePlayerControllable(playerid, 0);
2114 RegisterStats[playerid] = 1;
2115 SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------------------");
2116 SCMF(playerid, COLOR_YELLOW, "Bine ai venit pe server, %s",GetName(playerid));
2117 SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 9994);
2118 SetPlayerPos(playerid, 1742.9814,-1863.0938,16.2048);
2119 InterpolateCameraPos(playerid, 2054.828125, 734.962219, 65.399948, 2076.729003, 1727.329589, 34.379482, 25000);
2120 InterpolateCameraLookAt(playerid, 2054.854248, 739.947143, 65.012481, 2078.880126, 1731.840942, 34.237743, 25000);
2121 ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_MSGBOX, "Language", "Alege limba in care vrei sa fie afisate mesajele de pe server.\nChoose the language that you speak.", "Romana", "English");
2122 return 1;
2123}
2124
2125stock GetDistanceBetweenPlayers(playerid, playerid2) {
2126 new
2127 Float:Floats[7];
2128
2129 GetPlayerPos(playerid, Floats[0], Floats[1], Floats[2]);
2130 GetPlayerPos(playerid2, Floats[3], Floats[4], Floats[5]);
2131 Floats[6] = floatsqroot((Floats[3]-Floats[0])*(Floats[3]-Floats[0])+(Floats[4]-Floats[1])*(Floats[4]-Floats[1])+(Floats[5]-Floats[2])*(Floats[5]-Floats[2]));
2132
2133 return floatround(Floats[6]);
2134}
2135
2136stock GetDistancePlayerVeh(playerid, veh) {
2137
2138 new
2139 Float:Floats[7];
2140
2141 GetPlayerPos(playerid, Floats[0], Floats[1], Floats[2]);
2142 GetVehiclePos(veh, Floats[3], Floats[4], Floats[5]);
2143 Floats[6] = floatsqroot((Floats[3]-Floats[0])*(Floats[3]-Floats[0])+(Floats[4]-Floats[1])*(Floats[4]-Floats[1])+(Floats[5]-Floats[2])*(Floats[5]-Floats[2]));
2144
2145 return floatround(Floats[6]);
2146}
2147
2148stock IsPlayerInRangeOfVehicle(playerid, vehicleid, Float: radius) {
2149
2150 new
2151 Float:Floats[3];
2152
2153 GetVehiclePos(vehicleid, Floats[0], Floats[1], Floats[2]);
2154 return IsPlayerInRangeOfPoint(playerid, radius, Floats[0], Floats[1], Floats[2]);
2155}
2156
2157stock IsPlayerInRangeOfPlayer(playerid, playerid2, Float: radius) {
2158
2159 new
2160 Float:Floats[3];
2161
2162 GetPlayerPos(playerid2, Floats[0], Floats[1], Floats[2]);
2163 return IsPlayerInRangeOfPoint(playerid, radius, Floats[0], Floats[1], Floats[2]);
2164}
2165
2166stock IsVehicleInRangeOfPoint(vehicleid, Float: radius, Float:x, Float:y, Float:z) {
2167
2168 new
2169 Float:Floats[6];
2170
2171 GetVehiclePos(vehicleid, Floats[0], Floats[1], Floats[2]);
2172 Floats[3] = (Floats[0] -x);
2173 Floats[4] = (Floats[1] -y);
2174 Floats[5] = (Floats[2] -z);
2175 if (((Floats[3] < radius) && (Floats[3] > -radius)) && ((Floats[4] < radius) && (Floats[4] > -radius)) && ((Floats[5] < radius) && (Floats[5] > -radius)))
2176 return 1;
2177 return 0;
2178}
2179
2180stock GetPlayerSpeed(playerid, get3d) // Need this for fixcar
2181{
2182 new
2183 Float:Floats[3];
2184
2185 if(IsPlayerInAnyVehicle(playerid))
2186 GetVehicleVelocity(GetPlayerVehicleID(playerid), Floats[0], Floats[1], Floats[2]);
2187 else
2188 GetPlayerVelocity(playerid, Floats[0], Floats[1], Floats[2]);
2189
2190 return SpeedCheck(Floats[0], Floats[1], Floats[2], 100.0, get3d);
2191}
2192
2193stock givePlayerWeapons(playerid) {
2194 new
2195 x;
2196
2197 while(x < 13) {
2198 GivePlayerWeapon(playerid, P_DATA[playerid][pWeapons][x], 99999);
2199 x++;
2200 }
2201
2202 return 1;
2203}
2204
2205// Credits to Westie for explode, from his strlib include.
2206stock explode(aExplode[][], const sSource[], const sDelimiter[] = " ", iVertices = sizeof aExplode, iLength = sizeof aExplode[])
2207{
2208 new
2209 iNode,
2210 iPointer,
2211 iPrevious = -1,
2212 iDelimiter = strlen(sDelimiter);
2213
2214 while(iNode < iVertices)
2215 {
2216 iPointer = strfind(sSource, sDelimiter, false, iPointer);
2217
2218 if(iPointer == -1)
2219 {
2220 strmid(aExplode[iNode], sSource, iPrevious, strlen(sSource), iLength);
2221 break;
2222 }
2223 else
2224 {
2225 strmid(aExplode[iNode], sSource, iPrevious, iPointer, iLength);
2226 }
2227
2228 iPrevious = (iPointer += iDelimiter);
2229 ++iNode;
2230 }
2231
2232 return iPrevious;
2233}
2234
2235stock removePlayerWeapon(playerid, weapon) {
2236
2237 P_DATA[playerid][pAnticheatExemption] = 6;
2238
2239 switch(weapon) {
2240 case 0, 1: {
2241 if(P_DATA[playerid][pTabbed] >= 1) {
2242 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 0;
2243 }
2244 else {
2245 ResetPlayerWeapons(playerid);
2246 P_DATA[playerid][pWeapons][0] = 0;
2247 givePlayerWeapons(playerid);
2248 }
2249 }
2250 case 2, 3, 4, 5, 6, 7, 8, 9: {
2251 if(P_DATA[playerid][pTabbed] >= 1) {
2252 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 1;
2253 }
2254 else {
2255 ResetPlayerWeapons(playerid);
2256 P_DATA[playerid][pWeapons][1] = 0;
2257 givePlayerWeapons(playerid);
2258 }
2259 }
2260 case 22, 23, 24: {
2261 if(P_DATA[playerid][pTabbed] >= 1) {
2262 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 2;
2263 }
2264 else {
2265 ResetPlayerWeapons(playerid);
2266 P_DATA[playerid][pWeapons][2] = 0;
2267 givePlayerWeapons(playerid);
2268 }
2269 }
2270 case 25, 26, 27: {
2271 if(P_DATA[playerid][pTabbed] >= 1) {
2272 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 3;
2273 }
2274 else {
2275 ResetPlayerWeapons(playerid);
2276 P_DATA[playerid][pWeapons][3] = 0;
2277 givePlayerWeapons(playerid);
2278 }
2279 }
2280 case 28, 29, 32: {
2281 if(P_DATA[playerid][pTabbed] >= 1) {
2282 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 4;
2283 }
2284 else {
2285 ResetPlayerWeapons(playerid);
2286 P_DATA[playerid][pWeapons][4] = 0;
2287 givePlayerWeapons(playerid);
2288 }
2289 }
2290 case 30, 31: {
2291 if(P_DATA[playerid][pTabbed] >= 1) {
2292 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 5;
2293 }
2294 else {
2295 ResetPlayerWeapons(playerid);
2296 P_DATA[playerid][pWeapons][5] = 0;
2297 givePlayerWeapons(playerid);
2298 }
2299 }
2300 case 33, 34: {
2301 if(P_DATA[playerid][pTabbed] >= 1) {
2302 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 6;
2303 }
2304 else {
2305 ResetPlayerWeapons(playerid);
2306 P_DATA[playerid][pWeapons][6] = 0;
2307 givePlayerWeapons(playerid);
2308 }
2309 }
2310 case 35, 36, 37, 38: {
2311 if(P_DATA[playerid][pTabbed] >= 1) {
2312 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 7;
2313 }
2314 else {
2315 ResetPlayerWeapons(playerid);
2316 P_DATA[playerid][pWeapons][7] = 0;
2317 givePlayerWeapons(playerid);
2318 }
2319 }
2320 case 16, 17, 18, 39: {
2321 if(P_DATA[playerid][pTabbed] >= 1) {
2322 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 8;
2323 }
2324 else {
2325 ResetPlayerWeapons(playerid);
2326 P_DATA[playerid][pWeapons][8] = 0;
2327 givePlayerWeapons(playerid);
2328 }
2329 }
2330 case 41, 42, 43: {
2331 if(P_DATA[playerid][pTabbed] >= 1) {
2332 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 9;
2333 }
2334 else {
2335 ResetPlayerWeapons(playerid);
2336 P_DATA[playerid][pWeapons][9] = 0;
2337 givePlayerWeapons(playerid);
2338 }
2339 }
2340 case 10, 11, 12, 13, 14, 15: {
2341 if(P_DATA[playerid][pTabbed] >= 1) {
2342 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 10;
2343 }
2344 else {
2345 ResetPlayerWeapons(playerid);
2346 P_DATA[playerid][pWeapons][10] = 0;
2347 givePlayerWeapons(playerid);
2348 }
2349 }
2350 case 44, 45, 46: {
2351 if(P_DATA[playerid][pTabbed] >= 1) {
2352 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 11;
2353 }
2354 else {
2355 ResetPlayerWeapons(playerid);
2356 P_DATA[playerid][pWeapons][11] = 0;
2357 givePlayerWeapons(playerid);
2358 }
2359 }
2360 case 40: {
2361 if(P_DATA[playerid][pTabbed] >= 1) {
2362 P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 12;
2363 }
2364 else {
2365 ResetPlayerWeapons(playerid);
2366 P_DATA[playerid][pWeapons][12] = 0;
2367 givePlayerWeapons(playerid);
2368 }
2369 }
2370 }
2371 return 1;
2372}
2373
2374stock hackerTrigger(playerid) {
2375 if(P_DATA[playerid][pTabbed] == 0) {
2376 P_DATA[playerid][pHackWarnings]++;
2377 P_DATA[playerid][pHackWarnTime] = 1;
2378
2379 printf("Hack Warning! Weapon %d (playerid: %d)", GetPlayerWeapon(playerid), playerid);
2380
2381 if(P_DATA[playerid][pHackWarnings] >= 3) {
2382
2383 new
2384 playerName[MAX_PLAYER_NAME],
2385 wep = GetPlayerWeapon(playerid),
2386 reason[94];
2387
2388 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
2389
2390 format(reason, sizeof(reason), "Warning: {FFFFFF}%s may possibly be weapon hacking (%s).", playerName, WeaponNames[wep]);
2391 submitToAdmins(reason, COLOR_HOTORANGE);
2392
2393 if(P_DATA[playerid][pHackWarnings] >= MAX_WEAPON_HACK_WARNINGS) {
2394 format(reason, sizeof(reason), "Weapon Hacking (%s).", WeaponNames[wep]);
2395 scriptBan(playerid, reason);
2396 }
2397 }
2398 }
2399 return 1;
2400}
2401
2402stock scriptBan(playerid, reason[]) {
2403 new
2404 playerName[MAX_PLAYER_NAME],
2405 playerIP[32],
2406 aString[255];
2407
2408 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
2409 GetPlayerIp(playerid, playerIP, sizeof(playerIP));
2410
2411 P_DATA[playerid][pBanned] = 1;
2412
2413 format(aString, sizeof(aString), "Ban: %s has been banned, reason: %s", playerName, reason);
2414 SendClientMessageToAll(COLOR_LIGHTRED, aString);
2415
2416 mysql_real_escape_string(aString, aString);
2417 adminLog(aString);
2418
2419 Kick(playerid);
2420
2421 format(aString, sizeof(aString), "INSERT INTO bans (playerNameBanned, playerBannedBy, playerBanReason, IPBanned) VALUES('%s', 'System', '%s', '%s')", playerName, reason, playerIP);
2422 mysql_query(SQL, aString);
2423 return 1;
2424}
2425
2426stock IPBan(ip[], reason[], name[] = "Nobody") {
2427 new
2428 cleanReason[64],
2429 querySz[150]; // To be on the safe side.
2430
2431 mysql_real_escape_string(reason, cleanReason);
2432 format(querySz, sizeof(querySz), "INSERT INTO Bans (playerNameBanned, playerBanReason, IPBanned) VALUES('%s', '%s', '%s')", name, reason, ip);
2433 mysql_query(SQL, querySz);
2434 return 1;
2435}
2436
2437public OnQueryError(errorid, error[], callback[], query[], connectionHandle) {
2438 return printf("errorid: %d | error: %s | allback: %s | query: %s", errorid, error, callback, query);
2439}
2440
2441function LoadHouses()
2442{
2443 new Cache: r = mysql_query(SQL, "SELECT * FROM `houses`");
2444 if(cache_get_row_count())
2445 {
2446 for(new i = 0, x; i < cache_get_row_count(); i++)
2447 {
2448 i = cache_get_field_content_int(x, "houseID");
2449 houseVariables[i][hHouseExteriorPos][0] = cache_get_field_content_float(x, "houseExteriorPosX");
2450 houseVariables[i][hHouseExteriorPos][1] = cache_get_field_content_float(x, "houseExteriorPosY");
2451 houseVariables[i][hHouseExteriorPos][2] = cache_get_field_content_float(x, "houseExteriorPosZ");
2452 houseVariables[i][hHouseInteriorPos][0] = cache_get_field_content_float(x, "houseInteriorPosX");
2453 houseVariables[i][hHouseInteriorPos][1] = cache_get_field_content_float(x, "houseInteriorPosY");
2454 houseVariables[i][hHouseInteriorPos][2] = cache_get_field_content_float(x, "houseInteriorPosZ");
2455 houseVariables[i][hHouseInteriorID] = cache_get_field_content_int(x, "houseInteriorID");
2456 houseVariables[i][hHouseExteriorID] = cache_get_field_content_int(x, "houseExteriorID");
2457 cache_get_field_content(x, "houseOwner", houseVariables[x][hHouseOwner], SQL, MAX_PLAYER_NAME);
2458 houseVariables[i][hHousePrice] = cache_get_field_content_int(x, "housePrice");
2459 houseVariables[i][hHouseLocked] = cache_get_field_content_int(x, "houseLocked");
2460
2461 houseVariables[i][hMoney] = cache_get_field_content_int(x, "houseMoney");
2462 houseVariables[i][hWardrobe][0] = cache_get_field_content_int(x, "houseWardrobe1");
2463 houseVariables[i][hWeapons][0] = cache_get_field_content_int(x, "houseWeapon1");
2464 houseVariables[i][hWeapons][1] = cache_get_field_content_int(x, "houseWeapon2");
2465 houseVariables[i][hWeapons][2] = cache_get_field_content_int(x, "houseWeapon3");
2466 houseVariables[i][hWeapons][3] = cache_get_field_content_int(x, "houseWeapon4");
2467 houseVariables[i][hWeapons][4] = cache_get_field_content_int(x, "houseWeapon5");
2468 houseVariables[i][hWardrobe][1] = cache_get_field_content_int(x, "houseWardrobe2");
2469 houseVariables[i][hWardrobe][2] = cache_get_field_content_int(x, "houseWardrobe3");
2470 houseVariables[i][hWardrobe][3] = cache_get_field_content_int(x, "houseWardrobe4");
2471 houseVariables[i][hWardrobe][4] = cache_get_field_content_int(x, "houseWardrobe5");
2472 houseVariables[i][hMaterials] = cache_get_field_content_int(x, "houseMaterials");
2473 if(!strcmp(houseVariables[i][hHouseOwner], "Nobody", true) && strlen(houseVariables[x][hHouseOwner]) >= 1) {
2474 new
2475 labelString[96];
2476
2477 if(houseVariables[i][hHouseLocked] == 1) {
2478 format(labelString, sizeof(labelString), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\n(locked)", x, houseVariables[i][hHousePrice]);
2479 }
2480 else {
2481 format(labelString, sizeof(labelString), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\nPress CROUCH to enter.", x, houseVariables[i][hHousePrice]);
2482 }
2483
2484 houseVariables[x][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[i][hHouseExteriorPos][0], houseVariables[i][hHouseExteriorPos][1], houseVariables[i][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
2485 houseVariables[x][hPickupID] = CreateDynamicPickup(1273, 23, houseVariables[i][hHouseExteriorPos][0], houseVariables[i][hHouseExteriorPos][1], houseVariables[i][hHouseExteriorPos][2], 0, houseVariables[i][hHouseExteriorID], -1, 250);
2486 }
2487 else {
2488 new
2489 labelString[96];
2490
2491 if(houseVariables[i][hHouseLocked] == 1) {
2492 format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\n\n(locked)", x, houseVariables[i][hHouseOwner]);
2493 }
2494 else {
2495 format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\n\nPress CROUCH to enter.", x, houseVariables[i][hHouseOwner]);
2496 }
2497
2498 houseVariables[i][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[i][hHouseExteriorPos][0], houseVariables[i][hHouseExteriorPos][1], houseVariables[i][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
2499 houseVariables[i][hPickupID] = CreateDynamicPickup(1272, 23, houseVariables[i][hHouseExteriorPos][0], houseVariables[i][hHouseExteriorPos][1], houseVariables[i][hHouseExteriorPos][2], 0, houseVariables[i][hHouseExteriorID], -1, 50);
2500 }
2501 systemVariables[houseCount]++;
2502 }
2503
2504 printf("[MySQL House] %d houses loaded.", systemVariables[houseCount]);
2505 } else print("[MySQL House]: Your house table is empty !");
2506 cache_delete(r);
2507 return 1;
2508}
2509
2510function LoadBusiness()
2511{
2512 new
2513 Cache: r = mysql_query(SQL, "SELECT * FROM `businesses`", true),
2514 result[128];
2515
2516 if(cache_get_row_count())
2517 {
2518 for(new i = 0, x; i < cache_get_row_count(); i++)
2519 {
2520 x = cache_get_field_content_int(i, "businessID");
2521 cache_get_field_content(i, "businessName", businessVariables[x][bName]);
2522 cache_get_field_content(i, "businessOwner", businessVariables[x][bOwner]);
2523 businessVariables[x][bType] = cache_get_field_content_int(i, "businessType");
2524 businessVariables[x][bExteriorPos][0] = cache_get_field_content_float(i, "businessExteriorX");
2525 businessVariables[x][bExteriorPos][1] = cache_get_field_content_float(i, "businessExteriorY");
2526 businessVariables[x][bExteriorPos][2] = cache_get_field_content_float(i, "businessExteriorZ");
2527 businessVariables[x][bInteriorPos][0] = cache_get_field_content_float(i, "businessInteriorX");
2528 businessVariables[x][bInteriorPos][1] = cache_get_field_content_float(i, "businessInteriorY");
2529 businessVariables[x][bInteriorPos][2] = cache_get_field_content_float(i, "businessInteriorZ");
2530 businessVariables[x][bInterior] = cache_get_field_content_int(i, "businessInterior");
2531 businessVariables[x][bLocked] = cache_get_field_content_int(i, "businessLock");
2532 businessVariables[x][bPrice] = cache_get_field_content_int(i, "businessPrice");
2533 businessVariables[x][bVault] = cache_get_field_content_int(i, "businessVault");
2534 businessVariables[x][bMiscPos][0] = cache_get_field_content_float(i, "businessMiscX");
2535 businessVariables[x][bMiscPos][1] = cache_get_field_content_float(i, "businessMiscY");
2536 businessVariables[x][bMiscPos][2] = cache_get_field_content_float(i, "businessMiscZ");
2537
2538 switch(businessVariables[x][bLocked]) {
2539 case 1: {
2540 if(!strcmp(businessVariables[x][bOwner], "Nobody", true)) {
2541 format(result, sizeof(result), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\n(locked)", businessVariables[x][bName], x, businessVariables[x][bPrice]);
2542 }
2543 else {
2544 format(result, sizeof(result), "%s\n(Business %d - owned by %s)\n\n(locked)", businessVariables[x][bName], x, businessVariables[x][bOwner]);
2545 }
2546 }
2547 case 0: {
2548 if(!strcmp(businessVariables[x][bOwner], "Nobody", true)) {
2549 format(result, sizeof(result), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\nPress CROUCH to enter", businessVariables[x][bName], x, businessVariables[x][bPrice]);
2550 }
2551 else {
2552 format(result, sizeof(result), "%s\n(Business %d - owned by %s)\n\nPress CROUCH to enter", businessVariables[x][bName], x, businessVariables[x][bOwner]);
2553 }
2554 }
2555 }
2556
2557 businessVariables[x][bLabelID] = CreateDynamic3DTextLabel(result, COLOR_YELLOW, businessVariables[x][bExteriorPos][0], businessVariables[x][bExteriorPos][1], businessVariables[x][bExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
2558 businessVariables[x][bPickupID] = CreateDynamicPickup(1239, 23, businessVariables[x][bExteriorPos][0], businessVariables[x][bExteriorPos][1], businessVariables[x][bExteriorPos][2], 0, 0, -1, 250);
2559 systemVariables[businessCount]++;
2560 }
2561 printf("[MySQL Business] %d business loaded.", systemVariables[businessCount]);
2562 } else print("[MySQL Business]: Your business table is empty !");
2563 cache_delete(r);
2564 return 1;
2565}
2566
2567function LoadVehicles()
2568{
2569 new
2570 Cache: r = mysql_query(SQL, "SELECT * FROM `vehicles`", true);
2571
2572 if(cache_get_row_count())
2573 {
2574 for(new i = 0, x; i < cache_get_row_count(); i++)
2575 {
2576 x = cache_get_field_content_int(i, "vehicleID");
2577
2578 if(systemVariables[vehicleCounts][0] + systemVariables[vehicleCounts][1] + systemVariables[vehicleCounts][2] < MAX_VEHICLES)
2579 {
2580 vehicleVariables[x][vVehicleModelID] = cache_get_field_content_int(i, "vehicleModelID");
2581 vehicleVariables[x][vVehiclePosition][0] = cache_get_field_content_float(i, "vehiclePosX");
2582 vehicleVariables[x][vVehiclePosition][1] = cache_get_field_content_float(i, "vehiclePosY");
2583 vehicleVariables[x][vVehiclePosition][2] = cache_get_field_content_float(i, "vehiclePosZ");
2584 vehicleVariables[x][vVehicleRotation] = cache_get_field_content_float(i, "vehiclePosRotation");
2585 vehicleVariables[x][vVehicleGroup] = cache_get_field_content_int(i, "vehicleGroup");
2586 vehicleVariables[x][vVehicleColour][0] = cache_get_field_content_int(i, "vehicleCol1");
2587 vehicleVariables[x][vVehicleColour][1] = cache_get_field_content_int(i, "vehicleCol2");
2588 vehicleVariables[x][vVehicleColour][0] = vehicleVariables[x][vVehicleColour][0] < 0 ? random(126) : vehicleVariables[x][vVehicleColour][0];
2589 vehicleVariables[x][vVehicleColour][1] = vehicleVariables[x][vVehicleColour][1] < 0 ? random(126) : vehicleVariables[x][vVehicleColour][1];
2590 vehicleVariables[x][vVehicleScriptID] = CreateVehicle(vehicleVariables[x][vVehicleModelID], vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2], vehicleVariables[x][vVehicleRotation], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1], 60000);
2591
2592 switch(vehicleVariables[x][vVehicleModelID]) { // OnVehicleSpawn has some annoying glitches with this!1. Should fix.
2593 case 427, 428, 432, 601, 528: SetVehicleHealth(vehicleVariables[x][vVehicleScriptID], 5000.0);
2594 }
2595 systemVariables[vehicleCounts][0]++;
2596 }
2597 }
2598 printf("[MySQL Vehicles] %d vehicles loaded.", systemVariables[vehicleCounts][0]);
2599 } else print("[MySQL Vehicles]: Your vehicles table is empty.");
2600 cache_delete(r);
2601 return 1;
2602}
2603
2604function LoadJobs()
2605{
2606 new
2607 Cache: r = mysql_query(SQL, "SELECT * FROM `jobs`", true),
2608 labelString[96], x;
2609
2610 if(cache_get_row_count())
2611 {
2612 for(new i = 0; i < cache_get_row_count(); i++)
2613 {
2614 x = cache_get_field_content_int(i, "jobID");
2615 jobVariables[x][jJobType] = cache_get_field_content_int(i, "jobType");
2616 jobVariables[x][jJobPosition][0] = cache_get_field_content_float(i, "jobPositionX");
2617 jobVariables[x][jJobPosition][1] = cache_get_field_content_float(i, "jobPositionY");
2618 jobVariables[x][jJobPosition][2] = cache_get_field_content_float(i, "jobPositionZ");
2619 cache_get_field_content(i, "jobName", jobVariables[x][jJobName], SQL, 32);
2620
2621 format(labelString, sizeof(labelString), "Job %s\nType /getjob", jobVariables[x][jJobName]);
2622
2623 jobVariables[x][jJobPickupID] = CreateDynamicPickup(1239, 23, jobVariables[x][jJobPosition][0], jobVariables[x][jJobPosition][1], jobVariables[x][jJobPosition][2], 0, -1, -1, 50);
2624 jobVariables[x][jJobLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, jobVariables[x][jJobPosition][0], jobVariables[x][jJobPosition][1], jobVariables[x][jJobPosition][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 50.0);
2625 }
2626 printf("[MySQL Jobs] %d jobs loaded.", cache_get_row_count());
2627 } else print("[MySQL Jobs]: Your jobs table is empty.");
2628 cache_delete(r);
2629 return 1;
2630}
2631
2632function LoadGroups()
2633{
2634 new
2635 Cache: r = mysql_query(SQL, "SELECT * FROM `groups`", true),
2636 labelString[96];
2637
2638 if(cache_get_row_count())
2639 {
2640 for(new i = 0, x; i < cache_get_row_count(); i++)
2641 {
2642 x = cache_get_field_content_int(i, "groupID");
2643
2644 cache_get_field_content(i, "groupMOTD", groupVariables[x][gGroupMOTD], SQL, 128);
2645 cache_get_field_content(i, "groupRankName1", groupVariables[x][gGroupRankName1], SQL, 32);
2646 cache_get_field_content(i, "groupRankName2", groupVariables[x][gGroupRankName2], SQL, 32);
2647 cache_get_field_content(i, "groupRankName3", groupVariables[x][gGroupRankName3], SQL, 32);
2648 cache_get_field_content(i, "groupRankName4", groupVariables[x][gGroupRankName4], SQL, 32);
2649 cache_get_field_content(i, "groupRankName5", groupVariables[x][gGroupRankName5], SQL, 32);
2650 cache_get_field_content(i, "groupRankName6", groupVariables[x][gGroupRankName6], SQL, 32);
2651 cache_get_field_content(i, "groupName", groupVariables[x][gGroupName], SQL, 64);
2652
2653 groupVariables[x][gGroupType] = cache_get_field_content_int(i, "groupType");
2654 groupVariables[x][gGroupHQInteriorID] = cache_get_field_content_int(i, "groupHQInteriorID");
2655 groupVariables[x][gGroupHQLockStatus] = cache_get_field_content_int(i, "groupHQLockStatus");
2656 groupVariables[x][gSafe][0] = cache_get_field_content_int(i, "groupSafeMoney");
2657 groupVariables[x][gSafe][1] = cache_get_field_content_int(i, "groupSafeMats");
2658
2659 groupVariables[x][gGroupExteriorPos][0] = cache_get_field_content_float(i, "groupHQExteriorPosX");
2660 groupVariables[x][gGroupExteriorPos][1] = cache_get_field_content_float(i, "groupHQExteriorPosY");
2661 groupVariables[x][gGroupExteriorPos][2] = cache_get_field_content_float(i, "groupHQExteriorPosZ");
2662 groupVariables[x][gGroupInteriorPos][0] = cache_get_field_content_float(i, "groupHQInteriorPosX");
2663 groupVariables[x][gGroupInteriorPos][1] = cache_get_field_content_float(i, "groupHQInteriorPosY");
2664 groupVariables[x][gGroupInteriorPos][2] = cache_get_field_content_float(i, "groupHQInteriorPosZ");
2665 groupVariables[x][gSafePos][0] = cache_get_field_content_float(i, "groupSafePosX");
2666 groupVariables[x][gSafePos][1] = cache_get_field_content_float(i, "groupSafePosY");
2667 groupVariables[x][gSafePos][2] = cache_get_field_content_float(i, "groupSafePosZ");
2668
2669 switch(groupVariables[x][gGroupHQLockStatus]) {
2670 case 0: format(labelString, sizeof(labelString), "%s's HQ\n\nPress CROUCH to enter.", groupVariables[x][gGroupName]);
2671 case 1: format(labelString, sizeof(labelString), "%s's HQ\n\n(locked)", groupVariables[x][gGroupName]);
2672 }
2673
2674 groupVariables[x][gGroupPickupID] = CreateDynamicPickup(1239, 23, groupVariables[x][gGroupExteriorPos][0], groupVariables[x][gGroupExteriorPos][1], groupVariables[x][gGroupExteriorPos][2], 0, -1, -1, 10);
2675 groupVariables[x][gGroupLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, groupVariables[x][gGroupExteriorPos][0], groupVariables[x][gGroupExteriorPos][1], groupVariables[x][gGroupExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
2676
2677 format(labelString, sizeof(labelString), "%s\nGroup Safe", groupVariables[x][gGroupName]);
2678
2679 groupVariables[x][gSafePickupID] = CreateDynamicPickup(1239, 23, groupVariables[x][gSafePos][0], groupVariables[x][gSafePos][1], groupVariables[x][gSafePos][2], GROUP_VIRTUAL_WORLD+x, groupVariables[x][gGroupHQInteriorID], -1, 10);
2680 groupVariables[x][gSafeLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, groupVariables[x][gSafePos][0], groupVariables[x][gSafePos][1], groupVariables[x][gSafePos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, GROUP_VIRTUAL_WORLD+x, groupVariables[x][gGroupHQInteriorID], -1, 20.0);
2681 }
2682 printf("[MySQL Groups] %d groups loaded.", cache_get_row_count());
2683 } else print("[MySQL Groups]: Your group table is empty.");
2684 cache_delete(r);
2685 return 1;
2686}
2687
2688function LoadAssets()
2689{
2690 new
2691 Cache: r = mysql_query(SQL, "SELECT * FROM `assets`", true);
2692
2693 if(cache_get_row_count())
2694 {
2695 for(new i = 0, x; i < cache_get_row_count(); i++)
2696 {
2697 x = cache_get_field_content_int(i, "assetID");
2698 assetVariables[x][aAssetValue] = cache_get_field_content_int(i, "assetValue");
2699 cache_get_field_content(i, "assetName", assetVariables[x][aAssetName], SQL, 32);
2700 }
2701 printf("[MySQL Assets] %d assets loaded.", cache_get_row_count());
2702 } else print("[MySQL Assets]: Your assets table is empty.");
2703 cache_delete(r);
2704 return 1;
2705}
2706
2707stock showStats(playerid, targetid) {
2708 new
2709 szMessage[128],
2710 param1[32],
2711 date[3],
2712 param2[32],
2713 param4[32],
2714 param3[32]; // I'll add one or two more of these later, they'll be used to show things like sex (if sex = whatever, param1 = "Male";). And we can use them over and over again.
2715
2716 SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
2717
2718 getdate(date[0], date[1], date[2]);
2719
2720 if(P_DATA[targetid][pJob] == 0) { param1 = "Unemployed"; }
2721 else { strcpy(param1, jobVariables[P_DATA[targetid][pJob]][jJobName], sizeof(param1)); } // dest, source, length format(param1, sizeof(param1),"%s",jobVariables[P_DATA[targetid][pJob]][jJobName]); }
2722
2723 switch(P_DATA[targetid][pGender]) { //{ param2 = "Male"; } else { param2 = "Female"; }
2724 case 1: param2 = "Male";
2725 case 2: param2 = "Female";
2726 default: param2 = "Unknown";
2727 }
2728
2729 if(P_DATA[targetid][pPhoneNumber] != -1) { format(param3,sizeof(param3),"%d",P_DATA[targetid][pPhoneNumber]); }
2730 else { param3 = "None"; }
2731
2732 format(szMessage, sizeof(szMessage), "%s | Age: %d (born %d) | Gender: %s | Playing hours: %d | Phone number: %s | Job: %s", P_DATA[targetid][pNormalName], date[0]-P_DATA[targetid][pAge], P_DATA[targetid][pAge], param2, P_DATA[targetid][pPlayingHours], param3, param1, param4);
2733 SendClientMessage(playerid, COLOR_WHITE, szMessage);
2734
2735 if(P_DATA[targetid][pGroup] < 1) {
2736 param1 = "None";
2737 param2 = "None";
2738 }
2739 else {
2740 strcpy(param1, groupVariables[P_DATA[targetid][pGroup]][gGroupName], sizeof(param1));
2741 switch(P_DATA[targetid][pGroupRank]) { // strcpy(dest, source, length);
2742 case 1: strcpy(param2, groupVariables[P_DATA[targetid][pGroup]][gGroupRankName1], sizeof(param2));
2743 case 2: strcpy(param2, groupVariables[P_DATA[targetid][pGroup]][gGroupRankName2], sizeof(param2));
2744 case 3: strcpy(param2, groupVariables[P_DATA[targetid][pGroup]][gGroupRankName3], sizeof(param2));
2745 case 4: strcpy(param2, groupVariables[P_DATA[targetid][pGroup]][gGroupRankName4], sizeof(param2));
2746 case 5: strcpy(param2, groupVariables[P_DATA[targetid][pGroup]][gGroupRankName5], sizeof(param2));
2747 case 6: strcpy(param2, groupVariables[P_DATA[targetid][pGroup]][gGroupRankName6], sizeof(param2));
2748 }
2749 }
2750
2751 if(P_DATA[targetid][pWalkieTalkie] == -1) param3 = "None";
2752 else if(P_DATA[targetid][pWalkieTalkie] == 0) param3 = "Disabled";
2753 else format(param3, sizeof(param3), "#%d khz", P_DATA[targetid][pWalkieTalkie]);
2754
2755 format(szMessage, sizeof(szMessage), "Group: %s | Rank: %s (%d) | Bank: $%d | Cash: $%d | Materials: %d | Radio: %s", param1, param2, P_DATA[targetid][pGroupRank], P_DATA[targetid][pBankMoney], P_DATA[targetid][pMoney], P_DATA[targetid][pMaterials], param3);
2756 SendClientMessage(playerid, COLOR_WHITE, szMessage);
2757
2758 format(szMessage, sizeof(szMessage), "Rope: %d | Weapon skill: %d (%d weapons) | Tracking skill: %d (%d searches) | Arrests: %d | Crimes: %d | Credit: $%d", P_DATA[targetid][pRope], P_DATA[targetid][pJobSkill][0]/50, P_DATA[targetid][pJobSkill][0], P_DATA[targetid][pJobSkill][1]/50, P_DATA[targetid][pJobSkill][1], P_DATA[targetid][pArrests], P_DATA[targetid][pCrimes], P_DATA[targetid][pPhoneCredit] / 60);
2759 SendClientMessage(playerid, COLOR_WHITE, szMessage);
2760
2761 if(P_DATA[playerid][pAdmin] >= 1) {
2762
2763 new
2764 Float:HAFloats[2];
2765
2766 GetPlayerHealth(targetid,HAFloats[0]);
2767 GetPlayerArmour(targetid,HAFloats[1]);
2768
2769 if(P_DATA[targetid][pStatus] != 1) param1 = "Unauthenticated"; else param1 = "Authenticated";
2770 format(szMessage, sizeof(szMessage), "Status: %s | Admin Level: %d | Interior: %d | VW: %d | House: %d | Business: %d | Vehicle: %s", param1, P_DATA[targetid][pAdmin], P_DATA[targetid][pInterior], P_DATA[targetid][pVirtualWorld], getPlayerHouseID(targetid), getPlayerBusinessID(targetid), param4);
2771 SendClientMessage(playerid, COLOR_WHITE, szMessage);
2772 }
2773
2774 SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
2775 return 1;
2776}
2777
2778stock submitToAdmins(string[], color) {
2779 foreach(new x : Player) {
2780 if(P_DATA[x][pAdmin] >= 1) {
2781 SendClientMessage(x, color, string);
2782 }
2783 }
2784 return 1;
2785}
2786
2787stock substr_count(substring[], string[])
2788{
2789 new
2790 tmpcount;
2791
2792 for( new i = 0; i < strlen(string); i++)
2793 {
2794 if(strfind(string[i], substring, true))
2795 {
2796 tmpcount++;
2797 }
2798 }
2799 return tmpcount;
2800}
2801
2802public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) {
2803
2804 if(newinteriorid == 0) {
2805 SetPlayerWeather(playerid, weatherVariables[0]);
2806 SetPlayerVirtualWorld(playerid, 0); // Setting their virtual world in interior 0 keeps some annoying VW issues at bay.
2807 }
2808 else SetPlayerWeather(playerid, INTERIOR_WEATHER_ID);
2809
2810 if(P_DATA[playerid][pSpectating] == INVALID_PLAYER_ID && P_DATA[playerid][pEvent] == 0) {
2811 P_DATA[playerid][pInterior] = newinteriorid;
2812 P_DATA[playerid][pVirtualWorld] = GetPlayerVirtualWorld(playerid);
2813 }
2814 return 1;
2815}
2816
2817public OnPlayerExitVehicle(playerid, vehicleid) {
2818 SetPlayerArmedWeapon(playerid, 0);
2819 if(InLesson[playerid] == 1) PlayerTextDrawHide(playerid, DMV[0]),PlayerTextDrawHide(playerid, DMV[1]),DestroyVehicle(masinaexamen[playerid]),DisableRemoteVehicleCollisions(playerid,0),DisablePlayerCheckpoint(playerid),masinaexamen[playerid] = 0,InLesson[playerid] = 0,SCM(playerid, COLOR_WHITE, "Ai picat examenul pentru ca ai coborat din masina.");
2820 return 1;
2821}
2822
2823stock IsAPlane(vehicleid) {
2824 switch(GetVehicleModel(vehicleid)) {
2825 case 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513, 548, 425, 417, 487, 488, 497, 563, 447, 469: return 1;
2826 }
2827 return 0;
2828}
2829
2830stock IsABoat(vehicleid) {
2831 switch(GetVehicleModel(vehicleid)) {
2832 case 472, 473, 493, 595, 484, 430, 453, 452, 446, 454: return 1;
2833 }
2834 return 0;
2835}
2836
2837stock IsACopCar(vehicleid) {
2838 switch(GetVehicleModel(vehicleid)) {
2839 case 596 .. 599: return 1;
2840 }
2841 return 0;
2842}
2843
2844public OnPlayerStateChange(playerid, newstate, oldstate) {
2845 if(newstate == PLAYER_STATE_DRIVER) {
2846 new v = GetPlayerVehicleID(playerid);
2847 if(IsAnOwnableVehicle(v))
2848 {
2849 if(V_DATA[v][vInsurancePoints] <= 0)
2850 {
2851 RemovePlayerFromVehicle(playerid);
2852 SCM(playerid, -1, ""B"(Server)"W": This vehicle insurance is not valid anymore !");
2853 if(P_DATA[playerid][pVeh][V_DATA[v][vSlot]] == v)
2854 SCM(playerid, -1, ""B"(Server)"W": Use /v to pay this vehicle insurance !");
2855 return 1;
2856 }
2857 new szString[128];
2858 format(szString, sizeof(szString), "This %s (ID %d) is owned by %s | Age: %d days | Odometer: %.02f km | colors %d, %d", VehicleNames[GetVehicleModel(v)-400], v, V_DATA[v][szvOwner], TsToDays(V_DATA[v][vAge]), V_DATA[v][vKM], V_DATA[v][vCol][0], V_DATA[v][vCol][1]);
2859 SCM(playerid, -1, szString);
2860 GetVehiclePos(v, vP[v][0], vP[v][1], vP[v][2]);
2861 }
2862
2863 SetPlayerArmedWeapon(playerid, 0);
2864 new engine,lights,alarm,doors,bonnet,boot,objective;
2865 switch(CarEngine[v]) {
2866 case 0: GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective), SetVehicleParamsEx(v,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
2867 case 1: GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective), SetVehicleParamsEx(v,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
2868 }
2869 if(IsABike(v)) {
2870 TogglePlayerControllable(playerid, 1),CarEngine[v] = 1;
2871 GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective),SetVehicleParamsEx(v,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
2872 }
2873 }
2874 if(newstate == 3) {
2875 if(IsAPlane(GetPlayerVehicleID(playerid))) {
2876 givePlayerValidWeapon(playerid, 46);
2877 }
2878 }
2879 else if(newstate == 2) { // Removed the passenger check, as it caused weapons to bug.
2880
2881 if(P_DATA[playerid][pEvent] == 0) {
2882 ResetPlayerWeapons(playerid);
2883 givePlayerWeapons(playerid);
2884 }
2885 if(IsAPlane(GetPlayerVehicleID(playerid))) {
2886 givePlayerValidWeapon(playerid, 46);
2887 }
2888
2889 for(new i = 0; i < MAX_VEHICLES; i++) {
2890 if(vehicleVariables[i][vVehicleScriptID] == GetPlayerVehicleID(playerid) && vehicleVariables[i][vVehicleGroup] != 0 && vehicleVariables[i][vVehicleGroup] != P_DATA[playerid][pGroup]) {
2891
2892 if(P_DATA[playerid][pAdmin] >= 1 && P_DATA[playerid][pAdminDuty] >= 1) {
2893
2894 new
2895 szMessage[128];
2896
2897 format(szMessage, sizeof(szMessage), "This %s (model %d, ID %d) is locked to group %s (%d).", VehicleNames[GetVehicleModel(i) - 400], GetVehicleModel(i), i, groupVariables[vehicleVariables[i][vVehicleGroup]][gGroupName], vehicleVariables[i][vVehicleGroup]);
2898 SendClientMessage(playerid, COLOR_GREY, szMessage);
2899 return 1;
2900 }
2901 else {
2902 SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
2903 RemovePlayerFromVehicle(playerid);
2904 return 1;
2905 }
2906 }
2907 }
2908 }
2909
2910 foreach(new x : Player) {
2911 if(P_DATA[x][pSpectating] != INVALID_PLAYER_ID && P_DATA[x][pSpectating] == playerid) {
2912 if(newstate == 2 && oldstate == 1 || newstate == 3 && oldstate == 1) {
2913 PlayerSpectateVehicle(x, GetPlayerVehicleID(playerid));
2914 }
2915 else {
2916 PlayerSpectatePlayer(x, playerid);
2917 }
2918 }
2919 }
2920 return 1;
2921}
2922
2923public OnVehicleStreamIn(vehicleid, forplayerid) {
2924 return 1;
2925}
2926
2927stock getPlayerCheckpointReason(playerid) {
2928 new
2929 szMessage[32];
2930
2931 switch(P_DATA[playerid][pCheckpoint]) {
2932 case 1: {
2933 format(szMessage, sizeof(szMessage), "Detective");
2934 return szMessage;
2935 }
2936 case 2: {
2937 format(szMessage, sizeof(szMessage), "Matrun");
2938 return szMessage;
2939 }
2940 case 3: {
2941 format(szMessage, sizeof(szMessage), "Dropcar");
2942 return szMessage;
2943 }
2944 case 4: {
2945 format(szMessage, sizeof(szMessage), "Findcar");
2946 return szMessage;
2947 }
2948 case 5: {
2949 format(szMessage, sizeof(szMessage), "Backup");
2950 return szMessage;
2951 }
2952 case 6: {
2953 format(szMessage, sizeof(szMessage), "Home/Business");
2954 return szMessage;
2955 }
2956 }
2957
2958 format(szMessage, sizeof(szMessage), "01x05");
2959 return szMessage;
2960}
2961
2962public OnPlayerEnterCheckpoint(playerid) {
2963
2964 switch(CP[playerid])
2965 {
2966 case FIND_VEHICLE:
2967 {
2968 FollowingCP[playerid] = false;
2969 CP[playerid] = 0;
2970 DeletePVar(playerid, "toFindVehicle");
2971 SendClientMessage(playerid, -1, "You have reached your vehicle.");
2972 DisablePlayerCheckpoint(playerid);
2973 }
2974 }
2975
2976 switch(P_DATA[playerid][pCheckpoint]) {
2977 case 1: {
2978 SendClientMessage(playerid, COLOR_WHITE, "You have reached your destination.");
2979 DisablePlayerCheckpoint(playerid);
2980
2981 P_DATA[playerid][pCheckpoint] = 0;
2982 }
2983 case 2: {
2984 if(P_DATA[playerid][pMatrunTime] < 30) {
2985 new
2986 playerName[MAX_PLAYER_NAME],
2987 playerMsg[128];
2988
2989 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
2990
2991 format(playerMsg, sizeof(playerMsg), "Warning: {FFFFFF}%s may possibly be teleport matrunning (reached checkpoint in %d seconds).", playerName, P_DATA[playerid][pMatrunTime]);
2992 submitToAdmins(playerMsg, COLOR_HOTORANGE);
2993 }
2994 else {
2995 SendClientMessage(playerid, COLOR_WHITE, "You have collected 100 materials!");
2996 DisablePlayerCheckpoint(playerid);
2997
2998 P_DATA[playerid][pCheckpoint] = 0;
2999 P_DATA[playerid][pMaterials] += 100;
3000 P_DATA[playerid][pMatrunTime] = 0;
3001 }
3002 }
3003 case 3: {
3004 if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You aren't in a vehicle; please get a vehicle to drop off at the crane.");
3005
3006 new
3007 string[61],
3008 rand;
3009
3010 switch(GetVehicleModel(GetPlayerVehicleID(playerid))) { // Thanks to Danny for these, lol
3011 case 405: rand = random(2000) + 2500;
3012 case 561: rand = random(2000) + 2750;
3013 case 535: rand = random(2000) + 2250;
3014 case 463: rand = random(2000) + 2000;
3015 case 461: rand = random(2000) + 2500;
3016 case 429: rand = random(2000) + 4500;
3017 case 451: rand = random(2000) + 4750;
3018 case 491: rand = random(2000) + 1800;
3019 case 492: rand = random(2000) + 1500;
3020 case 603: rand = random(2000) + 3800;
3021 case 502: rand = random(2000) + 5000;
3022 case 558: rand = random(2000) + 2500;
3023 case 554: rand = random(2000) + 1900;
3024 case 588: rand = random(2000) + 2300;
3025 case 518: rand = random(2000) + 2250;
3026 case 475: rand = random(2000) + 2300;
3027 case 542: rand = random(2000) + 2000;
3028 case 466: rand = random(2000) + 2400;
3029 case 462: rand = random(2000) + 500;
3030 case 596: rand = random(2000) + 3000;
3031 case 427: rand = random(2000) + 4500;
3032 case 528: rand = random(2000) + 4250;
3033 case 601: rand = random(2000) + 5000;
3034 case 523: rand = random(2000) + 3000;
3035 case 600: rand = random(2000) + 2250;
3036 case 468: rand = random(2000) + 2000;
3037 case 418: rand = random(2000) + 2100;
3038 case 482: rand = random(2000) + 2750;
3039 case 440: rand = random(2000) + 2250;
3040 case 587: rand = random(2000) + 3800;
3041 case 412: rand = random(2000) + 2500;
3042 case 534: rand = random(2000) + 2700;
3043 case 536: rand = random(2000) + 2600;
3044 case 567: rand = random(2000) + 2650;
3045 case 448: rand = random(2000) + 550;
3046 case 602: rand = random(2000) + 3100;
3047 case 586: rand = random(2000) + 2200;
3048 case 421: rand = random(2000) + 2900;
3049 case 581: rand = random(2000) + 2250;
3050 case 521: rand = random(2000) + 2750;
3051 case 598: rand = random(2000) + 3250;
3052 case 574: rand = random(2000) + 750;
3053 case 500: rand = random(2000) + 2700;
3054 case 579: rand = random(2000) + 3100;
3055 case 467: rand = random(2000) + 2000;
3056 case 426: rand = random(2000) + 2600;
3057 case 555: rand = random(2000) + 3250;
3058 case 437: rand = random(2000) + 4800;
3059 case 428: rand = random(2000) + 4750;
3060 case 442: rand = random(2000) + 2200;
3061 case 458: rand = random(2000) + 2000;
3062 case 527: rand = random(2000) + 1950;
3063 case 496: rand = random(2000) + 2100;
3064 case 400: rand = random(2000) + 3000;
3065 case 605: rand = random(2000) + 900;
3066 case 604: rand = random(2000) + 900;
3067 case 522: rand = random(2000) + 5000;
3068 case 438: rand = random(2000) + 2750;
3069 case 420: rand = random(2000) + 2600;
3070 case 404: rand = random(2000) + 1250;
3071 case 585: rand = random(2000) + 2400;
3072 case 543: rand = random(2000) + 2000;
3073 case 515: rand = random(2000) + 4500;
3074 case 560: rand = random(2000) + 3900;
3075 case 409: rand = random(2000) + 2950;
3076 case 402: rand = random(2000) + 3250;
3077 default: rand = random(2000) + 1000;
3078 }
3079
3080 P_DATA[playerid][pDropCarTimeout] = 1800;
3081 P_DATA[playerid][pCheckpoint] = 0;
3082 DisablePlayerCheckpoint(playerid);
3083 P_DATA[playerid][pMoney] += rand;
3084
3085 format(string, sizeof(string), "You have dropped your vehicle at the crane and earned $%d!", rand);
3086 SendClientMessage(playerid, COLOR_WHITE, string);
3087 }
3088 case 4: {
3089
3090 SendClientMessage(playerid, COLOR_WHITE, "You have reached your vehicle.");
3091 DisablePlayerCheckpoint(playerid);
3092
3093 P_DATA[playerid][pCheckpoint] = 0;
3094
3095 }
3096 case 5: {
3097 if(P_DATA[playerid][pBackup] != -1) {
3098
3099 SendClientMessage(playerid, COLOR_WHITE, "You have reached the backup checkpoint.");
3100 DisablePlayerCheckpoint(playerid);
3101
3102 P_DATA[playerid][pCheckpoint] = 0;
3103 P_DATA[playerid][pBackup] = -1;
3104 }
3105 }
3106 default: {
3107 DisablePlayerCheckpoint(playerid);
3108 P_DATA[playerid][pCheckpoint] = 0;
3109 }
3110 }
3111 return 1;
3112}
3113
3114public OnPlayerUpdate(playerid)
3115{
3116 if(P_DATA[playerid][pTabbed] == 1)
3117 {
3118 P_DATA[playerid][pTabbed] = 0;
3119 DestroyDynamic3DTextLabel(P_DATA[playerid][pAFKLabel]);
3120 if(P_DATA[playerid][pOutstandingWeaponRemovalSlot] >= 1) {
3121 if(P_DATA[playerid][pOutstandingWeaponRemovalSlot] == 40) {
3122 ResetPlayerWeapons(playerid);
3123 }
3124 else {
3125 ResetPlayerWeapons(playerid);
3126 P_DATA[playerid][pWeapons][P_DATA[playerid][pOutstandingWeaponRemovalSlot]] = 0;
3127 givePlayerWeapons(playerid);
3128 }
3129 P_DATA[playerid][pAnticheatExemption] = 6;
3130 }
3131 }
3132 if(GetPlayerState(playerid) == 2) {
3133 for(new v; v < MAX_SPIKES; v++) {
3134 if(spikeVariables[v][sPos][0] != 0 && spikeVariables[v][sPos][1] != 0 && spikeVariables[v][sPos][2] != 0) {
3135 if(IsVehicleInRangeOfPoint(GetPlayerVehicleID(playerid), 2.0, spikeVariables[v][sPos][0], spikeVariables[v][sPos][1], spikeVariables[v][sPos][2])) {
3136
3137 new
3138 Damage[4];
3139
3140 GetVehicleDamageStatus(GetPlayerVehicleID(playerid), Damage[0], Damage[1], Damage[2], Damage[3]); // Set tires to 15 and watch 'em pop.
3141 UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), Damage[0], Damage[1], Damage[2], 15);
3142 }
3143 }
3144 }
3145 }
3146 P_DATA[playerid][pConnectedSeconds] = gettime();
3147 return 1;
3148}
3149
3150stock saveBusiness(id) {
3151 if(strlen(businessVariables[id][bOwner]) >= 1) {
3152 new
3153 queryString[1424];
3154
3155 format(queryString, sizeof(queryString), "UPDATE businesses SET businessExteriorX = '%f', businessExteriorY = '%f', businessExteriorZ = '%f', businessInteriorX = '%f', businessInteriorY = '%f', businessInteriorZ = '%f', businessInterior = '%d', businessType = '%d', businessName = '%s', businessOwner = '%s', businessPrice = '%d', businessVault = '%d', businessLock = '%d', businessMiscX = '%f', businessMiscY = '%f', businessMiscZ = '%f' WHERE businessID = '%d'", businessVariables[id][bExteriorPos][0],
3156 businessVariables[id][bExteriorPos][1], businessVariables[id][bExteriorPos][2], businessVariables[id][bInteriorPos][0], businessVariables[id][bInteriorPos][1], businessVariables[id][bInteriorPos][2], businessVariables[id][bInterior], businessVariables[id][bType], businessVariables[id][bName], businessVariables[id][bOwner], businessVariables[id][bPrice], businessVariables[id][bVault], businessVariables[id][bLocked], businessVariables[id][bMiscPos][0],
3157 businessVariables[id][bMiscPos][1], businessVariables[id][bMiscPos][2], id);
3158 mysql_query(SQL, queryString);
3159 }
3160 else {
3161 return false;
3162 }
3163
3164 return 1;
3165}
3166
3167stock saveVehicle(id) {
3168 if(vehicleVariables[id][vVehicleModelID] >= 1) {
3169 new
3170 queryString[255];
3171
3172 GetVehiclePos(vehicleVariables[id][vVehicleScriptID], vehicleVariables[id][vVehiclePosition][0], vehicleVariables[id][vVehiclePosition][1], vehicleVariables[id][vVehiclePosition][2]);
3173 GetVehicleZAngle(vehicleVariables[id][vVehicleScriptID], vehicleVariables[id][vVehicleRotation]);
3174
3175 format(queryString, sizeof(queryString), "UPDATE vehicles SET vehicleModelID = '%d', vehiclePosX = '%f', vehiclePosY = '%f', vehiclePosZ = '%f', vehiclePosRotation = '%f', vehicleGroup = '%d', vehicleCol1 = '%d', vehicleCol2 = '%d' WHERE vehicleID = '%d'", vehicleVariables[id][vVehicleModelID], vehicleVariables[id][vVehiclePosition][0],
3176 vehicleVariables[id][vVehiclePosition][1], vehicleVariables[id][vVehiclePosition][2], vehicleVariables[id][vVehicleRotation], vehicleVariables[id][vVehicleGroup], vehicleVariables[id][vVehicleColour][0], vehicleVariables[id][vVehicleColour][1], id);
3177 mysql_query(SQL, queryString);
3178 }
3179 return 1;
3180}
3181
3182stock saveHouse(id) {
3183 if(strlen(houseVariables[id][hHouseOwner]) >= 1) {
3184 // This way we can check if the house exists, without having to worry about submitting a select query for something so minor.
3185
3186 new
3187 queryString[1024]; // My usual excuse... We have a lot to update (or just variables with excessive names in length!!1).
3188
3189 format(queryString, sizeof(queryString), "UPDATE houses SET houseExteriorPosX = '%f', houseExteriorPosY = '%f', houseExteriorPosZ = '%f', houseInteriorPosX = '%f', houseInteriorPosY = '%f', houseInteriorPosZ = '%f'", houseVariables[id][hHouseExteriorPos][0], houseVariables[id][hHouseExteriorPos][1], houseVariables[id][hHouseExteriorPos][2], houseVariables[id][hHouseInteriorPos][0], houseVariables[id][hHouseInteriorPos][1], houseVariables[id][hHouseInteriorPos][2]);
3190 format(queryString, sizeof(queryString), "%s, housePrice = '%d', houseOwner = '%s', houseExteriorID = '%d', houseInteriorID = '%d', houseLocked = '%d', houseMoney = '%d', houseMaterials = '%d', houseWeapon1 = '%d', houseWeapon2 = '%d', houseWeapon3 = '%d', houseWeapon4 = '%d', houseWeapon5 = '%d'", queryString, houseVariables[id][hHousePrice], houseVariables[id][hHouseOwner], houseVariables[id][hHouseExteriorID],
3191 houseVariables[id][hHouseInteriorID], houseVariables[id][hHouseLocked], houseVariables[id][hMoney], houseVariables[id][hMaterials], houseVariables[id][hWeapons][0], houseVariables[id][hWeapons][1], houseVariables[id][hWeapons][2], houseVariables[id][hWeapons][3], houseVariables[id][hWeapons][4]);
3192 format(queryString, sizeof(queryString), "%s, houseWardrobe1 = '%d', houseWardrobe2 = '%d', houseWardrobe3 = '%d', houseWardrobe4 = '%d', houseWardrobe5 = '%d' WHERE houseID = '%d'", queryString, houseVariables[id][hWardrobe][0], houseVariables[id][hWardrobe][1], houseVariables[id][hWardrobe][2], houseVariables[id][hWardrobe][3], houseVariables[id][hWardrobe][4], id);
3193 mysql_query(SQL, queryString);
3194 }
3195 else {
3196 return false;
3197 }
3198
3199 return 1;
3200}
3201
3202stock saveAsset(id) {
3203 if(strlen(assetVariables[id][aAssetName]) >= 1) {
3204 new
3205 queryString[128]; // YES! A SMALL QUERY! WHAT IS THIS? // OMG HOLY SHIT!11 ~bren
3206
3207 format(queryString, sizeof(queryString), "UPDATE assets SET assetName = '%s', assetValue = '%d' WHERE assetID = '%d'", assetVariables[id][aAssetName], assetVariables[id][aAssetValue]);
3208 mysql_query(SQL, queryString);
3209 }
3210 return 1;
3211}
3212
3213stock saveGroup(id) {
3214 if(strlen(groupVariables[id][gGroupName]) >= 1) {
3215 new
3216 queryString[1024]; // Some excuse for this long variable size.
3217
3218 format(queryString, sizeof(queryString), "UPDATE groups SET groupName = '%s', groupHQExteriorPosX = '%f', groupHQExteriorPosY = '%f', groupHQExteriorPosZ = '%f'", groupVariables[id][gGroupName], groupVariables[id][gGroupExteriorPos][0], groupVariables[id][gGroupExteriorPos][1], groupVariables[id][gGroupExteriorPos][2]);
3219 format(queryString, sizeof(queryString), "%s, groupHQInteriorID = '%d', groupHQLockStatus = '%d', groupHQInteriorPosX = '%f', groupHQInteriorPosY = '%f', groupHQInteriorPosZ = '%f', groupSafeMoney = '%d', groupSafeMats = '%d', groupMOTD = '%s'", queryString, groupVariables[id][gGroupHQInteriorID],
3220 groupVariables[id][gGroupHQLockStatus], groupVariables[id][gGroupInteriorPos][0], groupVariables[id][gGroupInteriorPos][1], groupVariables[id][gGroupInteriorPos][2], groupVariables[id][gSafe][0], groupVariables[id][gSafe][1], groupVariables[id][gGroupMOTD]);
3221 format(queryString, sizeof(queryString), "%s, groupRankName1 = '%s', groupRankName2 = '%s', groupRankName3 = '%s', groupRankName4 = '%s', groupRankName5 = '%s', groupRankName6 = '%s'", queryString, groupVariables[id][gGroupRankName1], groupVariables[id][gGroupRankName2], groupVariables[id][gGroupRankName3], groupVariables[id][gGroupRankName4], groupVariables[id][gGroupRankName5], groupVariables[id][gGroupRankName6]);
3222 format(queryString, sizeof(queryString), "%s, groupSafePosX = '%f', groupSafePosY = '%f', groupSafePosZ = '%f', groupType = '%d' WHERE groupID = '%d'", queryString, groupVariables[id][gSafePos][0], groupVariables[id][gSafePos][1], groupVariables[id][gSafePos][2], groupVariables[id][gGroupType], id);
3223 mysql_query(SQL, queryString);
3224 }
3225 else {
3226 return 0;
3227 }
3228
3229 return 1;
3230
3231}
3232
3233stock initiateJobs() {
3234 return LoadJobs();
3235}
3236
3237stock initiateBusinesses() {
3238 return LoadBusiness();
3239}
3240
3241stock initiateAssets() {
3242 return LoadAssets();
3243}
3244
3245stock initiateHouseSpawns() {
3246 return LoadHouses();
3247}
3248
3249stock initiateVehicleSpawns() {
3250 return LoadVehicles();
3251}
3252
3253stock initiateGroups() {
3254 return LoadGroups();
3255}
3256
3257stock clearScreen(playerid) {
3258 SendClientMessage(playerid, COLOR_WHITE, " ");
3259 SendClientMessage(playerid, COLOR_WHITE, " ");
3260 SendClientMessage(playerid, COLOR_WHITE, " ");
3261 SendClientMessage(playerid, COLOR_WHITE, " ");
3262 SendClientMessage(playerid, COLOR_WHITE, " ");
3263 SendClientMessage(playerid, COLOR_WHITE, " ");
3264 SendClientMessage(playerid, COLOR_WHITE, " ");
3265 SendClientMessage(playerid, COLOR_WHITE, " ");
3266 SendClientMessage(playerid, COLOR_WHITE, " ");
3267 SendClientMessage(playerid, COLOR_WHITE, " ");
3268 SendClientMessage(playerid, COLOR_WHITE, " ");
3269 SendClientMessage(playerid, COLOR_WHITE, " ");
3270 SendClientMessage(playerid, COLOR_WHITE, " ");
3271 SendClientMessage(playerid, COLOR_WHITE, " ");
3272 SendClientMessage(playerid, COLOR_WHITE, " ");
3273 SendClientMessage(playerid, COLOR_WHITE, " ");
3274 SendClientMessage(playerid, COLOR_WHITE, " ");
3275 SendClientMessage(playerid, COLOR_WHITE, " ");
3276 SendClientMessage(playerid, COLOR_WHITE, " ");
3277 SendClientMessage(playerid, COLOR_WHITE, " ");
3278 SendClientMessage(playerid, COLOR_WHITE, " ");
3279 SendClientMessage(playerid, COLOR_WHITE, " ");
3280 SendClientMessage(playerid, COLOR_WHITE, " ");
3281 SendClientMessage(playerid, COLOR_WHITE, " ");
3282 SendClientMessage(playerid, COLOR_WHITE, " ");
3283 SendClientMessage(playerid, COLOR_WHITE, " ");
3284 SendClientMessage(playerid, COLOR_WHITE, " ");
3285 SendClientMessage(playerid, COLOR_WHITE, " ");
3286 SendClientMessage(playerid, COLOR_WHITE, " ");
3287 SendClientMessage(playerid, COLOR_WHITE, " ");
3288 SendClientMessage(playerid, COLOR_WHITE, " ");
3289 SendClientMessage(playerid, COLOR_WHITE, " ");
3290 SendClientMessage(playerid, COLOR_WHITE, " ");
3291 SendClientMessage(playerid, COLOR_WHITE, " ");
3292 SendClientMessage(playerid, COLOR_WHITE, " ");
3293 SendClientMessage(playerid, COLOR_WHITE, " ");
3294 SendClientMessage(playerid, COLOR_WHITE, " ");
3295 SendClientMessage(playerid, COLOR_WHITE, " ");
3296 SendClientMessage(playerid, COLOR_WHITE, " ");
3297 return 1;
3298}
3299
3300PreloadAnimLib(playerid, animlib[])
3301{
3302 ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
3303}
3304
3305public OnPlayerSpawn(playerid) {
3306 if(UsedFly[playerid] == 1) StopFly(playerid),UsedFly[playerid] = 0;
3307 PreloadAnimLib(playerid,"BOMBER");
3308 PreloadAnimLib(playerid,"RAPPING");
3309 PreloadAnimLib(playerid,"SHOP");
3310 PreloadAnimLib(playerid,"BEACH");
3311 PreloadAnimLib(playerid,"SMOKING");
3312 PreloadAnimLib(playerid,"ON_LOOKERS");
3313 PreloadAnimLib(playerid,"DEALER");
3314 PreloadAnimLib(playerid,"CRACK");
3315 PreloadAnimLib(playerid,"CARRY");
3316 PreloadAnimLib(playerid,"COP_AMBIENT");
3317 PreloadAnimLib(playerid,"PARK");
3318 PreloadAnimLib(playerid,"INT_HOUSE");
3319 PreloadAnimLib(playerid,"FOOD");
3320 PreloadAnimLib(playerid,"GANGS");
3321 PreloadAnimLib(playerid,"PED");
3322 PreloadAnimLib(playerid,"FAT");
3323
3324 SetPlayerColor(playerid, COLOR_WHITE);
3325 SetPlayerFightingStyle(playerid, P_DATA[playerid][pFightStyle]);
3326
3327 SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 998);
3328 SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 998); // Skilled, but not dual-wield.
3329
3330 if(P_DATA[playerid][pPrisonTime] >= 1) {
3331 switch(P_DATA[playerid][pPrisonID]) {
3332 case 1: {
3333 SetPlayerPos(playerid, -26.8721, 2320.9290, 24.3034);
3334 SetPlayerInterior(playerid, 0);
3335 SetPlayerVirtualWorld(playerid, 0);
3336 }
3337 case 2: {
3338 SetPlayerPos(playerid, 264.58, 77.38, 1001.04);
3339 SetPlayerInterior(playerid, 6);
3340 SetPlayerVirtualWorld(playerid, 0);
3341 }
3342 case 3: {
3343
3344 SetPlayerInterior(playerid, 10);
3345 SetPlayerVirtualWorld(playerid, GROUP_VIRTUAL_WORLD+1);
3346
3347 new spawn = random(sizeof(JailSpawns));
3348
3349 SetPlayerPos(playerid, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
3350 SetPlayerFacingAngle(playerid, 0);
3351 }
3352 }
3353 return 1;
3354 }
3355
3356 if(P_DATA[playerid][pAdminDuty] == 1) {
3357 SetPlayerHealth(playerid, 500000.0);
3358 }
3359 else {
3360 SetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
3361 SetPlayerArmour(playerid, P_DATA[playerid][pArmour]);
3362 }
3363
3364 if(!GetPlayerInterior(playerid)) {
3365 SetPlayerWeather(playerid, weatherVariables[0]);
3366 }
3367 else {
3368 SetPlayerWeather(playerid, INTERIOR_WEATHER_ID);
3369 }
3370 syncPlayerTime(playerid);
3371 TogglePlayerControllable(playerid, true);
3372
3373 return 1;
3374}
3375
3376public OnPlayerDeath(playerid, killerid, reason) {
3377 if(InLesson[playerid] == 1) PlayerTextDrawHide(playerid, DMV[0]),PlayerTextDrawHide(playerid, DMV[1]),DestroyVehicle(masinaexamen[playerid]),DisableRemoteVehicleCollisions(playerid,0),DisablePlayerCheckpoint(playerid),masinaexamen[playerid] = 0,InLesson[playerid] = 0;
3378 return 1;
3379}
3380CMD:fly(playerid, params[]) {
3381 if(P_DATA[playerid][pAdmin] < 1) return 1;
3382 if(IsPlayerInAnyVehicle(playerid)) {
3383 new Float: x, Float:y, Float:z;
3384 GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
3385 SetVehicleVelocity(GetPlayerVehicleID(playerid),x, y, z + 0.5);
3386 return 1;
3387 }
3388 if(UsedFly[playerid] == 0) StartFly(playerid),UsedFly[playerid] = 1,SetPlayerHealthEx(playerid, 100000000), InitFly(playerid);
3389 else if(UsedFly[playerid] == 1) StopFly(playerid),UsedFly[playerid] = 0,SetPlayerHealthEx(playerid, 99);
3390 return 1;
3391}
3392CMD:setpp(playerid, params[])
3393{
3394 if(P_DATA[playerid][pAdmin] < 6)
3395 return OnlyAdmin
3396 new p, pp;
3397 if(sscanf(params, "ud", p, pp)) return ShowSyntax(playerid, "/setpp [playerid] [premiumpoints]");
3398 P_DATA[p][pPremiumPoints] = pp;
3399 SCMF(p, -1, "Administratorul %s ti-a dat %d premium points !", GetName(playerid));
3400 new szStr[128];
3401 format(szStr, sizeof(szStr), "AW: Admin %s gived %d premium points to %s!", GetName(playerid), pp, GetName(p));
3402 submitToAdmins(szStr, COLOR_HOTORANGE);
3403 return 1;
3404}
3405CMD:gotoxyz(playerid, params[]) {
3406 new Float:x, Float:y, Float:z;
3407 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
3408 if(sscanf(params, "fff", x,y,z)) return ShowSyntax(playerid, "/gotoxyz <x> <y> <z>");
3409 SetPlayerPos(playerid, x, y, z);
3410 return 1;
3411}
3412CMD:exam(playerid, params[]) {
3413 new string[128];
3414 if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_WHITE, "You can't use this command when you are in a car.");
3415 if(!PlayerToPoint(5.0,playerid, 1930.8121,1346.1381,9.9688)) return SCM(playerid, COLOR_WHITE, "You are not at the DMV.");
3416 if(P_DATA[playerid][pCarLic] == 1) return SCM(playerid, COLOR_WHITE, "You already have a driver license.");
3417 if(InLesson[playerid] == 1) return SCM(playerid, COLOR_WHITE, "You already have an exam.");
3418 SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
3419 InLesson[playerid] = 1;
3420 masinaexamen[playerid] = AddStaticVehicle(560, 1944.7427,1344.6697,9.1094,4.2091, -1, -1);
3421 PutPlayerInVehicle(playerid, masinaexamen[playerid],0),DisableRemoteVehicleCollisions(playerid,1);
3422 SCM(playerid,COLOR_WHITE, "Examenul a inceput. Mergi la checkpoint."),SCM(playerid,COLOR_WHITE, "Scrie /engine sau apasa tasta 2 pentru a porni motorul masinii.");
3423 P_DATA[playerid][pCheckpoint] = 100;
3424 PlayerTextDrawShow(playerid,DMV[0]);
3425 format(string, sizeof string, "~w~CHECKPOINTS: ~r~0~w~/~r~11"),PlayerTextDrawSetString(playerid, DMV[1],string),PlayerTextDrawShow(playerid, DMV[1]);
3426 SetPlayerRaceCheckpoint(playerid,0, 1952.2523,1387.6234,9.1094, 1989.1528,1443.0236,10.6484,4.0);
3427 return 1;
3428}
3429
3430CMD:killcheckpoint(playerid, params[]) {
3431 DisablePlayerCheckpoint(playerid),P_DATA[playerid][pCheckpoint] = 0,P_DATA[playerid][pBackup] = -1,SendClientMessage(playerid, COLOR_WHITE,"You have disabled your current checkpoint.");
3432 return 1;
3433}
3434
3435function SetPlayerHealthEx(playerid, Float:health) {
3436 SetPlayerHealth(playerid, health);
3437 P_DATA[playerid][pHealth] = health;
3438 return 1;
3439}
3440stock savePlayerData(playerid) {
3441 if(P_DATA[playerid][pStatus] >= 1 || P_DATA[playerid][pStatus] == -1) {
3442 new
3443 saveQuery[3500];
3444
3445 if(P_DATA[playerid][pStatus] == -1) P_DATA[playerid][pStatus] = 0;
3446
3447 if(P_DATA[playerid][pAdminDuty] == 0 && P_DATA[playerid][pEvent] == 0) {
3448 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
3449 GetPlayerArmour(playerid, P_DATA[playerid][pArmour]);
3450 }
3451
3452 // If they're not in an event and not spectating, current pos is saved. Otherwise, they'll be set back to the pos they last used /joinevent or /spec.
3453 if(P_DATA[playerid][pSpectating] == INVALID_PLAYER_ID && P_DATA[playerid][pEvent] == 0) {
3454 P_DATA[playerid][pInterior] = GetPlayerInterior(playerid);
3455 P_DATA[playerid][pVirtualWorld] = GetPlayerVirtualWorld(playerid); // If someone disconnects while spectating.
3456 }
3457
3458 format(saveQuery, sizeof(saveQuery), "UPDATE playeraccounts SET playerBanned = '%d', playerSeconds = '%d', playerSkin = '%d', playerMoney = '%d', playerBankMoney = '%d'", P_DATA[playerid][pBanned], P_DATA[playerid][pSeconds], P_DATA[playerid][pSkin], P_DATA[playerid][pMoney], P_DATA[playerid][pBankMoney]);
3459
3460 format(saveQuery, sizeof(saveQuery), "%s, playerInterior = '%d', playerVirtualWorld = '%d', playerHealth = '%f', playerArmour = '%f'", saveQuery, P_DATA[playerid][pInterior], P_DATA[playerid][pVirtualWorld], P_DATA[playerid][pHealth], P_DATA[playerid][pArmour]);
3461
3462 format(saveQuery, sizeof(saveQuery), "%s, playerAdminLevel = '%d', playerJob = '%d', playerWeapon0 = '%d', playerWeapon1 = '%d', playerWeapon2 = '%d', playerWeapon3 = '%d'", saveQuery, P_DATA[playerid][pAdmin], P_DATA[playerid][pJob], P_DATA[playerid][pWeapons][0], P_DATA[playerid][pWeapons][1], P_DATA[playerid][pWeapons][2], P_DATA[playerid][pWeapons][3]);
3463
3464 format(saveQuery, sizeof(saveQuery), "%s, playerWeapon4 = '%d', playerWeapon5 = '%d', playerWeapon6 = '%d', playerWeapon7 = '%d', playerWeapon8 = '%d', playerWeapon9 = '%d', playerWeapon10 = '%d'", saveQuery, P_DATA[playerid][pWeapons][4], P_DATA[playerid][pWeapons][5], P_DATA[playerid][pWeapons][6], P_DATA[playerid][pWeapons][7], P_DATA[playerid][pWeapons][8], P_DATA[playerid][pWeapons][9], P_DATA[playerid][pWeapons][10]);
3465
3466 format(saveQuery, sizeof(saveQuery), "%s, playerWeapon11 = '%d', playerWeapon12 = '%d', playerJobSkill1 = '%d', playerJobSkill2 = '%d', playerMaterials = '%d', playerHours = '%d'", saveQuery, P_DATA[playerid][pWeapons][11], P_DATA[playerid][pWeapons][12], P_DATA[playerid][pJobSkill][0], P_DATA[playerid][pJobSkill][1], P_DATA[playerid][pMaterials], P_DATA[playerid][pPlayingHours]);
3467
3468 format(saveQuery, sizeof(saveQuery), "%s, playerWarning1 = '%s', playerWarning2 = '%s', playerWarning3 = '%s', playerFirstLogin = '%d', playerPrisonTime = '%d', playerPrisonID = '%d', playerPhoneNumber = '%d'", saveQuery, P_DATA[playerid][pWarning1], P_DATA[playerid][pWarning2], P_DATA[playerid][pWarning3], P_DATA[playerid][pFirstLogin],
3469 P_DATA[playerid][pPrisonTime], P_DATA[playerid][pPrisonID], P_DATA[playerid][pPhoneNumber]);
3470
3471 format(saveQuery, sizeof(saveQuery), "%s, playerStatus = '%d', playerGender = '%d', playerFightStyle = '%d'", saveQuery, P_DATA[playerid][pStatus], P_DATA[playerid][pGender], P_DATA[playerid][pFightStyle]);
3472 format(saveQuery, sizeof(saveQuery), "%s, playerPhoneCredit = '%d', playerWalkieTalkie = '%d'", saveQuery, P_DATA[playerid][pCarTrunk][0], P_DATA[playerid][pCarTrunk][1], P_DATA[playerid][pPhoneCredit], P_DATA[playerid][pWalkieTalkie]);
3473
3474 format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', playerRope = '%d', playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d' WHERE playerID = '%d'", saveQuery, P_DATA[playerid][pPhoneBook],
3475 P_DATA[playerid][pGroup], P_DATA[playerid][pGroupRank], P_DATA[playerid][pConnectionIP], P_DATA[playerid][pDropCarTimeout], P_DATA[playerid][pRope], P_DATA[playerid][pAdminDuty], P_DATA[playerid][pCrimes], P_DATA[playerid][pArrests], P_DATA[playerid][pWarrants], P_DATA[playerid][pAge], P_DATA[playerid][pSQL]);
3476
3477 mysql_query(SQL, saveQuery);
3478 }
3479
3480 return 1;
3481}
3482
3483stock doesVehicleExist(vehicleid) {
3484
3485 if(GetVehicleModel(vehicleid) >= 400) {
3486 return 1;
3487 }
3488 return 0;
3489}
3490
3491public OnPlayerDisconnect(playerid, reason) {
3492 if(InLesson[playerid] == 1) PlayerTextDrawHide(playerid, DMV[0]),PlayerTextDrawHide(playerid, DMV[1]),DestroyVehicle(masinaexamen[playerid]),DisableRemoteVehicleCollisions(playerid,0),DisablePlayerCheckpoint(playerid),masinaexamen[playerid] = 0,InLesson[playerid] = 0;
3493 if(P_DATA[playerid][pStatus] >= 1) {
3494 P_DATA[playerid][pStatus] = -1;
3495
3496 for(new x = 0; x < P_DATA[playerid][v_Slots]; x++)
3497 if(P_DATA[playerid][pVeh][x] != 0)
3498 DespawnVehicle(playerid, x);
3499
3500 if(P_DATA[playerid][pFreezeType] >= 1 && P_DATA[playerid][pFreezeType] <= 4) {
3501 P_DATA[playerid][pPrisonTime] = 900;
3502 P_DATA[playerid][pPrisonID] = 2;
3503 }
3504
3505 if(P_DATA[playerid][pDrag] != -1) {
3506 SendClientMessage(P_DATA[playerid][pDrag], COLOR_WHITE, "The person you were dragging has disconnected.");
3507 P_DATA[P_DATA[playerid][pDrag]][pDrag] = -1; // Kills off any disconnections.
3508 }
3509 if(P_DATA[playerid][pPhoneCall] != -1 && P_DATA[playerid][pPhoneCall] < MAX_PLAYERS) {
3510
3511 SendClientMessage(P_DATA[playerid][pPhoneCall], COLOR_WHITE, "Your call has been terminated by the other party.");
3512
3513 if(GetPlayerSpecialAction(P_DATA[playerid][pPhoneCall]) == SPECIAL_ACTION_USECELLPHONE) {
3514 SetPlayerSpecialAction(P_DATA[playerid][pPhoneCall], SPECIAL_ACTION_STOPUSECELLPHONE);
3515 }
3516
3517 P_DATA[P_DATA[playerid][pPhoneCall]][pPhoneCall] = -1;
3518 }
3519
3520 savePlayerData(playerid);
3521
3522 new
3523 string[128];
3524
3525 if(P_DATA[playerid][pAdmin] < 1) {
3526 switch(reason) {
3527 case 1: format(string, sizeof(string), "%s has left the server.", P_DATA[playerid][pNormalName]);
3528 case 2: format(string, sizeof(string), "%s has been kicked or banned from the server.", P_DATA[playerid][pNormalName]);
3529 default: format(string, sizeof(string), "%s has timed out from the server.", P_DATA[playerid][pNormalName]);
3530 }
3531 nearByMessage(playerid, COLOR_GENANNOUNCE, string);
3532 }
3533
3534 if(P_DATA[playerid][pGroup] >= 1) {
3535 switch(reason) {
3536 case 0: {
3537 format(string, sizeof(string), "%s from your group has disconnected (timeout).", P_DATA[playerid][pNormalName]);
3538 }
3539 case 1: {
3540 format(string, sizeof(string), "%s from your group has disconnected (quit).", P_DATA[playerid][pNormalName]);
3541 }
3542 case 2: {
3543 format(string, sizeof(string), "%s from your group has disconnected (banned/kicked).", P_DATA[playerid][pNormalName]);
3544 }
3545 }
3546
3547 SendToGroup(P_DATA[playerid][pGroup], COLOR_GENANNOUNCE, string);
3548 }
3549 if(P_DATA[playerid][pAdmin] >= 1) {
3550 switch (P_DATA[playerid][pAdminDuty]) {
3551 case 1: format(string, sizeof(string), "{ff0000}Notice: {FFFFFF}Administrator %s is now off administrative duty (disconnected).", GetName(playerid));
3552 default: format(string, sizeof(string), "{ff0000}Notice: {FFFFFF}Administrator %s has disconnected.", GetName(playerid));
3553 }
3554 submitToAdmins(string, COLOR_WHITE);
3555 }
3556 }
3557 return 1;
3558}
3559
3560public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
3561 if(IsKeyJustDown(KEY_SECONDARY_ATTACK,newkeys,oldkeys)) {
3562 if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
3563 if(IsPlayerConnected(playerid)) {
3564 if(UsedFly[playerid] == 1) StopFly(playerid),UsedFly[playerid] = 0,SetPlayerHealth(playerid, 99);
3565 }
3566 }
3567 }
3568 if(IsKeyJustDown(KEY_SUBMISSION, newkeys, oldkeys)) {
3569 if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525) { // For impounding cars.
3570
3571 new
3572 playerTowTruck = GetPlayerVehicleID(playerid);
3573
3574 if(!IsTrailerAttachedToVehicle(playerTowTruck)) {
3575 new
3576 targetVehicle = GetClosestVehicle(playerid, playerTowTruck); // Exempt the player's own vehicle from the loop.
3577
3578 if(!IsAPlane(targetVehicle) && IsPlayerInRangeOfVehicle(playerid, targetVehicle, 10.0)) {
3579 AttachTrailerToVehicle(targetVehicle, playerTowTruck);
3580 }
3581 }
3582 else DetachTrailerFromVehicle(playerTowTruck);
3583 }
3584 }
3585 if(IsKeyJustDown(KEY_FIRE, newkeys, oldkeys)) {
3586 if(GetPlayerWeapon(playerid) == 17 && !IsPlayerInAnyVehicle(playerid) && P_DATA[playerid][pFreezeType] == 0) {
3587 foreach(new i : Player) {
3588 if(playerid != i && !IsPlayerInAnyVehicle(i) && P_DATA[i][pFreezeType] == 0 && GetPlayerSkin(i) != 285) {
3589 if(IsPlayerAimingAtPlayer(playerid, i)) {
3590
3591 P_DATA[i][pFreezeType] = 5; // Using 5 on FreezeType saves us a load of shit, plus it makes sense.
3592 P_DATA[i][pFreezeTime] = 10;
3593 TogglePlayerControllable(i, false);
3594 SetPlayerDrunkLevel(i, 50000);
3595 ApplyAnimation(i, "FAT", "IDLE_TIRED", 4.1, 1, 1, 1, 1, 0, 1);
3596 }
3597 }
3598 }
3599 }
3600 }
3601 if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys)) {
3602 if(P_DATA[playerid][pTutorial] >= 5)
3603 return firstPlayerSpawn(playerid);
3604
3605 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1) {
3606 if(IsPlayerInRangeOfPoint(playerid, 3.0, 232.899703, 109.074996, 1009.211791))
3607 {
3608 if(P_DATA[playerid][pGroup] == 1 && P_DATA[playerid][pGroupRank] >= 5) {
3609 MoveDynamicObject(LSPDObjs[0][0],232.89999390,105.57499695,1009.21179199, 3.5); //commander south
3610 MoveDynamicObject(LSPDObjs[0][1],232.89941406,112.57499695,1009.21179199, 3.5); //commander north
3611 LSPDObjs[0][2] = 1;
3612 PlayerPlaySoundEx(1083, 232.899703, 109.074996, 1009.211791);
3613 SetTimerEx("ShutUp",4000,false,"d",0);
3614 }
3615 }
3616 else if(IsPlayerInRangeOfPoint(playerid, 3.0, 275.750000, 117.399414, 1003.617187))
3617 {
3618 MoveDynamicObject(LSPDObjs[1][0],275.75000000,120.89941406,1003.61718750, 3.5); // interrogation north
3619 MoveDynamicObject(LSPDObjs[1][1],275.75000000,118.89941406,1003.61718750, 3.5); // interrogation south
3620 LSPDObjs[1][2] = 1;
3621 PlayerPlaySoundEx(1083, 275.750000, 117.399414, 1003.617187);
3622 SetTimerEx("ShutUp",4000,false,"d",1);
3623 }
3624 else if(IsPlayerInRangeOfPoint(playerid, 3.0, 253.201660, 109.099609, 1002.220703))
3625 {
3626 MoveDynamicObject(LSPDObjs[2][0],253.20410156,105.59960938,1002.22070312,3.5); // north west lobby door
3627 MoveDynamicObject(LSPDObjs[2][1],253.19921875,112.59960938,1002.22070312,3.5); // north east lobby door
3628 LSPDObjs[2][2] = 1;
3629 PlayerPlaySoundEx(1083, 253.201660, 109.099609, 1002.220703);
3630 SetTimerEx("ShutUp",4000,false,"d",2);
3631 }
3632 else if(IsPlayerInRangeOfPoint(playerid, 3.0, 239.566894, 117.599609, 1002.220703))
3633 {
3634 MoveDynamicObject(LSPDObjs[3][0],239.56933594,114.09960938,1002.22070312,3.5); // south west lobby door
3635 MoveDynamicObject(LSPDObjs[3][1],239.56445312,121.09960938,1002.22070312,3.5); // south east lobby door
3636 LSPDObjs[3][2] = 1;
3637 PlayerPlaySoundEx(1083, 239.566894, 117.599609, 1002.220703);
3638 SetTimerEx("ShutUp",4000,false,"d",3);
3639 }
3640 else if(IsPlayerInRangeOfPoint(playerid, 2.0, 265.951171, 115.826660, 1003.622863))
3641 {
3642 MoveDynamicObject(LSPDObjs[4][0],263.45,115.82421875,1003.62286377,3.5); // cam room
3643 MoveDynamicObject(LSPDObjs[4][1],268.75,115.82910156,1003.62286377, 3.5); // cam room
3644 LSPDObjs[4][2] = 1;
3645 PlayerPlaySoundEx(1083, 265.951171, 115.826660, 1003.622863);
3646 SetTimerEx("ShutUp",4000,false,"d",4);
3647 }
3648 else if(IsPlayerInRangeOfPoint(playerid, 2.0, 265.820007, 112.530761, 1003.622863))
3649 {
3650 MoveDynamicObject(LSPDObjs[5][0],268.8,112.53222656,1003.62286377, 3.5); // locker
3651 MoveDynamicObject(LSPDObjs[5][1],263.3,112.52929688,1003.62286377, 3.5); // locker
3652 LSPDObjs[5][2] = 1;
3653 PlayerPlaySoundEx(1083, 265.820007, 112.530761, 1003.622863);
3654 SetTimerEx("ShutUp",4000,false,"d",5);
3655 }
3656 else if(IsPlayerInRangeOfPoint(playerid, 3.0, 231.099609, 119.532226, 1009.224426)) // Chief of Police
3657 {
3658 if(P_DATA[playerid][pGroup] == 1 && P_DATA[playerid][pGroupRank] == 6) {
3659 MoveDynamicObject(LSPDObjs[6][0],227.0,119.52929688,1009.22442627, 3.5);
3660 MoveDynamicObject(LSPDObjs[6][1],229.75,119.53515625,1009.22442627, 3.5);
3661 LSPDObjs[6][2] = 1;
3662 PlayerPlaySoundEx(1083, 231.099609, 119.532226, 1009.224426);
3663 SetTimerEx("ShutUp",4000,false,"d",6);
3664 }
3665 }
3666 else if(IsPlayerInRangeOfPoint(playerid, 3.0, 217.800003, 116.529647, 998.015625)) // Cells
3667 {
3668 MoveDynamicObject(LSPDObjs[7][0],220.5,116.52999878,998.01562500,3.5);
3669 MoveDynamicObject(LSPDObjs[7][1],215.3,116.52929688,998.01562500,3.5);
3670 LSPDObjs[7][2] = 1;
3671 PlayerPlaySoundEx(1083, 217.800003, 116.529647, 998.015625);
3672 SetTimerEx("ShutUp",4000,false,"d",7);
3673 }
3674 }
3675 if(IsPlayerInRangeOfPoint(playerid,1.0,237.9,115.6,1010.2)) {
3676 SetPlayerPos(playerid,237.9,115.6,1010.2);
3677 SetPlayerFacingAngle(playerid, 270);
3678 ApplyAnimation(playerid, "VENDING", "VEND_Use", 1, 0, 0, 0, 0, 4000);
3679 SetTimerEx("VendDrink", 2500, false, "d", playerid);
3680 }
3681 }
3682 if(IsKeyJustDown(KEY_LOOK_BEHIND,newkeys,oldkeys)) {
3683 if(!IsPlayerInAnyVehicle(playerid)) return 1;
3684 new idcar = GetPlayerVehicleID(playerid),string[128];
3685 new engine,lights,alarm,doors,bonnet,boot,objective;
3686 if(IsABike(idcar)) return SCM(playerid, COLOR_LG3, "Nu poti folosi comanda /engine pentru biciclete.");
3687 switch(CarEngine[idcar]) {
3688 case 0: {
3689 CarEngine[idcar] = 1;
3690 GetVehicleParamsEx(idcar,engine,lights,alarm,doors,bonnet,boot,objective);
3691 SetVehicleParamsEx(idcar,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
3692 new vehicle = GetVehicleModel(idcar)-400;
3693 SetPVarInt(playerid, "Engine", 1);
3694 format(string,sizeof(string),"* %s starts the engine of his %s.",GetName(playerid),VehicleNames[vehicle]);
3695 ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
3696 }
3697 case 1: {
3698 CarEngine[idcar] = 0;
3699 GetVehicleParamsEx(idcar,engine,lights,alarm,doors,bonnet,boot,objective);
3700 SetVehicleParamsEx(idcar,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
3701 new vehicle = GetVehicleModel(idcar)-400;
3702 SetPVarInt(playerid, "Engine", 0);
3703 format(string,sizeof(string),"* %s stops the engine of his %s.",GetName(playerid),VehicleNames[vehicle]);
3704 ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
3705 }
3706 }
3707 }
3708 if(IsKeyJustDown(KEY_CROUCH, newkeys, oldkeys)) {
3709 for(new x = 0; x < MAX_HOUSES; x++) {
3710 if(IsPlayerInRangeOfPoint(playerid, 2.0, houseVariables[x][hHouseExteriorPos][0], houseVariables[x][hHouseExteriorPos][1], houseVariables[x][hHouseExteriorPos][2])) {
3711 if(houseVariables[x][hHouseLocked] == 1) {
3712 SendClientMessage(playerid, COLOR_GREY, "This house is locked.");
3713 if(P_DATA[playerid][pAdmin] >= 1 && P_DATA[playerid][pAdminDuty] >= 1) {
3714 SetPVarInt(playerid, "hE", x); // I'd create a variable for this, but seeing as we'll only ever use this for one thing, this will be better for optimization.
3715 ShowPlayerDialog(playerid, DIALOG_HOUSE_ENTER, DIALOG_STYLE_MSGBOX, "SERVER: Housing", "This house is locked.\r\nAs an administrator, you can breach this lock and enter. Would you like to do so?", "Yes", "No");
3716 }
3717 else if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1 && P_DATA[playerid][pGroup] != 0) {
3718 SetPVarInt(playerid, "hE", x);
3719 ShowPlayerDialog(playerid, DIALOG_HOUSE_ENTER, DIALOG_STYLE_MSGBOX, "SERVER: Housing", "This house is locked.\r\nAs a law enforcement officer, you can breach this lock and enter. Would you like to do so?", "Yes", "No");
3720 }
3721 }
3722 else {
3723 SetPlayerPos(playerid, houseVariables[x][hHouseInteriorPos][0], houseVariables[x][hHouseInteriorPos][1], houseVariables[x][hHouseInteriorPos][2]);
3724 SetPlayerInterior(playerid, houseVariables[x][hHouseInteriorID]);
3725 SetPlayerVirtualWorld(playerid, HOUSE_VIRTUAL_WORLD+x);
3726 }
3727 return 1;
3728 }
3729 if(IsPlayerInRangeOfPoint(playerid, 2.0, houseVariables[x][hHouseInteriorPos][0], houseVariables[x][hHouseInteriorPos][1], houseVariables[x][hHouseInteriorPos][2]) && GetPlayerVirtualWorld(playerid) == HOUSE_VIRTUAL_WORLD+x) {
3730 SetPlayerPos(playerid, houseVariables[x][hHouseExteriorPos][0], houseVariables[x][hHouseExteriorPos][1], houseVariables[x][hHouseExteriorPos][2]);
3731 SetPlayerInterior(playerid, houseVariables[x][hHouseExteriorID]);
3732 SetPlayerVirtualWorld(playerid, 0);
3733 return 1;
3734 }
3735 }
3736 for(new x = 0; x < MAX_BUSINESSES; x++) {
3737 if(IsPlayerInRangeOfPoint(playerid, 2.0, businessVariables[x][bExteriorPos][0], businessVariables[x][bExteriorPos][1], businessVariables[x][bExteriorPos][2])) {
3738 if(businessVariables[x][bLocked] == 1) {
3739 SendClientMessage(playerid, COLOR_GREY, "This business is locked.");
3740 if(P_DATA[playerid][pAdmin] >= 1 && P_DATA[playerid][pAdminDuty] >= 1) {
3741 SetPVarInt(playerid, "bE", x); // I'd create a variable for this, but seeing as we'll only ever use this for one thing, this will be better for optimization.
3742 ShowPlayerDialog(playerid, DIALOG_BUSINESS_ENTER, DIALOG_STYLE_MSGBOX, "SERVER: Businesses", "{FFFFFF}This business is locked.\r\nAs an "EMBED_GREY"administrator{FFFFFF}, you can breach this lock and enter. Would you like to do so?", "Yes", "No");
3743 }
3744 else if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1 && P_DATA[playerid][pGroup] != 0) {
3745 SetPVarInt(playerid, "bE", x);
3746 ShowPlayerDialog(playerid, DIALOG_BUSINESS_ENTER, DIALOG_STYLE_MSGBOX, "SERVER: Businesses", "{FFFFFF}This business is locked.\r\nAs a "EMBED_GREY"law enforcement officer{FFFFFF}, you can breach this lock and enter. Would you like to do so?", "Yes", "No");
3747 }
3748 }
3749 else {
3750 switch(businessVariables[x][bType]) {
3751 case 1: {
3752 SendClientMessage(playerid, COLOR_WHITE, "Welcome! The commands of this business are as follows: /buy");
3753 if(P_DATA[playerid][pFish] != -1) {
3754 switch(P_DATA[playerid][pFish]) {
3755 case 0: {
3756 ShowPlayerDialog(playerid, DIALOG_SELL_FISH, DIALOG_STYLE_MSGBOX, "SERVER: Fishing", "You are currently carrying $1000 worth of fish.\n\nWould you like to sell your fish to this store for $1000?", "Yes", "No");
3757 }
3758 case 1: {
3759 ShowPlayerDialog(playerid, DIALOG_SELL_FISH, DIALOG_STYLE_MSGBOX, "SERVER: Fishing", "You are currently carrying $750 worth of fish.\n\nWould you like to sell your fish to this store for $750?", "Yes", "No");
3760 }
3761 case 2: {
3762 ShowPlayerDialog(playerid, DIALOG_SELL_FISH, DIALOG_STYLE_MSGBOX, "SERVER: Fishing", "You are currently carrying $250 worth of fish.\n\nWould you like to sell your fish to this store for $250?", "Yes", "No");
3763 }
3764 case 3: {
3765 ShowPlayerDialog(playerid, DIALOG_SELL_FISH, DIALOG_STYLE_MSGBOX, "SERVER: Fishing", "You are currently carrying $900 worth of fish.\n\nWould you like to sell your fish to this store for $900?", "Yes", "No");
3766 }
3767 case 4: {
3768 ShowPlayerDialog(playerid, DIALOG_SELL_FISH, DIALOG_STYLE_MSGBOX, "SERVER: Fishing", "You are currently carrying $500 worth of fish.\n\nWould you like to sell your fish to this store for $500?", "Yes", "No");
3769 }
3770 }
3771 }
3772 }
3773 case 2: {
3774 SendClientMessage(playerid, COLOR_WHITE, "Welcome! The commands of this business are as follows: /buyclothes");
3775 }
3776 case 3: {
3777 SendClientMessage(playerid, COLOR_WHITE, "Welcome! The commands of this business are as follows: /buydrink");
3778 }
3779 case 4: {
3780 SendClientMessage(playerid, COLOR_WHITE, "Welcome! The commands of this business are as follows: /buytoys");
3781 }
3782 case 5: {
3783 SendClientMessage(playerid, COLOR_WHITE, "Welcome! The commands of this business are as follows: /buyvehicle");
3784 }
3785 case 6: {
3786 SendClientMessage(playerid, COLOR_WHITE, "Welcome! The commands of this business are as follows: /buyfightstyle");
3787 }
3788 case 7, 8, 9: {
3789 SendClientMessage(playerid, COLOR_WHITE, "Welcome! The commands of this business are as follows: /buyfood");
3790 }
3791 }
3792
3793 SetPlayerPos(playerid, businessVariables[x][bInteriorPos][0], businessVariables[x][bInteriorPos][1], businessVariables[x][bInteriorPos][2]);
3794 SetPlayerInterior(playerid, businessVariables[x][bInterior]);
3795 SetPlayerVirtualWorld(playerid, BUSINESS_VIRTUAL_WORLD+x);
3796 }
3797 return 1;
3798 }
3799 if(IsPlayerInRangeOfPoint(playerid, 2.0, businessVariables[x][bInteriorPos][0], businessVariables[x][bInteriorPos][1], businessVariables[x][bInteriorPos][2]) && GetPlayerVirtualWorld(playerid) == BUSINESS_VIRTUAL_WORLD+x) {
3800 SetPlayerPos(playerid, businessVariables[x][bExteriorPos][0], businessVariables[x][bExteriorPos][1], businessVariables[x][bExteriorPos][2]);
3801 SetPlayerInterior(playerid, 0);
3802 SetPlayerVirtualWorld(playerid, 0);
3803 return 1;
3804 }
3805 }
3806 for(new x = 0; x < MAX_GROUPS; x++) {
3807 if(IsPlayerInRangeOfPoint(playerid, 2.0, groupVariables[x][gGroupExteriorPos][0], groupVariables[x][gGroupExteriorPos][1], groupVariables[x][gGroupExteriorPos][2])) {
3808 if(groupVariables[x][gGroupHQLockStatus] == 1) {
3809 SendClientMessage(playerid, COLOR_GREY, "This HQ is locked.");
3810 if(P_DATA[playerid][pAdmin] >= 1 && P_DATA[playerid][pAdminDuty] >= 1) {
3811 SetPVarInt(playerid, "gE", x); // I'd create a variable for this, but seeing as we'll only ever use this for one thing, this will be better for optimization.
3812 ShowPlayerDialog(playerid, DIALOG_GROUP_ENTER, DIALOG_STYLE_MSGBOX, "SERVER: Group HQ", "This Group HQ is locked.\r\nAs an administrator, you can breach this lock and enter. Would you like to do so?", "Yes", "No");
3813 }
3814 else if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1 && P_DATA[playerid][pGroup] != 0) {
3815 SetPVarInt(playerid, "gE", x);
3816 ShowPlayerDialog(playerid, DIALOG_GROUP_ENTER, DIALOG_STYLE_MSGBOX, "SERVER: Group HQ", "This Group HQ is locked.\r\nAs a law enforcement officer, you can breach this lock and enter. Would you like to do so?", "Yes", "No");
3817 }
3818 }
3819 else {
3820 SetPlayerPos(playerid, groupVariables[x][gGroupInteriorPos][0], groupVariables[x][gGroupInteriorPos][1], groupVariables[x][gGroupInteriorPos][2]);
3821 SetPlayerInterior(playerid, groupVariables[x][gGroupHQInteriorID]);
3822 SetPlayerVirtualWorld(playerid, GROUP_VIRTUAL_WORLD+x);
3823 }
3824 return 1;
3825 }
3826 if(IsPlayerInRangeOfPoint(playerid, 2.0, groupVariables[x][gGroupInteriorPos][0], groupVariables[x][gGroupInteriorPos][1], groupVariables[x][gGroupInteriorPos][2]) && GetPlayerVirtualWorld(playerid) == GROUP_VIRTUAL_WORLD+x) {
3827 SetPlayerPos(playerid, groupVariables[x][gGroupExteriorPos][0], groupVariables[x][gGroupExteriorPos][1], groupVariables[x][gGroupExteriorPos][2]);
3828 SetPlayerInterior(playerid, 0);
3829 SetPlayerVirtualWorld(playerid, 0);
3830 return 1;
3831 }
3832 }
3833 if(IsPlayerInRangeOfPoint(playerid, 2.0, 595.5443,-1250.3405,18.2836)) {
3834 SetPlayerPos(playerid, 2306.8481,-16.0682,26.7496);
3835 SetPlayerVirtualWorld(playerid, 2);
3836 }
3837 else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2306.8481,-16.0682,26.7496)) {
3838 SetPlayerPos(playerid, 595.5443,-1250.3405,18.2836);
3839 SetPlayerVirtualWorld(playerid, 0);
3840 }
3841 }
3842 return 1;
3843}
3844function VendDrink(playerid) {
3845
3846 new
3847 Float:health;
3848
3849 ApplyAnimation(playerid, "VENDING", "VEND_Drink_P", 1, 0, 0, 0, 0, 1750);
3850 GetPlayerHealth(playerid,health);
3851 if(health > 65.0) SetPlayerHealth(playerid,100.0); // This limits player health to 100 (as values over 100.0 could otherwise be achieved, which isn't good).
3852 else SetPlayerHealth(playerid,health+35.0); // A Sprunk machine gives exactly 35.0 HP per hit.
3853 return 1;
3854}
3855
3856public OnVehicleRespray(playerid, vehicleid, color1, color2) {
3857 if(IsAnOwnableVehicle(vehicleid) && V_DATA[vehicleid][vOwner] == P_DATA[playerid][pSQL]){
3858 new x = V_DATA[vehicleid][vSlot];
3859 if(P_DATA[playerid][v_Col1][x] == color1 && P_DATA[playerid][v_Col2][x]) return 1; //After removing paintjob vehicle don't change his color to white
3860 P_DATA[playerid][v_Col1][x] = color1;
3861 P_DATA[playerid][v_Col2][x] = color2;
3862 }
3863 return 1;
3864}
3865
3866public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { // No need to deduct money; thanks to SA:MP, OnVehicleRespray is called when a paint job has been applied.
3867 if(IsAnOwnableVehicle(vehicleid) && V_DATA[vehicleid][vOwner] == P_DATA[playerid][pSQL]){
3868 new x = V_DATA[vehicleid][vSlot];
3869 P_DATA[playerid][v_Paint][x] = paintjobid;
3870 }
3871 return 1;
3872}
3873
3874public OnEnterExitModShop(playerid, enterexit, interiorid) {
3875 new vID = GetPlayerVehicleID(playerid);
3876 if(vID != INVALID_VEHICLE_ID && V_DATA[vID][vOwner] == P_DATA[playerid][pSQL])
3877 {
3878 SavePlayerVehicle(playerid, V_DATA[vID][vSlot]);
3879 }
3880 return 1;
3881}
3882
3883public OnVehicleMod(playerid, vehicleid, componentid) {
3884 if(GetPlayerInterior(playerid) != 0)
3885 {
3886 new
3887 szStr[128];
3888 format(szStr, sizeof(szStr), "Player %s can to have tuning hacks !", GetName(playerid));
3889 submitToAdmins(szStr, -1);
3890 return 1;
3891 }
3892 if(IsAnOwnableVehicle(vehicleid) && V_DATA[vehicleid][vOwner] == P_DATA[playerid][pSQL]){
3893 new x = V_DATA[vehicleid][vSlot];
3894 v_Mod[playerid][x][GetVehicleComponentType(componentid)] = componentid;
3895 }
3896 return 1;
3897}
3898
3899CMD:engine(playerid, params[]) {
3900 if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_WHITE,"{999999}You need to be in a vehicle to use this command.");
3901 new idcar = GetPlayerVehicleID(playerid),string[128];
3902 new engine,lights,alarm,doors,bonnet,boot,objective;
3903 if(IsABike(idcar)) return SCM(playerid, COLOR_LG3, "Nu poti folosi comanda /engine pentru biciclete.");
3904 switch(CarEngine[idcar]) {
3905 case 0: {
3906 CarEngine[idcar] = 1;
3907 GetVehicleParamsEx(idcar,engine,lights,alarm,doors,bonnet,boot,objective);
3908 SetVehicleParamsEx(idcar,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
3909 new vehicle = GetVehicleModel(idcar)-400;
3910 SetPVarInt(playerid, "Engine", 1);
3911 format(string,sizeof(string),"* %s starts the engine of his %s.",GetName(playerid),VehicleNames[vehicle]);
3912 ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
3913 }
3914 case 1: {
3915 CarEngine[idcar] = 0;
3916 GetVehicleParamsEx(idcar,engine,lights,alarm,doors,bonnet,boot,objective);
3917 SetVehicleParamsEx(idcar,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
3918 new vehicle = GetVehicleModel(idcar)-400;
3919 SetPVarInt(playerid, "Engine", 0);
3920 format(string,sizeof(string),"* %s stops the engine of his %s.",GetName(playerid),VehicleNames[vehicle]);
3921 ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
3922 }
3923 }
3924 return 1;
3925}
3926
3927public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
3928
3929 if(!isnull(inputtext)) for(new strPos; inputtext[strPos] > 0; strPos++) if(inputtext[strPos] == '%') inputtext[strPos] = '\0'; // SA-MP placeholder exploit patch
3930 new szStr[256], query[300];
3931 switch(dialogid) {
3932 case DIALOG_SKIP: {
3933 TutTime[playerid] = 0; P_DATA[playerid][pTutorial] = 1;
3934 TogglePlayerControllable(playerid, 1),SetCameraBehindPlayer(playerid),TogglePlayerSpectating(playerid, 0);
3935 SpawnPlayer(playerid);
3936 ResetPlayerMoney(playerid),GivePlayerMoney(playerid,10000);
3937 SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid,0),TogglePlayerControllable(playerid,true);
3938 new str1[256];
3939 mysql_format(SQL,str1,256,"UPDATE playeraccounts SET `playerFirstLogin`='0',`playerMoney`='10000' WHERE `playerName`='%s'",P_DATA[playerid][pNormalName]);
3940 mysql_tquery(SQL,str1,"","");
3941 SetSpawnInfo(playerid, 0, 250,SERVER_SPAWN,0,0,0,0,0,0,0);
3942 SpawnPlayer(playerid);
3943 PlayerTextDrawHide(playerid, TutorialTD[0]),PlayerTextDrawHide(playerid, TutorialTD[1]);
3944 }
3945 case D_Veh:
3946 {
3947 if(!response) return 1;
3948
3949 switch(vMAction[playerid])
3950 {
3951 case 1:{
3952 switch(listitem)
3953 {
3954 case 0: {
3955 if(P_DATA[playerid][v_Slots] >= MAX_VEHICLE_SLOTS)
3956 return SCM(playerid, -1, ""R"Error"W": You reached vehicle slots limit. (Limit: "#MAX_VEHICLE_SLOTS")");
3957
3958 if(P_DATA[playerid][pPremiumPoints] < VEHICLE_SLOT_COST)
3959 return SCM(playerid, -1, ""R"Error"W": You don't have "#VEHICLE_SLOT_COST" premium points for a new vehicle slot !");
3960
3961 P_DATA[playerid][pPremiumPoints] -= VEHICLE_SLOT_COST;
3962 P_DATA[playerid][v_Slots] ++;
3963 return 1;
3964 }
3965 default: {
3966 if(dSelectedSlot[playerid][listitem - 1] == -1)
3967 return SCM(playerid, -1, "Nu ai nimic in acest slot!");
3968
3969 new x = dSelectedSlot[playerid][listitem - 1];
3970 SetPVarInt(playerid, "selectedVeh", listitem - 1);
3971 if(P_DATA[playerid][v_SQL][x] != 0)
3972 {
3973 new szTitle[64];
3974 format(szTitle, sizeof(szTitle), ""B"Vehicle Menu::"W" %s", VehicleNames[P_DATA[playerid][v_Model][x] - 400]);
3975 format(szStr, sizeof(szStr), "%s\nVehicle Info\nFind Vehicle\nTow Vehicle - %d$\nBuy Insurance - %d$", (P_DATA[playerid][v_Spawned][x] > 0) ? (""R"Despawn"W"") : (""G"Spawn"W""), VEHICLE_TOW_COST, VEHICLE_INSURANCE_COST);
3976 if(IsVIPModel(P_DATA[playerid][v_Model][x]))
3977 if(P_DATA[playerid][v_VIP][x])
3978 strcat(szStr, "\nVIP Options", sizeof(szStr));
3979 else format(szStr, sizeof(szStr), "%s\n[+] Make Vehicle VIP - %dPP", szStr, VIP_VEHICLE_COST);
3980
3981 ShowPlayerDialog(playerid, D_Veh_Menu, DIALOG_STYLE_LIST, szTitle, szStr, "Select", "Exit");
3982 } else SCM(playerid, -1, ""R"Error"W": This is a vehicle BUG, report to an admin! (cmd_v)");
3983 }
3984 }
3985 return 1;
3986 }
3987 case 2:
3988 {
3989 if(P_DATA[playerid][v_Spawned][dSelectedSlot[playerid][listitem]] == 0)
3990 return SCM(playerid, -1, ""R"Error"W": You can't find an despawned vehicle !");
3991
3992 if(GetPlayerCash(playerid) < VEHICLE_TOW_COST)
3993 return SCM(playerid, -1, ""R"Error"W": You don't have enough money to tow your vehicle.");
3994
3995 GivePlayerCash(playerid, -VEHICLE_TOW_COST);
3996 TowVehicle(playerid, dSelectedSlot[playerid][listitem]);
3997 return 1;
3998 }
3999 case 3: //findcar
4000 {
4001 new x = dSelectedSlot[playerid][listitem];
4002 if(P_DATA[playerid][v_Spawned][x] == 0)
4003 return SCM(playerid, -1, ""R"Error"W": You can't find an despawned vehicle !");
4004
4005 CP[playerid] = FIND_VEHICLE;
4006 FollowingCP[playerid] = true;
4007 SetPVarInt(playerid, "toFindVehicle", x);
4008 new Float: pos[3];
4009 GetVehiclePos(P_DATA[playerid][pVeh][x], pos[0], pos[1], pos[2]);
4010 SetPlayerCheckpoint(playerid, pos[0], pos[1], pos[2], 5.0);
4011 SCM(playerid, -1, ""B"(Server)"W": We put you a checkpoint on map, follow checkpoint to find your vehicle !");
4012 return 1;
4013 }
4014 }
4015 return 1;
4016 }
4017
4018 case D_Veh_Menu:
4019 {
4020 if(!response)
4021 {
4022 DeletePVar(playerid, "selectedVeh");
4023 return 1;
4024 }
4025
4026 new x = GetPVarInt(playerid, "selectedVeh");
4027
4028 switch(listitem)
4029 {
4030 case 0: //Spawn/Despawn vehicle
4031 {
4032 if(P_DATA[playerid][v_Spawned][x] != 0)
4033 {
4034 if(IsVehicleOccupied(P_DATA[playerid][pVeh][x]))
4035 return SCM(playerid, -1, ""R"Error"W": Your vehicle is occupied !");
4036
4037 DespawnVehicle(playerid, x);
4038 SCM(playerid, -1, ""B"Vehicle Menu"W": You successfully despawned your vehicle.");
4039 }
4040 else SpawnVehicle(playerid, x), SCM(playerid, -1, ""B"Vehicle Menu"W": You successfully spawned your vehicle.");
4041 }
4042
4043 case 1: //Vehicle Info
4044 {
4045 new iPoints = (P_DATA[playerid][v_Spawned][x] > 0) ? (V_DATA[P_DATA[playerid][pVeh][x]][vInsurancePoints]) : (P_DATA[playerid][v_InsurancePoints][x]);
4046 format(szStr, sizeof(szStr), ""B"%s"W" informations\n\n» ID: %d\n» Colors: %d, %d\n» Odometer: %.02f km\n» Age: %d days\n» Insurance: %s(%d Points)\n» Price: %d$", VehicleNames[P_DATA[playerid][v_Model][x]-400], P_DATA[playerid][v_SQL][x], P_DATA[playerid][v_Col1][x], P_DATA[playerid][v_Col2][x],
4047 (P_DATA[playerid][v_Spawned][x] > 0) ? (V_DATA[P_DATA[playerid][pVeh][x]][vKM]) : (P_DATA[playerid][v_KM][x]), TsToDays(P_DATA[playerid][v_Age][x]), (iPoints <= 0) ? ("Expired") : ("Good"), iPoints, P_DATA[playerid][v_Price][x]);
4048 ShowPlayerDialog(playerid, D_Veh_Menu_Info, DIALOG_STYLE_MSGBOX, ""B"Vehicle Menu::"W" Vehicle Info", szStr, "Ok", "");
4049 }
4050
4051 case 2: //Find Vehicle
4052 {
4053 if(P_DATA[playerid][v_Spawned][x] == 0)
4054 return SCM(playerid, -1, ""R"Error"W": You can't find an despawned vehicle !");
4055
4056 CP[playerid] = FIND_VEHICLE;
4057 FollowingCP[playerid] = true;
4058 SetPVarInt(playerid, "toFindVehicle", x);
4059 new Float: pos[3];
4060 GetVehiclePos(P_DATA[playerid][pVeh][x], pos[0], pos[1], pos[2]);
4061 SetPlayerCheckpoint(playerid, pos[0], pos[1], pos[2], 5.0);
4062 SCM(playerid, -1, ""B"(Server)"W": We put you a checkpoint on map, follow checkpoint to find your vehicle !");
4063 }
4064
4065 case 3: //Tow car
4066 {
4067 if(P_DATA[playerid][v_Spawned][x] == 0)
4068 return SCM(playerid, -1, ""R"Error"W": You can't tow an despawned vehicle !");
4069
4070 if(GetPlayerCash(playerid) < VEHICLE_TOW_COST)
4071 return SCM(playerid, -1, ""R"Error"W": You don't have "#VEHICLE_TOW_COST"$ to tow your vehicle!");
4072
4073 TowVehicle(playerid, dSelectedSlot[playerid][listitem]);
4074 GivePlayerMoney(playerid, -VEHICLE_TOW_COST);
4075 }
4076 case 4: //Insurance
4077 {
4078 if(GetPlayerCash(playerid) < VEHICLE_INSURANCE_COST)
4079 return SCM(playerid, -1, ""R"Error"W": You don't have "#VEHICLE_INSURANCE_COST"$ to buy insurance !");
4080
4081 if(P_DATA[playerid][v_InsurancePoints][x] >= TOTAL_INSURANCE_POINTS)
4082 return SCM(playerid, -1, ""R"Error"W": Your vehicle has perfect insurance!");
4083
4084 GivePlayerMoney(playerid, -VEHICLE_INSURANCE_COST);
4085 P_DATA[playerid][v_InsurancePoints][x] = TOTAL_INSURANCE_POINTS;
4086 if(P_DATA[playerid][v_Spawned][x])
4087 V_DATA[P_DATA[playerid][pVeh][x]][vInsurancePoints] = TOTAL_INSURANCE_POINTS;
4088
4089 SavePlayerVehicle(playerid, x);
4090 SCM(playerid, -1, ""B"(Server)"W": You successfully buyed a new insurance !");
4091 }
4092 case 5: //Vip panel | Make vehicle vip
4093 {
4094 if(!P_DATA[playerid][v_VIP][x])
4095 {
4096 if(P_DATA[playerid][pPremiumPoints] < VIP_VEHICLE_COST)
4097 return SCM(playerid, -1, ""R"Error"W": You don't have enough premium points to make this vehicle VIP !");
4098
4099 P_DATA[playerid][pPremiumPoints] -= VIP_VEHICLE_COST;
4100 P_DATA[playerid][v_VIP][x] = 1;
4101 format(v_vText[playerid][x], 11, "No-Text");
4102 v_vTextColor[playerid][x] = -1;
4103 SavePlayerVehicle(playerid, x);
4104 SCM(playerid, -1, ""B"(Server)"W": By now your vehicle is VIP. You have VIP Vehicle options in /v");
4105 return 1;
4106 }
4107 format(szStr, sizeof(szStr), "Item\tValue\nShow/Hide Vip Name\t%s\nChange Text\t%s\nChange text color\t{%06x}ColorTest", (P_DATA[playerid][v_vTextStatus][x]) ? (""G"On") : (""R"OFF"), v_vText[playerid][x], v_vTextColor[playerid][x] >>> 8);
4108 ShowPlayerDialog(playerid, D_Veh_Menu_VIP, DIALOG_STYLE_TABLIST_HEADERS, ""B"Vehicle Menu::"W" VIP Shop", szStr, "Select", "Exit");
4109 }
4110 }
4111 return 1;
4112 }
4113
4114 case D_Veh_Menu_VIP:
4115 {
4116 if(!response)
4117 return DeletePVar(playerid, "selectedVeh");
4118
4119 new x = GetPVarInt(playerid, "selectedVeh");
4120
4121 switch(listitem)
4122 {
4123 case 0: //Show/Hide VIP Text
4124 {
4125 if(!P_DATA[playerid][v_Spawned][x]) return SCM(playerid, -1, ""R"You can't turn on or off vip text, because your vehicle is not spawned!");
4126
4127 P_DATA[playerid][v_vTextStatus][x] = !P_DATA[playerid][v_vTextStatus][x];
4128 ChangeVipTextState(playerid, x, P_DATA[playerid][v_vTextStatus][x]);
4129 format(szStr, sizeof(szStr), ""B"(Server)"W": Your VIP Text is now %s", (P_DATA[playerid][v_vTextStatus][x]) ? (""G"on"W".") : (""R"off"W"."));
4130 SCM(playerid, -1, szStr);
4131 }
4132 //Change VIP Text
4133 case 1: ShowPlayerDialog(playerid, D_Veh_Menu_VIP_CT, DIALOG_STYLE_INPUT, ""B"Vehicle Menu::"W" Change VIP Text", "Write below VIP text, this text can have maximum 10 characters !", "Set", "Back");
4134 //Change Vip Text Color
4135 case 2: ShowPlayerDialog(playerid, D_Veh_Menu_VIP_CC, DIALOG_STYLE_LIST, ""B"BVehicle Menu::"W" Change VIP Text Color", "Custom Color\nWhite\n{FF0000}Red\n{640000}Maroon\n{00FF00}Light Green\n{004B01}Green\n{008DFF}Aqua Blue\n{001AFF}Police Blue\n{FF6B00}Orange\n{8A8A8A}Grey\nBlack({000000}-"W")", "Select", "Back");
4136 }
4137 return 1;
4138 }
4139
4140 case D_Veh_Menu_VIP_CC:
4141 {
4142 new x = GetPVarInt(playerid, "selectedVeh");
4143 if(!response)
4144 {
4145 format(szStr, sizeof(szStr), "Item\tValue\nShow/Hide Vip Name\t%s\nChange Text\t%s\nChange text color\t{%06x}ColorTest", (P_DATA[playerid][v_vTextStatus][x]) ? (""G"On") : (""R"OFF"), v_vText[playerid][x], v_vTextColor[playerid][x] >>> 8);
4146 ShowPlayerDialog(playerid, D_Veh_Menu_VIP, DIALOG_STYLE_TABLIST_HEADERS, ""B"Vehicle Menu::"W" VIP Shop", szStr, "Select", "Exit");
4147 return 1;
4148 }
4149
4150 if(listitem == 0) // Custom color
4151 return ShowPlayerDialog(playerid, D_Veh_Menu_VIP_CustomC, DIALOG_STYLE_INPUT, ""B"Vehicle Menu::"W" Custom VIP Text color", "Write below HEX color code for your color.\nIf you want to get a color, we recommend you www.colorpicker.com !\n"R"WARNING: Your color need to have next form '0xHexColorCodeFF' !", "Set", "Back");
4152
4153 v_vTextColor[playerid][x] = vipTextDefaultColors[listitem - 1];
4154 SavePlayerVehicle(playerid, x);
4155 if(P_DATA[playerid][v_vTextStatus][x] == true) ChangeVipTextState(playerid, x, true);
4156 DeletePVar(playerid, "selectedVeh");
4157 return 1;
4158 }
4159
4160 case D_Veh_Menu_VIP_CustomC:
4161 {
4162 if(!response)
4163 return ShowPlayerDialog(playerid, D_Veh_Menu_VIP_CC, DIALOG_STYLE_LIST, ""B"BVehicle Menu::"W" Change VIP Text Color", "Custom Color\nWhite\n{FF0000}Red\n{640000}Maroon\n{00FF00}Light Green\n{004B01}Green\n{008DFF}Aqua Blue\n{001AFF}Police Blue\n{FF6B00}Orange\n{8A8A8A}Grey\nBlack({000000}-"W")", "Select", "Back");
4164
4165 new color, x = GetPVarInt(playerid, "selectedVeh");
4166 if(sscanf(inputtext, "h", color))
4167 return ShowPlayerDialog(playerid, D_Veh_Menu_VIP_CustomC, DIALOG_STYLE_INPUT, ""B"Vehicle Menu::"W" Custom VIP Text color", "Write below HEX color code for your color.\nIf you want to get a color, we recommend you www.colorpicker.com !\n"R"WARNING: Your color need to have next form '0xHexColorCodeFF' !", "Set", "Back");
4168
4169 v_vTextColor[playerid][x] = color;
4170 SavePlayerVehicle(playerid, x);
4171 if(P_DATA[playerid][v_vTextStatus][x] == true) ChangeVipTextState(playerid, x, true);
4172 DeletePVar(playerid, "selectedVeh");
4173 SCM(playerid, -1, ""B"(Server)"W": You just changed your VIP Text color.");
4174 return 1;
4175 }
4176
4177 case D_Veh_Menu_VIP_CT:
4178 {
4179 new x = GetPVarInt(playerid, "selectedVeh");
4180 if(!response)
4181 {
4182 format(szStr, sizeof(szStr), "Item\tValue\nShow/Hide Vip Name\t%s\nChange Text\t%s\nChange text color\t{%06x}ColorTest", (P_DATA[playerid][v_vTextStatus][x]) ? (""G"On") : (""R"OFF"), v_vText[playerid][x], v_vTextColor[playerid][x] >>> 8);
4183 ShowPlayerDialog(playerid, D_Veh_Menu_VIP, DIALOG_STYLE_TABLIST_HEADERS, ""B"Vehicle Menu::"W" VIP Shop", szStr, "Select", "Exit");
4184 return 1;
4185 }
4186
4187 new szText[10];
4188 if(strlen(inputtext) == 6)
4189 {
4190 strins(inputtext, "0x", 0, strlen(inputtext));
4191 strcat(inputtext, "FF", strlen(inputtext));
4192 }
4193 if(sscanf(inputtext, "s[10]", szText) || (strlen(szText) < 3 || strlen(szText) > 10))
4194 return ShowPlayerDialog(playerid, D_Veh_Menu_VIP_CT, DIALOG_STYLE_INPUT, ""B"Vehicle Menu::"W" Change VIP Text", "Write below VIP text, this text can have maximum "R"10 characters !", "Set", "Back");
4195
4196 format(v_vText[playerid][x], 11, szText);
4197 if(P_DATA[playerid][v_vTextStatus][x] == true) ChangeVipTextState(playerid, x, true);
4198 DeletePVar(playerid, "selectedVeh");
4199 format(szStr, sizeof(szStr), ""B"(Server)"W": You changed successfully vip text to '%s' !", v_vText[playerid][x]);
4200 SCM(playerid, -1, szStr);
4201 SavePlayerVehicle(playerid, x);
4202 return 1;
4203 }
4204
4205 case D_Veh_Menu_Info:
4206 {
4207 DeletePVar(playerid, "selectedVeh");
4208 return 1;
4209 }
4210 case DIALOG_NEWPASS: {
4211 if(!response) return 1;
4212 if(strlen(inputtext) > 3) {
4213 new password[129];
4214 WP_Hash(password, sizeof(password), inputtext);
4215 if(!strcmp(password, P_DATA[playerid][pPassword], true)) {
4216 ShowPlayerDialog(playerid, DIALOG_NEWPASS1, DIALOG_STYLE_PASSWORD, "SERVER: Change Password", "Type your NEW password bellow!", "Change", "Cancel");
4217 }
4218 else return SendClientMessage(playerid, COLOR_WHITE, "({950000}Change Password{ffffff}) Parola gresita! Introdu parola pe care o ai setata acum!");
4219 }
4220 else return SendClientMessage(playerid, COLOR_WHITE, "({950000}Change Password{ffffff}) Parola gresita! Introdu parola pe care o ai setata acum!");
4221 }
4222 case DIALOG_NEWPASS1: {
4223 if(!response) return 1;
4224 if(strlen(inputtext) > 3) {
4225 new strings[300];
4226 WP_Hash(P_DATA[playerid][pPassword], 129, inputtext);
4227 format(strings, sizeof(strings), "UPDATE `playeraccounts` SET `playerPassword`='%s' WHERE `playerName`='%s'", P_DATA[playerid][pPassword],P_DATA[playerid][pNormalName]),mysql_tquery(SQL, strings, "", "");
4228 SCM(playerid, COLOR_WHITE, "Password changed!"),SCM(playerid, COLOR_GREEN3, "Daca dai parola contului altcuiva, adminii nu te pot ajuta sa-ti recuperezi contul."),SCM(playerid, COLOR_GREEN3, "E interzis sa incerci sa vinzi sau sa oferi la schimb contul din joc. Se sanctioneaza cu ban permanent.");
4229 SCMF(playerid, COLOR_RED2, "Your new password is: %s",inputtext);
4230 }
4231 else return SendClientMessage(playerid, COLOR_WHITE, "Password needs to have 4 or more characters!");
4232 }
4233 case DIALOG_ACOLOR: {
4234 if(!response) return 1;
4235 switch(listitem) {
4236 case 0: P_DATA[playerid][pColor] = 0, UpdateVar(playerid, "playerColor", 0), SCM(playerid, COLOR_WHITE,"{CECECE}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
4237 case 1: P_DATA[playerid][pColor] = 26, UpdateVar(playerid, "playerColor", 26), SCM(playerid, COLOR_WHITE,"{E70031}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
4238 case 2: P_DATA[playerid][pColor] = 27, UpdateVar(playerid, "playerColor", 27), SCM(playerid, COLOR_WHITE,"{AB0000}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
4239 case 3: P_DATA[playerid][pColor] = 28, UpdateVar(playerid, "playerColor", 28), SCM(playerid, COLOR_WHITE,"{FF6347}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
4240 }
4241 }
4242 case DIALOG_REGISTER: {
4243 new
4244 querySz[350],
4245 wpHash[129],
4246 playerName[MAX_PLAYER_NAME];
4247
4248 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
4249 mysql_real_escape_string(playerName, playerName);
4250 WP_Hash(wpHash, sizeof(wpHash), inputtext);
4251 format(querySz, sizeof(querySz), "INSERT INTO playeraccounts (playerName, playerPassword, vSlots) VALUES('%s', '%s', %d)", playerName, wpHash, DEFAULT_VEHICLE_SLOTS);
4252 mysql_query(SQL, querySz);
4253
4254 SendClientMessage(playerid, COLOR_WHITE, "SERVER: Your account is now registered. Please ensure you set your email address via the UCP.");
4255 SendClientMessage(playerid, COLOR_WHITE, "SERVER: Please login to continue.");
4256 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "SERVER: Login", "Welcome to the "SERVER_NAME" Server.\n\nPlease enter your password below!", "Login", "Cancel");
4257 }
4258 case DIALOG_REGISTER1: {
4259 switch(response) {
4260 case 0: {
4261 P_DATA[playerid][pLanguage] = 1;
4262 SendClientMessage(playerid, COLOR_WHITE, "Limba setata: romana.");
4263 SendClientMessage(playerid, COLOR_WHITE, "[EN] To set the language to English, use /eng.");
4264 SendClientMessage(playerid, COLOR_YELLOW, "Alege sexul caracterului tau.");
4265 ShowPlayerDialog(playerid,DIALOG_REGISTER2,DIALOG_STYLE_LIST,"Alege sexul caracterului","Barbat\nFemeie","Alege","");
4266 RegisterStats[playerid] = 2;
4267 SetPlayerSkin(playerid, 250);
4268 mysql_format(SQL,query,sizeof query,"UPDATE playeraccounts SET `playerLanguage`='1' WHERE `playerName`='%s'",P_DATA[playerid][pNormalName]);
4269 mysql_tquery(SQL,query,"","");
4270 }
4271 case 1: {
4272 P_DATA[playerid][pLanguage] = 2;
4273 SendClientMessage(playerid, COLOR_WHITE, "Language set to english.");
4274 SendClientMessage(playerid, COLOR_WHITE, "[RO] Pentru a seta limba romana foloseste /ro.");
4275 SendClientMessage(playerid, COLOR_YELLOW, "Choose your gender of your character.");
4276 ShowPlayerDialog(playerid,DIALOG_REGISTER2,DIALOG_STYLE_LIST,"Choose your gender of your character","Male\nFemale","Choose","");
4277 RegisterStats[playerid] = 2;
4278 SetPlayerSkin(playerid, 216);
4279 mysql_format(SQL,query,sizeof query, "UPDATE playeraccounts SET `playerLanguage`='2' WHERE `playerName`='%s'",P_DATA[playerid][pNormalName]);
4280 mysql_tquery(SQL,query,"","");
4281 }
4282 }
4283 }
4284 case DIALOG_REGISTER2: {
4285 if(!response) return 1;
4286 switch(listitem) {
4287 case 0: {
4288 P_DATA[playerid][pSex] = 1;
4289 mysql_format(SQL,query,sizeof query,"UPDATE playeraccounts SET `playerSex`='1',`playerSkin`='250' WHERE `playerName`='%s'",P_DATA[playerid][pNormalName]);
4290 mysql_tquery(SQL,query,"","");
4291 RegisterStats[playerid] = 3;
4292 SetPlayerSkin(playerid, 250);
4293 switch(P_DATA[playerid][pLanguage]) {
4294 case 2: SCM(playerid, COLOR_YELLOW, "Sex setat: barbat."),ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok", "");
4295 case 1: SCM(playerid, COLOR_YELLOW, "Gender set to: man."),ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:","Ok","");
4296 }
4297 }
4298 case 1: {
4299 P_DATA[playerid][pSex] = 2;
4300 mysql_format(SQL,query,sizeof query,"UPDATE playeraccounts SET `playerSex`='2',`playerSkin`='216' WHERE `playerName`='%s'",P_DATA[playerid][pNormalName]);
4301 mysql_tquery(SQL,query,"","");
4302 RegisterStats[playerid] = 3;
4303 SetPlayerSkin(playerid, 216);
4304 switch(P_DATA[playerid][pLanguage]) {
4305 case 2: SCM(playerid, COLOR_YELLOW, "Sex setat: femeie."),ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok", "");
4306 case 1: SCM(playerid, COLOR_YELLOW, "Gender set to: female."),ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:","Ok","");
4307 }
4308 }
4309 }
4310 }
4311 case DIALOG_REGISTER3: {
4312 if(!response) return 1;
4313 new tmppass[64];
4314 mysql_real_escape_string(inputtext, tmppass);
4315 if(strval(tmppass) > 1 && strval(tmppass) < 100 && response) {
4316 P_DATA[playerid][pAge] = strval(tmppass);
4317 mysql_format(SQL,query,sizeof query,"UPDATE playeraccounts SET `playerAge`='%d' WHERE `playerName`='%s'",P_DATA[playerid][pAge],P_DATA[playerid][pNormalName]);
4318 mysql_tquery(SQL,query,"","");
4319 RegisterStats[playerid] = 4;
4320 switch(P_DATA[playerid][pLanguage]) {
4321 case 2: SendClientMessage(playerid, COLOR_WHITE, "Introdu adresa de email. Daca nu vrei sa-ti setezi email-ul, poti apasa ok."),SendClientMessage(playerid, COLOR_WHITE, "Emailul te poate ajuta pentru a-ti recupera parola, in caz ca o uiti.");
4322 case 1: SendClientMessage(playerid, COLOR_WHITE, "Type your email. If you don't want to set your email, just click ok."),SendClientMessage(playerid, COLOR_WHITE, "The email will help you to recover your password, in case you loose it.");
4323 }
4324 ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_INPUT, "Email", "(ex: my_email@yahoo.com)", "Ok", "");
4325 }
4326 else ShowPlayerDialog(playerid,DIALOG_REGISTER2,DIALOG_STYLE_INPUT,"Your age:","Please enter below the age of your character:","Ok","");
4327 }
4328 case DIALOG_REGISTER4: {
4329 new emailtext[64],string[40];
4330 mysql_real_escape_string(inputtext, emailtext);
4331 strmid(P_DATA[playerid][pEmail], emailtext, 0, strlen(emailtext), 64);
4332 if(IsMail(inputtext) && response && strlen(inputtext)<30) {
4333 switch(P_DATA[playerid][pLanguage]) {
4334 case 2: {
4335 format(string, sizeof(string), "Email setat: %s.", P_DATA[playerid][pEmail]),SendClientMessage(playerid, COLOR_YELLOW, string);
4336 mysql_format(SQL,query,sizeof query,"UPDATE playeraccounts SET `playerEmail`='%s' WHERE `playerName`='%s'",P_DATA[playerid][pEmail],P_DATA[playerid][pNormalName]),mysql_tquery(SQL,query,"","");
4337 RegisterStats[playerid] = 5;
4338 }
4339 case 1: {
4340 format(string, sizeof(string), "Email set to: %s.", P_DATA[playerid][pEmail]),SendClientMessage(playerid, COLOR_YELLOW, string);
4341 mysql_format(SQL,query,sizeof query,"UPDATE playeraccounts SET `playerEmail`='%s' WHERE `playerName`='%s'",P_DATA[playerid][pEmail],P_DATA[playerid][pNormalName]),mysql_tquery(SQL,query,"","");
4342 RegisterStats[playerid] = 5;
4343 }
4344 }
4345 }
4346 else SendLM(playerid, COLOR_YELLOW, "Ai ales sa nu introduci emailul. Daca vrei sa-ti setezi un email pe cont intra pe broh.good2play.ro/panel", "You choosed not to set an email. You can go to broh.good2play.ro/panel to set an email at a later date, if you want to.");
4347 RegisterStats[playerid] = 0;
4348 TutTime[playerid] = 1;
4349 TogglePlayerSpectating(playerid, 1);
4350 new newacc[128];
4351 format(newacc,sizeof newacc,"{FF0000}(AdminInfo):{FFFFFF} New account: %s (%d) %s", GetName(playerid), playerid,GetPlayerIP(playerid)),submitToAdmins(newacc,COLOR_RED2);
4352 }
4353 case DIALOG_GMX: {
4354 if(P_DATA[playerid][pAdmin] >= 5) {
4355 if(!response)
4356 return SendClientMessage(playerid, COLOR_GREY, "Restart attempt canned.");
4357
4358 SendClientMessage(playerid, COLOR_YELLOW, "---- SERVER RESTART ----");
4359
4360 foreach(new x : Player) {
4361 if(P_DATA[x][pAdminDuty] > 0) {
4362 P_DATA[x][pAdminDuty] = 0;
4363 SetPlayerName(x, P_DATA[x][pNormalName]);
4364 SendClientMessage(x, COLOR_WHITE, "A server restart has been initiated; you have been forced off administrative duty to prevent being automatically kicked.");
4365 SetPlayerHealth(x, 100);
4366 }
4367
4368 savePlayerData(x);
4369 }
4370 SendClientMessage(playerid, COLOR_GREY, "- Player data saved.");
4371
4372 for(new xh = 0; xh < MAX_HOUSES; xh++) {
4373 saveHouse(xh);
4374 }
4375 SendClientMessage(playerid, COLOR_GREY, "- House data saved.");
4376
4377 for(new xf = 0; xf < MAX_GROUPS; xf++) {
4378 saveGroup(xf);
4379 }
4380 SendClientMessage(playerid, COLOR_GREY, "- Group data saved.");
4381
4382 for(new xf = 0; xf < MAX_BUSINESSES; xf++) {
4383 saveBusiness(xf);
4384 }
4385 SendClientMessage(playerid, COLOR_GREY, "- Business data saved.");
4386
4387 for(new xf = 0; xf < MAX_ASSETS; xf++) {
4388 saveAsset(xf);
4389 }
4390 SendClientMessage(playerid, COLOR_GREY, "- Server asset data saved.");
4391
4392 SendClientMessage(playerid, COLOR_WHITE, "Restarting timer activated.");
4393
4394 iGMXTick = 6;
4395 iGMXTimer = SetTimer("restartTimer", 1000, true);
4396
4397
4398 SendClientMessage(playerid, COLOR_YELLOW, "---- SERVER RESTART ----");
4399 }
4400 }
4401
4402 case DIALOG_FIGHTSTYLE: if(response) switch(listitem) {
4403 case 0: {
4404 if(P_DATA[playerid][pFightStyle] != FIGHT_STYLE_BOXING) {
4405 if(P_DATA[playerid][pMoney] >= 10000){
4406
4407 new
4408 business = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
4409
4410 P_DATA[playerid][pMoney] -= 10000;
4411 P_DATA[playerid][pFightStyle] = FIGHT_STYLE_BOXING;
4412 businessVariables[business][bVault] += 10000;
4413 SendClientMessage(playerid, COLOR_WHITE, "You have successfully purchased this style of fighting.");
4414 SetPlayerFightingStyle(playerid, P_DATA[playerid][pFightStyle]);
4415 }
4416 else SendClientMessage(playerid, COLOR_GREY, "You do not have enough money to purchase this.");
4417 }
4418 else SendClientMessage(playerid, COLOR_GREY, "You are already using this style.");
4419 }
4420 case 1: {
4421 if(P_DATA[playerid][pFightStyle] != FIGHT_STYLE_KUNGFU) {
4422 if(P_DATA[playerid][pMoney] >= 25000){
4423
4424 new
4425 business = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
4426
4427 P_DATA[playerid][pMoney] -= 25000;
4428 P_DATA[playerid][pFightStyle] = FIGHT_STYLE_KUNGFU;
4429 businessVariables[business][bVault] += 25000;
4430 SendClientMessage(playerid, COLOR_WHITE, "You have successfully purchased this style of fighting.");
4431 SetPlayerFightingStyle(playerid, P_DATA[playerid][pFightStyle]);
4432 }
4433 else SendClientMessage(playerid, COLOR_GREY, "You do not have enough money to purchase this.");
4434 }
4435 else SendClientMessage(playerid, COLOR_GREY, "You are already using this style.");
4436 }
4437 case 2: {
4438 if(P_DATA[playerid][pFightStyle] != FIGHT_STYLE_KNEEHEAD) {
4439 if(P_DATA[playerid][pMoney] >= 15000){
4440
4441 new
4442 business = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
4443
4444 P_DATA[playerid][pMoney] -= 15000;
4445 P_DATA[playerid][pFightStyle] = FIGHT_STYLE_KNEEHEAD;
4446 businessVariables[business][bVault] += 15000;
4447 SendClientMessage(playerid, COLOR_WHITE, "You have successfully purchased this style of fighting.");
4448 SetPlayerFightingStyle(playerid, P_DATA[playerid][pFightStyle]);
4449 }
4450 else SendClientMessage(playerid, COLOR_GREY, "You do not have enough money to purchase this.");
4451 }
4452 else SendClientMessage(playerid, COLOR_GREY, "You are already using this style.");
4453 }
4454 case 3: {
4455 if(P_DATA[playerid][pFightStyle] != FIGHT_STYLE_GRABKICK) {
4456 if(P_DATA[playerid][pMoney] >= 12000){
4457
4458 new
4459 business = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
4460
4461 P_DATA[playerid][pMoney] -= 12000;
4462 P_DATA[playerid][pFightStyle] = FIGHT_STYLE_GRABKICK;
4463 businessVariables[business][bVault] += 12000;
4464 SendClientMessage(playerid, COLOR_WHITE, "You have successfully purchased this style of fighting.");
4465 SetPlayerFightingStyle(playerid, P_DATA[playerid][pFightStyle]);
4466 }
4467 else SendClientMessage(playerid, COLOR_GREY, "You do not have enough money to purchase this.");
4468 }
4469 else SendClientMessage(playerid, COLOR_GREY, "You are already using this style.");
4470 }
4471 case 4: {
4472 if(P_DATA[playerid][pFightStyle] != FIGHT_STYLE_ELBOW) {
4473 if(P_DATA[playerid][pMoney] >= 10000){
4474
4475 new
4476 business = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
4477
4478 P_DATA[playerid][pMoney] -= 10000;
4479 P_DATA[playerid][pFightStyle] = FIGHT_STYLE_ELBOW;
4480 businessVariables[business][bVault] += 10000;
4481 SendClientMessage(playerid, COLOR_WHITE, "You have successfully purchased this style of fighting.");
4482 SetPlayerFightingStyle(playerid, P_DATA[playerid][pFightStyle]);
4483 }
4484 else SendClientMessage(playerid, COLOR_GREY, "You do not have enough money to purchase this.");
4485 }
4486 else SendClientMessage(playerid, COLOR_GREY, "You are already using this style.");
4487 }
4488 case 5: {
4489 if(P_DATA[playerid][pFightStyle] != FIGHT_STYLE_NORMAL) {
4490 if(P_DATA[playerid][pMoney] >= 5000){
4491
4492 new
4493 business = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
4494
4495 P_DATA[playerid][pMoney] -= 5000;
4496 P_DATA[playerid][pFightStyle] = FIGHT_STYLE_NORMAL;
4497 businessVariables[business][bVault] += 5000;
4498 SendClientMessage(playerid, COLOR_WHITE, "You have successfully purchased this style of fighting.");
4499 SetPlayerFightingStyle(playerid, P_DATA[playerid][pFightStyle]);
4500 }
4501 else SendClientMessage(playerid, COLOR_GREY, "You do not have enough money to purchase this.");
4502 }
4503 else SendClientMessage(playerid, COLOR_GREY, "You are already using this style.");
4504 }
4505 }
4506 case DIALOG_FOOD_ONE: {
4507 switch(listitem) {
4508 case 0: {
4509 if(P_DATA[playerid][pMoney] >= 10) {
4510 P_DATA[playerid][pMoney] -= 10;
4511 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $10 for the Cluckin' Little Deal.");
4512 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4513 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 93) {
4514 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+7);
4515 }
4516 }
4517 else {
4518 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4519 }
4520 }
4521 case 1: {
4522 if(P_DATA[playerid][pMoney] >= 25) {
4523 P_DATA[playerid][pMoney] -= 25;
4524 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $25 for the Cluckin' Big Meal.");
4525 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4526 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 85) {
4527 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+15);
4528 }
4529 }
4530 else {
4531 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4532 }
4533 }
4534 case 2: {
4535 if(P_DATA[playerid][pMoney] >= 50) {
4536 P_DATA[playerid][pMoney] -= 50;
4537 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $50 for the Cluckin' Huge Meal.");
4538 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4539 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 75) {
4540 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+25);
4541 }
4542 }
4543 else {
4544 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4545 }
4546 }
4547 }
4548 }
4549 case DIALOG_FOOD_TWO: {
4550 switch(listitem) {
4551 case 0: {
4552 if(P_DATA[playerid][pMoney] >= 10) {
4553 P_DATA[playerid][pMoney] -= 10;
4554 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $10 for the Moo Kids Meal.");
4555 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4556 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 93) {
4557 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+7);
4558 }
4559 }
4560 else {
4561 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4562 }
4563 }
4564 case 1: {
4565 if(P_DATA[playerid][pMoney] >= 25) {
4566 P_DATA[playerid][pMoney] -= 25;
4567 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $25 for the Beef Tower.");
4568 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4569 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 85) {
4570 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+15);
4571 }
4572 }
4573 else {
4574 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4575 }
4576 }
4577 case 2: {
4578 if(P_DATA[playerid][pMoney] >= 50) {
4579 P_DATA[playerid][pMoney] -= 50;
4580 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $50 for the Meat Stack.");
4581 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4582 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 75) {
4583 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+25);
4584 }
4585 }
4586 else {
4587 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4588 }
4589 }
4590 }
4591 }
4592 case DIALOG_FOOD_THREE: {
4593 switch(listitem) {
4594 case 0: {
4595 if(P_DATA[playerid][pMoney] >= 10) {
4596 P_DATA[playerid][pMoney] -= 10;
4597 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $10 for the Buster Meal.");
4598 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4599 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 93) {
4600 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+7);
4601 }
4602 else SetPlayerHealth(playerid, 100);
4603 }
4604 else {
4605 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4606 }
4607 }
4608 case 1: {
4609 if(P_DATA[playerid][pMoney] >= 25) {
4610 P_DATA[playerid][pMoney] -= 25;
4611 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $25 for the Double Deluxe.");
4612 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4613 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 85) {
4614 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+15);
4615 }
4616 }
4617 else {
4618 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4619 }
4620 }
4621 case 2: {
4622 if(P_DATA[playerid][pMoney] >= 50) {
4623 P_DATA[playerid][pMoney] -= 50;
4624 SendClientMessage(playerid, COLOR_WHITE, "You have been charged $50 for the Full Rack.");
4625 GetPlayerHealth(playerid, P_DATA[playerid][pHealth]);
4626 if(floatround(P_DATA[playerid][pHealth], floatround_round) < 75) {
4627 SetPlayerHealth(playerid, floatround(P_DATA[playerid][pHealth], floatround_round)+25);
4628 }
4629 }
4630 else {
4631 SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this item.");
4632 }
4633 }
4634 }
4635 }
4636 case DIALOG_SELL_FISH: {
4637 switch(response) {
4638 case 1: {
4639 switch(P_DATA[playerid][pFish]) {
4640 case 0: {
4641 P_DATA[playerid][pMoney] += 1000;
4642 SendClientMessage(playerid, COLOR_WHITE, "Congratulations, you have sold your collected fish for $1000.");
4643 }
4644 case 1: {
4645 P_DATA[playerid][pMoney] += 750;
4646 SendClientMessage(playerid, COLOR_WHITE, "Congratulations, you have sold your collected fish for $750.");
4647 }
4648 case 2: {
4649 P_DATA[playerid][pMoney] += 250;
4650 SendClientMessage(playerid, COLOR_WHITE, "Congratulations, you have sold your collected fish for $250.");
4651 }
4652 case 3: {
4653 P_DATA[playerid][pMoney] += 900;
4654 SendClientMessage(playerid, COLOR_WHITE, "Congratulations, you have sold your collected fish for $900.");
4655 }
4656 case 4: {
4657 P_DATA[playerid][pMoney] += 500;
4658 SendClientMessage(playerid, COLOR_WHITE, "Congratulations, you have sold your collected fish for $500.");
4659 }
4660 }
4661
4662 P_DATA[playerid][pFish] = -1;
4663 }
4664 }
4665 }
4666 case DIALOG_HELP: {
4667 if(response) switch(listitem) { // Add anything I missed plssssssssssssssssssssss.
4668 case 0: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: General Commands", "/stats /pay /accept /tie /drag /detain /eject /dropcar /killcheckpoint /give /eject /tie /helpme /ringbell /ad /seepms /kill \n/frisk /detain /admins /time /seeooc /seenewbie /giveweapon /givearmour /drop /briefcase /joinevent /quitevent","Return","Exit");
4669 case 1: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Chat Commands", "/o (global OOC message)\r\n/n (newbie chat message)\n/pm (OOCly PM another player)r\n/b (local OOC message)\r\n/w(hisper)\r\n/low (quiet message)\r\n/me (action)\r\n/do (action)\r\n/wt (walkie talkie)","Return","Exit");
4670 case 2: {
4671 if(P_DATA[playerid][pGroup] == 0) return ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "You're not in a group.","Return","Exit");
4672 switch(groupVariables[P_DATA[playerid][pGroup]][gGroupType]) {
4673 case 0: switch(P_DATA[playerid][pGroupRank]) {
4674 case 5: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "/g /gdeposit /gwithdraw /showmotd /invite /uninvite /changerank /gwithdraw /gdeposit /gmotd /lockhq /listmygroup","Return","Exit");
4675 case 6: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "/g /gdeposit /gwithdraw /showmotd /invite /uninvite /changerank /gwithdraw /gdeposit /gmotd /lockhq /listmygroup \n/granknames /gname /gsafepos","Return","Exit");
4676 default: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "/g /gdeposit /showmotd","Return","Exit");
4677 }
4678 case 1: { // LSPD
4679 switch(P_DATA[playerid][pGroupRank]) {
4680 case 4: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "/r /d /m /warrant /warrants /fingerprint /ticket /cuff /uncuff /tazer /lspd /showmotd /gdeposit /backup /cancelbackup /acceptbackup /confiscate /deployspike /destroyspike\n/listmygroup /swatinv /spikes","Return","Exit");
4681 case 5: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "/r /d /m /warrant /warrants /fingerprint /ticket /cuff /uncuff /tazer /lspd /showmotd /gdeposit /backup /cancelbackup /acceptbackup /confiscate /deployspike /destroyspike\n/gwithdraw /listmygroup /swatinv /spikes /invite /uninvite /changerank /gwithdraw /gmotd /lockhq /gov","Return","Exit");
4682 case 6: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "/r /d /m /warrant /warrants /fingerprint /ticket /cuff /uncuff /tazer /lspd /showmotd /gdeposit /backup /cancelbackup /acceptbackup /confiscate /deployspike /destroyspike\n/gwithdraw /listmygroup /swatinv /spikes /invite /uninvite /changerank /gwithdraw /gmotd /lockhq /gov /granknames /gname /gsafepos","Return","Exit");
4683 default: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "/r /d /m /warrant /warrants /fingerprint /ticket /cuff /uncuff /tazer /lspd /showmotd /gdeposit /backup /cancelbackup /acceptbackup /confiscate /deployspike /destroyspike","Return","Exit");
4684 }
4685 }
4686 case 2: { // GOVERNMENT
4687 switch(P_DATA[playerid][pGroupRank]) {
4688 case 6: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Group Commands", "/r /d /showmotd /gdeposit /gwithdraw /listmygroup /invite /uninvite /changerank /gmotd /granknames /gname /lockhq /taxrate /gsafepos","Return","Exit");
4689 }
4690 }
4691 }
4692 }
4693 case 3: {
4694 ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Animation Commands",
4695 "\
4696 /handsup /drunk /bomb /rob /laugh /lookout /robman /crossarms /sit /siteat /hide /vomit /eat\n\
4697 /wave /slapass /deal /taichi /crack /smoke /chat /dance /finger /taichi /drinkwater /pedmove /bat\n\
4698 /checktime /sleep /blob /opendoor /wavedown /reload /cpr /dive /showoff /box /tag /salute\n\
4699 /goggles /cry /dj /cheer /throw /robbed /hurt /nobreath /bar /getjiggy /fallover /rap /piss\n\
4700 /crabs /handwash /signal /stop /gesture /masturbate","Return","Exit");
4701 }
4702 case 4: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: House Commands", "/home /buyhouse /sellhouse /lockhouse /hgetweapon /hstoreweapon /hwithdraw /hdeposit /changeclothes", "Return","Exit");
4703 case 5: switch(jobVariables[P_DATA[playerid][pJob]][jJobType]) {
4704 case 1: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Job Commands (Arms Dealer)", "/creategun /giveweapon /getmats","Return","Exit");
4705 case 2: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Job Commands (Detective)", "/track /trackcar /trackplates /trackhouse /trackbusiness","Return","Exit");
4706 case 3: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Job Commands (Mechanic)", "/fixcar /noscar /colourcar /hydcar","Return","Exit");
4707 case 4: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Job Commands (Fisherman)", "/fish","Return","Exit");
4708 default: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Job Commands", "You don't have a public job.","Return","Exit");
4709 }
4710 case 6: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Business Commands", "/business /lockbusiness /buybusiness /bwithdraw /businessname /bbalance /buy /sellbusiness /bspawnpos", "Return","Exit");
4711 case 7: {
4712 if(P_DATA[playerid][pHelper] >= 1) ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Helper Commands", "/he /nmute /helperduty", "Return","Exit");
4713 else SendClientMessage(playerid, COLOR_GREY, "You aren't an official helper.");
4714 }
4715 case 8: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Vehicle Commands", "/findcar /abandoncar /lockcar /givecar /unmodcar /vbalance /vstoreweapon /vgetweapon /vdeposit /vwithdraw", "Return","Exit");
4716 case 9: ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "SERVER: Bank Commands", "/wiretransfer /deposit /withdraw", "Return","Exit");
4717 }
4718 }
4719 case DIALOG_GENDER_SELECTION: {
4720 switch(response) {
4721 case 1: {
4722 SendClientMessage(playerid, COLOR_YELLOW, "Great. We now know that you're a man.");
4723 P_DATA[playerid][pGender] = 1;
4724 P_DATA[playerid][pTutorial] = 3;
4725 }
4726 case 0: {
4727 SendClientMessage(playerid, COLOR_YELLOW, "Great. We now know that you're a woman.");
4728 P_DATA[playerid][pGender] = 2;
4729 P_DATA[playerid][pTutorial] = 3;
4730 }
4731 }
4732
4733 ShowPlayerDialog(playerid, DIALOG_TUTORIAL_DOB, DIALOG_STYLE_INPUT, "SERVER: Character Age", "Please enter the age of your character.", "Proceed", "Cancel");
4734 }
4735 case DIALOG_TWENTYFOURSEVEN: {
4736 if(!response) return 1;
4737
4738 new
4739 businessID = GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD;
4740
4741 switch(listitem) {
4742 case 0: { // Rope
4743 if(P_DATA[playerid][pMoney] >= 5) {
4744 if(P_DATA[playerid][pRope] >= 30) return SendClientMessage(playerid, COLOR_GREY, "You are unable to purchase any more rope.");
4745
4746 P_DATA[playerid][pMoney] -= 5;
4747 businessVariables[businessID][bVault] += 5;
4748 P_DATA[playerid][pRope]++;
4749
4750 SendClientMessage(playerid, COLOR_WHITE, "You have purchased 1 line of Rope!");
4751 }
4752 else {
4753 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this product.");
4754 }
4755 }
4756 case 1: { // Cellphone
4757 if(P_DATA[playerid][pMoney] >= 100) {
4758 new
4759 messageString[64];
4760
4761 P_DATA[playerid][pMoney] -= 100;
4762 businessVariables[businessID][bVault] += 75;
4763 P_DATA[playerid][pPhoneNumber] = random(89999999)+10000000; // Random eight digit phone number (which won't get crazy ones like 0, etc)
4764
4765 format(messageString, sizeof(messageString), "You have purchased a cell phone! Your number is %d.", P_DATA[playerid][pPhoneNumber]);
4766 SendClientMessage(playerid, COLOR_WHITE, messageString);
4767 }
4768 else {
4769 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this product.");
4770 }
4771 }
4772 case 2: { // Phonebook
4773 if(P_DATA[playerid][pMoney] >= 75) {
4774 P_DATA[playerid][pMoney] -= 75;
4775 businessVariables[businessID][bVault] += 75;
4776 P_DATA[playerid][pPhoneBook] = 1;
4777
4778 SendClientMessage(playerid, COLOR_WHITE, "You have purchased a phonebook. Use /number to trace a number down!");
4779 }
4780 else {
4781 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this product.");
4782 }
4783 }
4784 case 3: {
4785 if(P_DATA[playerid][pMoney] >= 25) {
4786 P_DATA[playerid][pMoney] -= 25;
4787 businessVariables[businessID][bVault] += 25;
4788 P_DATA[playerid][pPhoneCredit] += 1500;
4789
4790 SendClientMessage(playerid, COLOR_WHITE, "You have purchased a $25 phone credit voucher.");
4791 }
4792 else {
4793 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this product.");
4794 }
4795 }
4796 case 4: {
4797 if(P_DATA[playerid][pWalkieTalkie] == -1) {
4798 if(P_DATA[playerid][pMoney] >= 750) {
4799 P_DATA[playerid][pMoney] -= 750;
4800 businessVariables[businessID][bVault] += 750;
4801 P_DATA[playerid][pWalkieTalkie] = 0;
4802
4803 SendClientMessage(playerid, COLOR_WHITE, "You have purchased a walkie talkie - use /setfrequency to tune it, and /wt to speak.");
4804 }
4805 else {
4806 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this product.");
4807 }
4808 }
4809 else SendClientMessage(playerid, COLOR_GREY, "You already have a walkie talkie.");
4810 }
4811 }
4812 }
4813 case DIALOG_SEX_SHOP: {
4814 new
4815 businessID = getPlayerBusinessID(playerid);
4816
4817 switch(listitem) {
4818 case 0: { // Purple Dildo
4819 if(P_DATA[playerid][pMoney] >= 5) {
4820 P_DATA[playerid][pMoney] -= 5;
4821 businessVariables[businessID][bVault] += 5;
4822 givePlayerValidWeapon(playerid, 10);
4823 }
4824 else {
4825 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4826 }
4827 }
4828 case 1: { // Small White Vibrator
4829 if(P_DATA[playerid][pMoney] >= 8) {
4830 P_DATA[playerid][pMoney] -= 8;
4831 businessVariables[businessID][bVault] += 8;
4832 givePlayerValidWeapon(playerid, 11);
4833 }
4834 else {
4835 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4836 }
4837 }
4838 case 2: { // Silver Vibrator
4839 if(P_DATA[playerid][pMoney] >= 10) {
4840 P_DATA[playerid][pMoney] -= 10;
4841 businessVariables[businessID][bVault] += 10;
4842 givePlayerValidWeapon(playerid, 13);
4843 }
4844 else {
4845 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4846 }
4847 }
4848 case 3: { // Large White Vibrator
4849 if(P_DATA[playerid][pMoney] >= 12) {
4850 P_DATA[playerid][pMoney] -= 12;
4851 businessVariables[businessID][bVault] += 12;
4852 givePlayerValidWeapon(playerid, 12);
4853 }
4854 else {
4855 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4856 }
4857 }
4858 case 4: { // Flowers
4859 if(P_DATA[playerid][pMoney] >= 14) {
4860 P_DATA[playerid][pMoney] -= 14;
4861 businessVariables[businessID][bVault] += 14;
4862 givePlayerValidWeapon(playerid, 14);
4863 }
4864 else {
4865 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4866 }
4867 }
4868 }
4869 }
4870 case DIALOG_HELP2: {
4871 if(response) return showHelp(playerid);
4872 }
4873 case DIALOG_BAR: {
4874 if(!response) return 1;
4875
4876 new
4877 businessID = GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD;
4878
4879 if(businessVariables[businessID][bType] != 3)
4880 return 1;
4881
4882 switch(listitem) {
4883 case 0: { // Stock Bar Cigars
4884 if(P_DATA[playerid][pMoney] >= 2) {
4885 P_DATA[playerid][pMoney] -= 2;
4886 businessVariables[businessID][bVault] += 2;
4887 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
4888 }
4889 else {
4890 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4891 }
4892 }
4893 case 1: { // Sprunk
4894 if(P_DATA[playerid][pMoney] >= 3) {
4895 P_DATA[playerid][pMoney] -= 3;
4896 businessVariables[businessID][bVault] += 3;
4897 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
4898 }
4899 else {
4900 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4901 }
4902 }
4903 case 3: { // Beer
4904 if(P_DATA[playerid][pMoney] >= 5) {
4905 P_DATA[playerid][pMoney] -= 5;
4906 businessVariables[businessID][bVault] += 5;
4907 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
4908 }
4909 else {
4910 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4911 }
4912 }
4913 case 4: { // Wine
4914 if(P_DATA[playerid][pMoney] >= 10) {
4915 P_DATA[playerid][pMoney] -= 10;
4916 businessVariables[businessID][bVault] += 10;
4917 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
4918 }
4919 else {
4920 return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay for this product.");
4921 }
4922 }
4923 }
4924 }
4925 case DIALOG_LOGIN: {
4926 if(!response) return Kick(playerid);
4927
4928 new
4929 szPass[129],
4930 szQuery[350],
4931 Cache: r;
4932
4933 WP_Hash(szPass, sizeof(szPass), inputtext);
4934 mysql_format(SQL, szQuery, sizeof(szQuery), "SELECT * FROM `playeraccounts` WHERE `playerName` = '%e' AND `playerPassword` = '%e'", GetName(playerid), szPass);
4935 print(szQuery);
4936 r = mysql_query(SQL, szQuery, true);
4937 if(cache_get_row_count() > 0)
4938 {
4939 OnPlayerLogin(playerid, 1);
4940 } else OnPlayerLogin(playerid, 0);
4941 cache_delete(r);
4942 }
4943 case DIALOG_GROUP_ENTER: {
4944 if(response == 1) {
4945 new
4946 x = GetPVarInt(playerid, "gE"); // So we don't have to access it each and every time.
4947
4948 DeletePVar(playerid, "gE");
4949
4950 new
4951 string[128],
4952 name[MAX_PLAYER_NAME];
4953
4954 GetPlayerName(playerid, name, MAX_PLAYER_NAME);
4955 format(string,sizeof(string),"* %s breaks down the door and enters the building.", name);
4956 nearByMessage(playerid, COLOR_PURPLE, string);
4957
4958 if(P_DATA[playerid][pAdminDuty] < 1 && groupVariables[x][gGroupHQLockStatus] == 1) {
4959 groupVariables[x][gGroupHQLockStatus] = 0;
4960 format(string, sizeof(string), "%s's HQ\n\nPress CROUCH to enter.", groupVariables[x][gGroupName]);
4961 UpdateDynamic3DTextLabelText(groupVariables[x][gGroupLabelID], COLOR_YELLOW, string);
4962 }
4963
4964 SetPlayerPos(playerid, groupVariables[x][gGroupInteriorPos][0], groupVariables[x][gGroupInteriorPos][1], groupVariables[x][gGroupInteriorPos][2]);
4965 SetPlayerInterior(playerid, groupVariables[x][gGroupHQInteriorID]);
4966 SetPlayerVirtualWorld(playerid, GROUP_VIRTUAL_WORLD+x);
4967 }
4968 }
4969 case DIALOG_HOUSE_ENTER: {
4970 if(response == 1) {
4971 new
4972 x = GetPVarInt(playerid, "hE"); // So we don't have to access it each and every time.
4973
4974 DeletePVar(playerid, "hE");
4975
4976 new // Ya. Thought we may as well have the old emote for breakin' down dem doors.
4977 string[128],
4978 name[MAX_PLAYER_NAME];
4979
4980 GetPlayerName(playerid, name, MAX_PLAYER_NAME);
4981 format(string,sizeof(string),"* %s breaks down the door and enters the house.", name);
4982 nearByMessage(playerid, COLOR_PURPLE, string);
4983
4984 if(P_DATA[playerid][pAdminDuty] < 1 && houseVariables[x][hHouseLocked] == 1) { // Might seem redundant, but if many people
4985 // break in at once this'll stop unnecessary code from being executed.
4986 houseVariables[x][hHouseLocked] = 0;
4987 format(string, sizeof(string), "House %d (owned)\nOwner: %s\n\nPress CROUCH to enter.", x, houseVariables[x][hHouseOwner]);
4988 UpdateDynamic3DTextLabelText(houseVariables[x][hLabelID], COLOR_YELLOW, string);
4989 }
4990
4991 SetPlayerPos(playerid, houseVariables[x][hHouseInteriorPos][0], houseVariables[x][hHouseInteriorPos][1], houseVariables[x][hHouseInteriorPos][2]);
4992 SetPlayerInterior(playerid, houseVariables[x][hHouseInteriorID]);
4993 SetPlayerVirtualWorld(playerid, HOUSE_VIRTUAL_WORLD+x);
4994 }
4995 }
4996 case DIALOG_BUSINESS_ENTER: {
4997 if(response == 1) {
4998 new
4999 x = GetPVarInt(playerid, "bE"); // So we don't have to access it each and every time.
5000
5001 DeletePVar(playerid, "bE");
5002
5003 new // Ya. Thought we may as well have the old emote for breakin' down dem doors. YAY FOR 64 STRING!!11
5004 string[128],
5005 name[MAX_PLAYER_NAME];
5006
5007 GetPlayerName(playerid, name, MAX_PLAYER_NAME);
5008 format(string,sizeof(string),"* %s breaks down the door and enters the business.", name);
5009 nearByMessage(playerid, COLOR_PURPLE, string);
5010
5011 if(P_DATA[playerid][pAdminDuty] < 1 && businessVariables[x][bLocked] == 1) {
5012
5013 businessVariables[x][bLocked] = 0;
5014 format(string, sizeof(string), "%s\n(Business %d - owned by %s)\n\nPress CROUCH to enter", businessVariables[x][bName], x, businessVariables[x][bOwner]);
5015 UpdateDynamic3DTextLabelText(businessVariables[x][bLabelID], COLOR_YELLOW, string);
5016 }
5017
5018 SetPlayerPos(playerid, businessVariables[x][bInteriorPos][0], businessVariables[x][bInteriorPos][1], businessVariables[x][bInteriorPos][2]);
5019 SetPlayerInterior(playerid, businessVariables[x][bInterior]);
5020 SetPlayerVirtualWorld(playerid, BUSINESS_VIRTUAL_WORLD+x);
5021 }
5022 }
5023 case DIALOG_CREATEGUN:
5024 {
5025 if(!response)
5026 return 1;
5027
5028 new
5029 string[128],
5030 playerName[MAX_PLAYER_NAME];
5031
5032 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
5033 switch(listitem) {
5034 case 0: {
5035 if(P_DATA[playerid][pMaterials] >= 30) {
5036
5037 givePlayerValidWeapon(playerid, 8);
5038 P_DATA[playerid][pMaterials] -= 30;
5039 SendClientMessage(playerid, COLOR_WHITE, "You have created a katana. Type /giveweapon [playerid] to pass the weapon on.");
5040 format(string, sizeof(string), "* %s has created a katana from their materials.", playerName);
5041 nearByMessage(playerid, COLOR_PURPLE, string);
5042 P_DATA[playerid][pJobDelay] = 30;
5043 P_DATA[playerid][pJobSkill][0]++;
5044 switch(P_DATA[playerid][pJobSkill][0]) {
5045 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5046 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5047 SendClientMessage(playerid,COLOR_WHITE,string);
5048 }
5049 }
5050 }
5051 else {
5052 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5053 }
5054 }
5055 case 1: {
5056 if(P_DATA[playerid][pMaterials] >= 30) {
5057
5058 givePlayerValidWeapon(playerid, 15);
5059 P_DATA[playerid][pMaterials] -= 30;
5060 SendClientMessage(playerid, COLOR_WHITE,"You have created a cane. Type /giveweapon [playerid] to pass the weapon on.");
5061 format(string, sizeof(string), "* %s has created a cane from their materials.", playerName);
5062 nearByMessage(playerid, COLOR_PURPLE, string);
5063 P_DATA[playerid][pJobSkill][0]++;
5064 P_DATA[playerid][pJobDelay] = 30;
5065 switch(P_DATA[playerid][pJobSkill][0]) {
5066 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5067 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5068 SendClientMessage(playerid,COLOR_WHITE,string);
5069 }
5070 }
5071 }
5072 else {
5073 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5074 }
5075 }
5076 case 2: {
5077 if(P_DATA[playerid][pMaterials] >= 33) {
5078
5079 givePlayerValidWeapon(playerid, 7);
5080 P_DATA[playerid][pMaterials] -= 33;
5081 SendClientMessage(playerid, COLOR_WHITE,"You have created a pool cue. Type /giveweapon [playerid] to pass the weapon on.");
5082 format(string, sizeof(string), "* %s has created a pool cue from their materials.", playerName);
5083 nearByMessage(playerid, COLOR_PURPLE, string);
5084 P_DATA[playerid][pJobSkill][0]++;
5085 P_DATA[playerid][pJobDelay] = 30;
5086 switch(P_DATA[playerid][pJobSkill][0]) {
5087 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5088 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5089 SendClientMessage(playerid,COLOR_WHITE,string);
5090 }
5091 }
5092 }
5093 else {
5094 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5095 }
5096 }
5097 case 3: {
5098 if(P_DATA[playerid][pMaterials] >= 35) {
5099
5100 givePlayerValidWeapon(playerid, 5);
5101 P_DATA[playerid][pMaterials] -= 35;
5102 SendClientMessage(playerid, COLOR_WHITE, "You have created a baseball bat. Type /giveweapon [playerid] to pass the weapon on.");
5103 format(string, sizeof(string), "* %s has created a baseball bat from their materials.", playerName);
5104 nearByMessage( playerid, COLOR_PURPLE, string);
5105 P_DATA[playerid][pJobSkill][0]++;
5106 P_DATA[playerid][pJobDelay] = 30;
5107 switch(P_DATA[playerid][pJobSkill][0]) {
5108 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5109 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5110 SendClientMessage(playerid,COLOR_WHITE,string);
5111 }
5112 }
5113 }
5114 else {
5115 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5116 }
5117 }
5118 case 4: {
5119 if(P_DATA[playerid][pMaterials] >= 50) {
5120
5121 givePlayerValidWeapon(playerid, 6);
5122 P_DATA[playerid][pMaterials] -= 50;
5123 SendClientMessage(playerid, COLOR_WHITE,"You have created a shovel. Type /giveweapon [playerid] to pass the weapon on.");
5124 format(string, sizeof(string), "* %s has created a shovel from their materials.", playerName);
5125 nearByMessage( playerid, COLOR_PURPLE, string);
5126 P_DATA[playerid][pJobSkill][0]++;
5127 P_DATA[playerid][pJobDelay] = 30;
5128 switch(P_DATA[playerid][pJobSkill][0]) {
5129 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5130 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5131 SendClientMessage(playerid,COLOR_WHITE,string);
5132 }
5133 }
5134 }
5135 else {
5136 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5137 }
5138 }
5139 case 5: {
5140 if(P_DATA[playerid][pMaterials] >= 250) {
5141
5142 givePlayerValidWeapon(playerid, 22);
5143 P_DATA[playerid][pMaterials] -= 250;
5144 SendClientMessage(playerid, COLOR_WHITE,"You have created a 9mm pistol. Type /giveweapon [playerid] to pass the weapon on.");
5145 format(string, sizeof(string), "* %s has created a 9mm pistol from their materials.", playerName);
5146 nearByMessage( playerid, COLOR_PURPLE, string);
5147 P_DATA[playerid][pJobSkill][0]++;
5148 P_DATA[playerid][pJobDelay] = 30;
5149 switch(P_DATA[playerid][pJobSkill][0]) {
5150 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5151 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5152 SendClientMessage(playerid,COLOR_WHITE,string);
5153 }
5154 }
5155 }
5156 else {
5157 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5158 }
5159 }
5160 case 6: {
5161 if(P_DATA[playerid][pMaterials] >= 300) {
5162
5163 givePlayerValidWeapon(playerid, 23);
5164 P_DATA[playerid][pMaterials] -= 300;
5165 SendClientMessage(playerid, COLOR_WHITE, "You have created a silenced pistol. Type /giveweapon [playerid] to pass the weapon on.");
5166 format(string, sizeof(string), "* %s has created a silenced pistol from their materials.", playerName);
5167 nearByMessage( playerid, COLOR_PURPLE, string);
5168 P_DATA[playerid][pJobSkill][0]++;
5169 P_DATA[playerid][pJobDelay] = 30;
5170 switch(P_DATA[playerid][pJobSkill][0]) {
5171 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5172 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5173 SendClientMessage(playerid,COLOR_WHITE,string);
5174 }
5175 }
5176 }
5177 else {
5178 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5179 }
5180 }
5181 case 7: {
5182 if(P_DATA[playerid][pMaterials] >= 550) {
5183
5184 givePlayerValidWeapon(playerid, 25);
5185 P_DATA[playerid][pMaterials] -= 550;
5186 SendClientMessage(playerid, COLOR_WHITE,"You have created a shotgun. Type /giveweapon [playerid] to pass the weapon on.");
5187 format(string, sizeof(string), "* %s has created a shotgun from their materials.", playerName);
5188 nearByMessage( playerid, COLOR_PURPLE, string);
5189 P_DATA[playerid][pJobSkill][0]++;
5190 P_DATA[playerid][pJobDelay] = 30;
5191 switch(P_DATA[playerid][pJobSkill][0]) {
5192 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5193 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5194 SendClientMessage(playerid,COLOR_WHITE,string);
5195 }
5196 }
5197 }
5198 else {
5199 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5200 }
5201 }
5202
5203 case 8: {
5204 if(P_DATA[playerid][pMaterials] >= 680) {
5205
5206 givePlayerValidWeapon(playerid, 24);
5207 P_DATA[playerid][pMaterials] -= 680;
5208 SendClientMessage(playerid, COLOR_WHITE, "You have created a Desert Eagle. Type /giveweapon [playerid] to pass the weapon on.");
5209 format(string, sizeof(string), "* %s has created a Desert Eagle from their materials.", playerName);
5210 nearByMessage(playerid, COLOR_PURPLE, string);
5211 P_DATA[playerid][pJobSkill][0]++;
5212 P_DATA[playerid][pJobDelay] = 30;
5213 switch(P_DATA[playerid][pJobSkill][0]) {
5214 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5215 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5216 SendClientMessage(playerid,COLOR_WHITE,string);
5217 }
5218 }
5219 }
5220 else {
5221 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5222 }
5223 }
5224
5225 case 9: {
5226 if( P_DATA[playerid][pMaterials] >= 850 )
5227 {
5228 givePlayerValidWeapon(playerid, 29);
5229 P_DATA[playerid][pMaterials] -= 850;
5230 SendClientMessage(playerid, COLOR_WHITE, "You have created an MP5. Type /giveweapon [playerid] to pass the weapon on.");
5231 format(string, sizeof(string), "* %s has created a %s from their materials.", playerName);
5232 nearByMessage( playerid, COLOR_PURPLE, string);
5233 P_DATA[playerid][pJobSkill][0]++;
5234 P_DATA[playerid][pJobDelay] = 30;
5235 switch(P_DATA[playerid][pJobSkill][0]) {
5236 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5237 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5238 SendClientMessage(playerid,COLOR_WHITE,string);
5239 }
5240 }
5241 }
5242 else {
5243 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5244 }
5245 }
5246 case 10: {
5247 if(P_DATA[playerid][pMaterials] >= 900 )
5248 {
5249
5250 givePlayerValidWeapon(playerid, 28);
5251 P_DATA[playerid][pMaterials] -= 900;
5252 SendClientMessage(playerid, COLOR_WHITE, "You have created a Micro Uzi. Type /giveweapon [playerid] to pass the weapon on.");
5253 format(string, sizeof(string), "* %s has created a Micro Uzi from their materials.", playerName);
5254 nearByMessage( playerid, COLOR_PURPLE, string);
5255 P_DATA[playerid][pJobSkill][0]++;
5256 P_DATA[playerid][pJobDelay] = 30;
5257 switch(P_DATA[playerid][pJobSkill][0]) {
5258 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5259 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5260 SendClientMessage(playerid,COLOR_WHITE,string);
5261 }
5262 }
5263 }
5264 else
5265 {
5266 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5267 }
5268 }
5269 case 11: {
5270 if(P_DATA[playerid][pMaterials] >= 1500) {
5271
5272 givePlayerValidWeapon(playerid, 30);
5273 P_DATA[playerid][pMaterials] -= 1500;
5274 SendClientMessage(playerid, COLOR_WHITE, "You have created an AK-47. Type /giveweapon [playerid] to pass the weapon on.");
5275 format(string, sizeof(string), "* %s has created an AK-47 from their materials.", playerName);
5276 nearByMessage( playerid, COLOR_PURPLE, string);
5277 P_DATA[playerid][pJobSkill][0]++;
5278 P_DATA[playerid][pJobDelay] = 30;
5279 switch(P_DATA[playerid][pJobSkill][0]) {
5280 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5281 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5282 SendClientMessage(playerid,COLOR_WHITE,string);
5283 }
5284 }
5285 }
5286 else {
5287 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5288 }
5289 }
5290 case 12: {
5291 if(P_DATA[playerid][pMaterials] >= 2000)
5292 {
5293 givePlayerValidWeapon(playerid, 31);
5294 P_DATA[playerid][pMaterials] -= 2000;
5295 SendClientMessage(playerid, COLOR_WHITE, "You have created an M4A1. Type /giveweapon [playerid] to pass the weapon on.");
5296 format(string, sizeof(string), "* %s has created an M4A1 from their materials.", playerName);
5297 nearByMessage(playerid, COLOR_PURPLE, string);
5298 P_DATA[playerid][pJobSkill][0]++;
5299 P_DATA[playerid][pJobDelay] = 30;
5300 switch(P_DATA[playerid][pJobSkill][0]) {
5301 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5302 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5303 SendClientMessage(playerid,COLOR_WHITE,string);
5304 }
5305 }
5306 }
5307 else {
5308 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5309 }
5310 }
5311 case 13: {
5312 if(P_DATA[playerid][pMaterials] >= 2450) {
5313
5314 givePlayerValidWeapon(playerid, 34);
5315 P_DATA[playerid][pMaterials] -= 2450;
5316 SendClientMessage(playerid, COLOR_WHITE,"You have created a sniper rifle. Type /giveweapon [playerid] to pass the weapon on.");
5317 format(string, sizeof(string), "* %s has created a sniper rifle from their materials.", playerName);
5318 nearByMessage( playerid, COLOR_PURPLE, string);
5319 P_DATA[playerid][pJobSkill][0]++;
5320 P_DATA[playerid][pJobDelay] = 30;
5321 switch(P_DATA[playerid][pJobSkill][0]) {
5322 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5323 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5324 SendClientMessage(playerid,COLOR_WHITE,string);
5325 }
5326 }
5327 }
5328 else {
5329 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5330 }
5331 }
5332 case 14: {
5333 if(P_DATA[playerid][pMaterials] >= 2550) {
5334
5335 givePlayerValidWeapon(playerid, 27);
5336 P_DATA[playerid][pMaterials] -= 2550;
5337 SendClientMessage(playerid, COLOR_WHITE, "You have created a SPAS12. Type /giveweapon [playerid] to pass the weapon on.");
5338 format(string, sizeof(string), "* %s has created a SPAS12 from their materials.", playerName);
5339 nearByMessage(playerid, COLOR_PURPLE, string);
5340 P_DATA[playerid][pJobSkill][0]++;
5341 P_DATA[playerid][pJobDelay] = 30;
5342 switch(P_DATA[playerid][pJobSkill][0]) {
5343 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5344 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5345 SendClientMessage(playerid,COLOR_WHITE,string);
5346 }
5347 }
5348 }
5349 else {
5350 SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5351 }
5352 }
5353 case 15: {
5354 if(P_DATA[playerid][pMaterials] >= 1750) {
5355
5356 SetPlayerArmour(playerid, 100);
5357 P_DATA[playerid][pMaterials] -= 1750;
5358 SendClientMessage(playerid, COLOR_WHITE, "You have created a kevlar vest. Type /givearmour [playerid] to pass it on.");
5359 format(string, sizeof(string), "* %s has created a kevlar vest from their materials.", playerName);
5360 nearByMessage(playerid, COLOR_PURPLE, string);
5361 P_DATA[playerid][pJobSkill][0]++;
5362 P_DATA[playerid][pJobDelay] = 30;
5363 switch(P_DATA[playerid][pJobSkill][0]) {
5364 case 50, 100, 150, 200, 250, 300, 350, 400, 450, 500: {
5365 format(string,sizeof(string),"Congratulations! Your weapon creation skill level is now %d. You can now create more powerful weapons.",P_DATA[playerid][pJobSkill][0]/50);
5366 SendClientMessage(playerid,COLOR_WHITE,string);
5367 }
5368 }
5369 }
5370 else SendClientMessage(playerid, COLOR_GREY, "You do not have enough materials.");
5371 }
5372 }
5373 }
5374 }
5375 return 1;
5376}
5377
5378stock nearByMessage(playerid, color, string[], Float: Distance = 12.0) {
5379
5380 new
5381 Float: nbCoords[3];
5382
5383 GetPlayerPos(playerid, nbCoords[0], nbCoords[1], nbCoords[2]);
5384
5385 foreach(new i : Player) {
5386 if(P_DATA[i][pStatus] >= 1) {
5387 if(IsPlayerInRangeOfPoint(i, Distance, nbCoords[0], nbCoords[1], nbCoords[2]) && (GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))) {
5388 SendClientMessage(i, color, string);
5389 }
5390 }
5391 }
5392
5393 return 1;
5394}
5395
5396public OnPlayerText(playerid, text[]) {
5397 if(P_DATA[playerid][pStatus] >= 1 && P_DATA[playerid][pMuted] == 0) {
5398 new
5399 playerName[MAX_PLAYER_NAME],
5400 queryString[255],
5401 iRetStr = strfind(text, "(", true, 0),
5402 textString[128];
5403
5404 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
5405
5406 if(iRetStr < 4 && iRetStr != -1) {
5407 format(textString, sizeof(textString), "%s says: (( %s ))", playerName, text);
5408 nearByMessage(playerid, COLOR_WHITE, textString);
5409 }
5410
5411 if(P_DATA[playerid][pPhoneCall] != -1) {
5412 format(textString, sizeof(textString), "(cellphone) \"%s\"", text);
5413 SetPlayerChatBubble(playerid, textString, COLOR_CHATBUBBLE, 10.0, 10000);
5414 nearByMessage(playerid, COLOR_WHITE, textString);
5415
5416 switch (P_DATA[playerid][pPhoneCall]) {
5417 case 911: {
5418 if(!strcmp(text, "LSPD", true) || !strcmp(text, "police", true)) {
5419 SendClientMessage(playerid, COLOR_WHITE, "(cellphone) 911: You have reached the Los Santos Police emergency hotline; can you describe the crime?");
5420 P_DATA[playerid][pPhoneCall] = 912;
5421 }
5422 else if(!strcmp(text, "LSFMD", true) || !strcmp(text, "medic", true) || !strcmp(text, "ambulance", true)) {
5423 SendClientMessage(playerid, COLOR_WHITE, "(cellphone) 911: This is the Los Santos Fire & Medic Department emergency hotline; describe the emergency, please.");
5424 P_DATA[playerid][pPhoneCall] = 914;
5425 }
5426 else SendClientMessage(playerid, COLOR_WHITE, "(cellphone) 911: Sorry, I didn't quite understand that... speak again?");
5427 }
5428 case 912: {
5429 if(strlen(text) > 1) {
5430 new
5431 location[MAX_ZONE_NAME];
5432
5433 GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
5434 format(textString, sizeof(textString), "Dispatch: %s has reported: '%s' (10-20 %s)", playerName, text, location);
5435 SendToGroup(1, COLOR_RADIOCHAT, textString);
5436
5437 SendClientMessage(playerid, COLOR_WHITE, "(cellphone) 911: Thank you for reporting this incident; a patrol unit is now on its way.");
5438
5439 SendClientMessage(playerid, COLOR_WHITE, "Your call has been terminated by the other party.");
5440
5441 if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE) {
5442 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
5443 }
5444 P_DATA[playerid][pPhoneCall] = -1;
5445 }
5446 }
5447 case 914: {
5448 if(strlen(text) > 1) {
5449 new
5450 location[MAX_ZONE_NAME];
5451
5452 GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
5453 format(textString, sizeof(textString), "Dispatch: %s has reported '%s' (10-20 %s)", playerName, text, location);
5454 SendToGroup(4, COLOR_RED, textString);
5455
5456 SendClientMessage(playerid, COLOR_WHITE, "(cellphone) 911: Thank you for reporting this incident; we are on our way.");
5457
5458 SendClientMessage(playerid, COLOR_WHITE, "Your call has been terminated by the other party.");
5459
5460 if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE) {
5461 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
5462 }
5463 P_DATA[playerid][pPhoneCall] = -1;
5464 }
5465 }
5466 default: { // If they're calling a player, this code is executed.
5467
5468 SendClientMessage(P_DATA[playerid][pPhoneCall], COLOR_GREY, textString);
5469 mysql_real_escape_string(textString, textString);
5470 format(queryString, sizeof(queryString), "INSERT INTO chatLogs (value, playerinternalid) VALUES('%s', '%d')", textString, P_DATA[playerid][pSQL]);
5471 mysql_query(SQL, queryString);
5472 }
5473 }
5474 }
5475
5476 else {
5477 switch(P_DATA[playerid][pColor]) {
5478 case 0: format(textString, sizeof(textString), "%s: %s", playerName, text);
5479 case 1 .. 25: format(textString, sizeof textString, "%s: %s",playerName,text);
5480 case 26: format(textString, sizeof(textString), "{EE1C1C}%s:{FFFFFF} %s", playerName, text);
5481 case 27: format(textString, sizeof(textString), "{A40000}%s:{FFFFFF} %s", playerName, text);
5482 case 28: format(textString, sizeof(textString), "{FF5252}%s:{FFFFFF} %s", playerName, text);
5483 }
5484 nearByMessage(playerid, COLOR_GREY, textString);
5485 mysql_real_escape_string(textString, textString);
5486 format(queryString, sizeof(queryString), "INSERT INTO chatLogs (value, playerinternalid) VALUES('%s', '%d')", textString, P_DATA[playerid][pSQL]);
5487 mysql_query(SQL, queryString);
5488 format(textString, sizeof(textString), "\"%s\"", text);
5489 SetPlayerChatBubble(playerid, textString, COLOR_CHATBUBBLE, 10.0, 10000);
5490 }
5491
5492 P_DATA[playerid][pSpamCount]++;
5493 }
5494 return 0;
5495}
5496
5497getPlayerHouseID(playerid) {
5498 new
5499 x;
5500
5501 while(x < MAX_HOUSES) {
5502 if(strlen(houseVariables[x][hHouseOwner]) >= 1) {
5503 if(!strcmp(houseVariables[x][hHouseOwner], P_DATA[playerid][pNormalName], true)) {
5504 return x;
5505 }
5506 }
5507 x++;
5508 }
5509
5510 return 0;
5511}
5512
5513getPlayerBusinessID(playerid) {
5514 new
5515 x;
5516
5517 while(x < MAX_BUSINESSES) {
5518 if(strlen(businessVariables[x][bOwner]) >= 1) {
5519 if(!strcmp(businessVariables[x][bOwner], P_DATA[playerid][pNormalName], true)) {
5520 return x;
5521 }
5522 }
5523 x++;
5524 }
5525
5526 return 0;
5527}
5528
5529stock resetP_DATA(playerid) {
5530 P_DATA[playerid][pStatus] = 0; // 0 - Unauthentic | 1 - Authentic
5531 P_DATA[playerid][pSeconds] = 0;
5532 P_DATA[playerid][pSkin] = 299;
5533 P_DATA[playerid][pSkinCount] = 0;
5534 P_DATA[playerid][pMoney] = 0;
5535 P_DATA[playerid][pOnRequest] = INVALID_PLAYER_ID;
5536 P_DATA[playerid][pFish] = -1;
5537 P_DATA[playerid][pBankMoney] = 20000;
5538 P_DATA[playerid][pHealth] = 100;
5539 P_DATA[playerid][pFishing] = 0;
5540 P_DATA[playerid][pArmour] = 0;
5541 P_DATA[playerid][pAnticheatExemption] = 0;
5542 P_DATA[playerid][pEvent] = 0;
5543 P_DATA[playerid][pJetpack] = 0;
5544 P_DATA[playerid][pWalkieTalkie] = -1;
5545 P_DATA[playerid][pHackWarnTime] = 0;
5546 P_DATA[playerid][pCarPaintjob] = -1;
5547 P_DATA[playerid][pBackup] = -1;
5548 P_DATA[playerid][pRope] = 0;
5549 P_DATA[playerid][pFightStyle] = 4;
5550 P_DATA[playerid][pCarColour][0] = -1;
5551 P_DATA[playerid][pCarColour][1] = -1;
5552 P_DATA[playerid][pMatrunTime] = 0;
5553 P_DATA[playerid][pPhoneBook] = 0;
5554 P_DATA[playerid][pHelperDuty] = 0;
5555 P_DATA[playerid][pDropCarTimeout] = 0;
5556 P_DATA[playerid][pHelper] = 0;
5557 P_DATA[playerid][pPhoneNumber] = -1;
5558 P_DATA[playerid][pSkinSet] = 0;
5559 P_DATA[playerid][pTutorial] = 0;
5560 P_DATA[playerid][pCarModel] = 0;
5561 P_DATA[playerid][pGender] = 1;
5562 P_DATA[playerid][pPhoneStatus] = 1;
5563 P_DATA[playerid][pHackWarnings] = 0;
5564 P_DATA[playerid][pSeeOOC] = 1;
5565 P_DATA[playerid][pGroup] = 0;
5566 P_DATA[playerid][pGroupRank] = 0;
5567 P_DATA[playerid][pPrisonTime] = 0;
5568 P_DATA[playerid][pPrisonID] = 0;
5569 P_DATA[playerid][pSpamCount] = 0;
5570 P_DATA[playerid][pNewbieEnabled] = 1;
5571 P_DATA[playerid][pMuted] = 0;
5572 P_DATA[playerid][pAdmin] = 0;
5573 P_DATA[playerid][pPhoneCall] = -1;
5574 P_DATA[playerid][pSQL] = -1;
5575 P_DATA[playerid][pVirtualWorld] = 0;
5576 P_DATA[playerid][pSpectating] = INVALID_PLAYER_ID;
5577 P_DATA[playerid][pJob] = 0;
5578 P_DATA[playerid][pFirstLogin] = 0;
5579 P_DATA[playerid][pAdminDuty] = 0;
5580 P_DATA[playerid][pReport] = 0;
5581 P_DATA[playerid][pInterior] = 0;
5582 P_DATA[playerid][pPlayingHours] = 0;
5583 P_DATA[playerid][pJobDelay] = 0;
5584 P_DATA[playerid][pCheckpoint] = 0;
5585 P_DATA[playerid][pMaterials] = 0;
5586 P_DATA[playerid][pJobSkill][0] = 0;
5587 P_DATA[playerid][pJobSkill][1] = 0;
5588 P_DATA[playerid][pPhoneCall] = -1;
5589 P_DATA[playerid][pFreezeTime] = 0;
5590 P_DATA[playerid][pFreezeType] = 0;
5591 P_DATA[playerid][pOOCMuted] = 0;
5592 P_DATA[playerid][pNewbieTimeout] = 0;
5593 P_DATA[playerid][pDrag] = -1;
5594 P_DATA[playerid][pAge] = 0;
5595 P_DATA[playerid][pCarTrunk][0] = 0;
5596 P_DATA[playerid][pCarTrunk][1] = 0;
5597 P_DATA[playerid][pPhoneCredit] = 0;
5598 P_DATA[playerid][pLanguage] = 0;
5599 P_DATA[playerid][pColor] = 0;
5600 P_DATA[playerid][pSex] = 0;
5601 RegisterStats[playerid] = 0,TutTime[playerid] = 0;
5602 new x;
5603 while(x < 13) P_DATA[playerid][pWeapons][x] = 0, x++;
5604 x = 0;
5605 while(x < 13) P_DATA[playerid][pCarMods][x] = 0, x++;
5606 x = 0;
5607 while(x < 5) P_DATA[playerid][pCarWeapons][x] = 0,x++;
5608
5609 format(P_DATA[playerid][pWarning1], 32, "(null)");
5610 format(P_DATA[playerid][pWarning2], 32, "(null)");
5611 format(P_DATA[playerid][pWarning3], 32, "(null)");
5612 format(P_DATA[playerid][pEmail], 255, "(null)");
5613 format(P_DATA[playerid][pReportMessage], 64, "(null)");
5614 format(P_DATA[playerid][pPassword], 129, "(null)");
5615 format(P_DATA[playerid][pNameUnbanning], MAX_PLAYER_NAME, "(null)");
5616 format(P_DATA[playerid][pConnectionIP], 32, "(null)");
5617
5618 GetPlayerName(playerid, P_DATA[playerid][pNormalName], MAX_PLAYER_NAME);
5619
5620 P_DATA[playerid][pTabbed] = 0;
5621 P_DATA[playerid][pConnectedSeconds] = 0;
5622
5623 return true;
5624}
5625
5626stock initiateConnections() {
5627 mysql_log(LOG_ALL);
5628 switch(mysqlconnection) {
5629 case 0: SQL = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_DATABASE, DB_PASSWORD);
5630 case 1: SQL = mysql_connect(DB_LINUX_HOSTNAME,DB_LINUX_USERNAME,DB_LINUX_DATABASE,DB_LINUX_PASSWORD);
5631 }
5632 if(mysql_errno(SQL))
5633 {
5634 print("[MySQL Err]: Your connection data is wrong. Check your MySQL connection.");
5635 return 0;
5636 }
5637 return true;
5638}
5639
5640stock validResetPlayerWeapons(playerid) {
5641 P_DATA[playerid][pAnticheatExemption] = 6;
5642 new xLoop;
5643 ResetPlayerWeapons(playerid);
5644 while(xLoop < 13) P_DATA[playerid][pWeapons][xLoop] = 0, xLoop++;
5645 if(P_DATA[playerid][pTabbed] >= 1) P_DATA[playerid][pOutstandingWeaponRemovalSlot] = 40;
5646 return 1;
5647}
5648
5649stock adminLog(string[]) {
5650 new queryString[201],cleanString[128];
5651 mysql_real_escape_string(string, cleanString);
5652 format(queryString, sizeof(queryString), "INSERT INTO adminLog (value, tickcount) VALUES('%s', '%d')", cleanString, GetTickCount()),mysql_query(SQL, queryString);
5653 return 1;
5654}
5655
5656stock syncPlayerTime(playerid) {
5657 if(!GetPlayerInterior(playerid)) SetPlayerWeather(playerid, weatherVariables[0]);
5658 else SetPlayerWeather(playerid, INTERIOR_WEATHER_ID);
5659 return SetPlayerTime(playerid, gTime[0], gTime[1]);
5660}
5661
5662// -------------------------------------------------- ANIMATION CODE ------------------------------------------ //
5663
5664
5665stock PlayerFacePlayer(playerid, targetplayerid) { // Yeah, this'll fix the handshake headaches we had last time around (shaking air).
5666
5667 new
5668 Float: Angle;
5669
5670 GetPlayerFacingAngle(playerid, Angle);
5671 SetPlayerFacingAngle(targetplayerid, Angle+180);
5672 return 1;
5673
5674}
5675
5676stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { // And this'll keep the players close.
5677
5678 new Float: a;
5679
5680 GetPlayerPos(playerid, x, y, a);
5681 GetPlayerFacingAngle(playerid, a);
5682
5683 if (GetPlayerVehicleID(playerid)) {
5684 GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
5685 }
5686
5687 x += (distance * floatsin(-a, degrees));
5688 y += (distance * floatcos(-a, degrees));
5689}
5690
5691stock IsPlayerAimingAtPlayer(playerid, aimid) {
5692
5693 new
5694 Float:Floats[7];
5695
5696 GetPlayerPos(playerid, Floats[0], Floats[1], Floats[2]);
5697 GetPlayerPos(aimid, Floats[3], Floats[4], Floats[5]);
5698 new Float:Distance = floatsqroot(floatpower(floatabs(Floats[0]-Floats[3]), 2) + floatpower(floatabs(Floats[1]-Floats[4]), 2));
5699 if(Distance < 10.0) {
5700
5701 GetPlayerFacingAngle(playerid, Floats[6]);
5702 Floats[0] += (Distance * floatsin(-Floats[6], degrees));
5703 Floats[1] += (Distance * floatcos(-Floats[6], degrees));
5704 Distance = floatsqroot(floatpower(floatabs(Floats[0]-Floats[3]), 2) + floatpower(floatabs(Floats[1]-Floats[4]), 2));
5705
5706 if(Distance < 2.0) {
5707
5708 return true;
5709 }
5710 }
5711 return false;
5712}
5713CMD:changepass(playerid,params[]) {
5714 if(IsPlayerConnected(playerid)) {
5715 ShowPlayerDialog(playerid, DIALOG_NEWPASS, DIALOG_STYLE_PASSWORD, "SERVER: Change Password","Type your current password bellow!","Change","Cancel");
5716 return 1;
5717 }
5718 return 1;
5719}
5720CMD:closestcar(playerid, params[]) {
5721 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
5722 if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
5723
5724 new
5725 playerWarpVehicle = GetClosestVehicle(playerid),
5726 string[64];
5727
5728 if(doesVehicleExist(playerWarpVehicle)) {
5729 PutPlayerInVehicle(playerid, playerWarpVehicle, 0);
5730 format(string, sizeof(string), "You have teleported into a %s (vehicle ID %d).", VehicleNames[GetVehicleModel(playerWarpVehicle) - 400], playerWarpVehicle);
5731 SendClientMessage(playerid, COLOR_WHITE, string);
5732 }
5733 else SendClientMessage(playerid, COLOR_GREY, "No vehicles are in range.");
5734 }
5735 else SendClientMessage(playerid, COLOR_GREY, "You can only use this command while on foot.");
5736 return 1;
5737}
5738
5739CMD:vehname(playerid, params[]) {
5740
5741 if(P_DATA[playerid][pAdmin] < 3) return OnlyAdmin
5742
5743 SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
5744 SendClientMessage(playerid, COLOR_WHITE, "Vehicle Search:");
5745
5746 new
5747 rcount,
5748 string[128];
5749
5750 if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "No keyword specified.");
5751 if(strlen(params) < 3) return SendClientMessage(playerid, COLOR_GREY, "Search keyword too short.");
5752
5753 for(new v; v < sizeof(VehicleNames); v++) {
5754 if(strfind(VehicleNames[v], params, true) != -1) {
5755
5756 if(rcount == 0) format(string, sizeof(string), "%s (ID %d)", VehicleNames[v], v+400);
5757 else format(string, sizeof(string), "%s | %s (ID %d)", string, VehicleNames[v], v+400);
5758
5759 rcount++;
5760 }
5761 }
5762
5763 if(rcount == 0) SendClientMessage(playerid, COLOR_GREY, "No results found.");
5764
5765 else if(strlen(string) >= 128) SendClientMessage(playerid, COLOR_GREY, "Too many results found.");
5766
5767 else SendClientMessage(playerid, COLOR_WHITE, string);
5768
5769 SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
5770 return 1;
5771}
5772
5773CMD:gunname(playerid, params[]) {
5774
5775 if(P_DATA[playerid][pAdmin] < 3) return OnlyAdmin
5776
5777 SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
5778 SendClientMessage(playerid, COLOR_WHITE, "Weapon Search:");
5779
5780 new
5781 rcount,
5782 string[128];
5783
5784 if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "No keyword specified.");
5785 if(strlen(params) < 3) return SendClientMessage(playerid, COLOR_GREY, "Search keyword too short.");
5786
5787 for(new v; v < sizeof(WeaponNames); v++) {
5788 if(strfind(WeaponNames[v], params, true) != -1) {
5789
5790 if(rcount == 0) format(string, sizeof(string), "%s (ID %d)", WeaponNames[v], v);
5791 else format(string, sizeof(string), "%s | %s (ID %d)", string, WeaponNames[v], v);
5792
5793 rcount++;
5794 }
5795 }
5796
5797 if(rcount == 0) SendClientMessage(playerid, COLOR_GREY, "No results found.");
5798
5799 else if(strlen(string) >= 128) SendClientMessage(playerid, COLOR_GREY, "Too many results found.");
5800
5801 else SendClientMessage(playerid, COLOR_WHITE, string);
5802
5803 SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
5804 return 1;
5805}
5806
5807CMD:gate(playerid, params[]) {
5808 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1) {
5809 if(IsPlayerInRangeOfPoint(playerid, 15.0, 1544.6, -1630.8, 13.0)) switch(LSPDGates[0][1]) {
5810 case 0: {
5811 SetDynamicObjectRot(LSPDGates[0][0],0.0, 0, 90.0);
5812 LSPDGates[0][1] = 1;
5813 }
5814 case 1: {
5815 SetDynamicObjectRot(LSPDGates[0][0],0.0, 90.0, 90.0);
5816 LSPDGates[0][1] = 0;
5817 }
5818 }
5819 else if(IsPlayerInRangeOfPoint(playerid, 15.0, 1589.19995117,-1637.98498535,14.69999981)) switch (LSPDGates[1][1]) {
5820 case 0: {
5821 MoveDynamicObject(LSPDGates[1][0] ,1589.19995117,-1637.98498535,9.69999981, 1.0);
5822 LSPDGates[1][1] = 1;
5823 PlayerPlaySoundEx(1035, 1589.19995117,-1637.98498535,14.69999981);
5824 }
5825 case 1: {
5826 MoveDynamicObject(LSPDGates[1][0],1589.19995117,-1637.98498535,14.69999981, 1.0);
5827 LSPDGates[1][1] = 0;
5828 PlayerPlaySoundEx(1035, 1589.19995117,-1637.98498535,14.69999981);
5829 }
5830 }
5831 }
5832 return 1;
5833}
5834
5835#include <anims>
5836
5837CMD:stopanim(playerid, params[]) {
5838 if(P_DATA[playerid][pFreezeType] == 0 && GetPlayerState(playerid) == 1 && P_DATA[playerid][pEvent] == 0) {
5839 ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
5840 TextDrawHideForPlayer(playerid, textdrawVariables[5]);
5841 SendClientMessage(playerid, COLOR_WHITE, "Animations cleared.");
5842 ClearAnimations(playerid);
5843 P_DATA[playerid][pAnimation] = 0;
5844 TogglePlayerControllable(playerid, 1);
5845 }
5846 else SendClientMessage(playerid, COLOR_GREY, "You can't do this right now.");
5847 return 1;
5848}
5849
5850CMD:time(playerid, params[]) {
5851 new time0,time1,time2,szMessage[128];
5852 gettime(time0, time1, time2);
5853 if(time1 < 10) format(szMessage, sizeof(szMessage), "The current time is %d:0%d (%d seconds).", time0, time1, time2);
5854 else format(szMessage, sizeof(szMessage), "The current time is %d:%d (%d seconds).", time0, time1, time2);
5855 SendClientMessage(playerid, COLOR_WHITE, szMessage);
5856 format(szMessage, sizeof(szMessage), "* %s raises her hand and looks down at her watch.", GetName(playerid));
5857 ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
5858 if(!IsPlayerInAnyVehicle(playerid)) ApplyAnimation(playerid,"COP_AMBIENT","Coplook_watch",4.1,0,0,0,0,0);
5859 return 1;
5860}
5861
5862CMD:wt(playerid, params[])
5863{
5864 new
5865 string[128],
5866 playerName[MAX_PLAYER_NAME];
5867
5868 if(isnull(params)) {
5869 return ShowSyntax(playerid, "/wt [message]");
5870 }
5871 else if(P_DATA[playerid][pFreezeType] > 0) {
5872 return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while cuffed, tazed, or frozen.");
5873 }
5874 else switch(P_DATA[playerid][pWalkieTalkie]) {
5875 case -1: SendClientMessage(playerid, COLOR_GREY, "You don't have a walkie talkie.");
5876 case 0: SendClientMessage(playerid, COLOR_GREY, "You need to set a broadcast frequency first (using /setfrequency).");
5877 default: {
5878 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
5879 format(string, sizeof(string), "(Walkie Talkie) %s: %s", playerName, params);
5880 SendToFrequency(P_DATA[playerid][pWalkieTalkie], COLOR_SMS, string);
5881 format(string,sizeof(string),"(radio) ''%s''", params);
5882 SetPlayerChatBubble(playerid, string, COLOR_CHATBUBBLE, 10.0, 10000);
5883 }
5884 }
5885 return 1;
5886}
5887
5888CMD:setfrequency(playerid, params[]) {
5889 if(isnull(params)) {
5890 return ShowSyntax(playerid, "/setfrequency [frequency] (0 to switch off).");
5891 }
5892 else if(P_DATA[playerid][pWalkieTalkie] == -1) {
5893 return SendClientMessage(playerid, COLOR_GREY, "You don't have a walkie talkie.");
5894 }
5895 new
5896 walkieFreq = strval(params),
5897 string[57];
5898
5899 if(walkieFreq < 0) {
5900 return SendClientMessage(playerid, COLOR_GREY, "Invalid frequency specified.");
5901 }
5902
5903 else switch(walkieFreq) {
5904 case 0: {
5905 SendClientMessage(playerid, COLOR_GREY, "You have switched off your walkie talkie.");
5906 P_DATA[playerid][pWalkieTalkie] = 0;
5907 }
5908 default: {
5909 format(string, sizeof(string), "You are now broadcasting at the frequency of #%d khz.", walkieFreq);
5910 SendClientMessage(playerid, COLOR_WHITE, string);
5911 P_DATA[playerid][pWalkieTalkie] = walkieFreq;
5912 }
5913 }
5914 return 1;
5915}
5916
5917CMD:g(playerid, params[]) {
5918 return cmd_group(playerid, params);
5919}
5920
5921CMD:group(playerid, params[]) {
5922
5923 if(P_DATA[playerid][pStatus] != 1 || P_DATA[playerid][pGroup] < 1) return 1;
5924 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1 || groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 2) {
5925 return SendClientMessage(playerid, COLOR_GREY, "This group does not have an OOC chat.");
5926 }
5927 new
5928 string[128],
5929 playerName[MAX_PLAYER_NAME];
5930
5931 if(isnull(params)) return ShowSyntax(playerid, "/g(roup) [message]");
5932
5933 if(P_DATA[playerid][pFreezeType] > 0) {
5934 return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while cuffed, tazed, or frozen.");
5935 }
5936
5937 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
5938
5939 switch(P_DATA[playerid][pGroupRank]) {
5940
5941 case 1: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1], playerName, params);
5942 case 2: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName2], playerName, params);
5943 case 3: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName3], playerName, params);
5944 case 4: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName4], playerName, params);
5945 case 5: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5], playerName, params);
5946 case 6: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6], playerName, params);
5947 default: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1], playerName, params);
5948 }
5949 SendToGroup(P_DATA[playerid][pGroup], COLOR_DCHAT, string);
5950 return 1;
5951}
5952
5953CMD:r(playerid, params[]) {
5954
5955 return cmd_radio(playerid, params);
5956}
5957
5958CMD:radio(playerid, params[]) {
5959
5960 if(P_DATA[playerid][pStatus] != 1) return 1;
5961 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] != 1 && groupVariables[P_DATA[playerid][pGroup]][gGroupType] != 2) {
5962 return SendClientMessage(playerid, COLOR_GREY, "This group does not have an official radio frequency.");
5963 }
5964 if(P_DATA[playerid][pFreezeType] > 0) {
5965 return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while cuffed, tazed, or frozen.");
5966 }
5967 new
5968 string[128],
5969 playerName[MAX_PLAYER_NAME];
5970
5971 if(isnull(params)) return ShowSyntax(playerid, "/r(adio) [message]");
5972
5973 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
5974
5975 switch(P_DATA[playerid][pGroupRank]) {
5976
5977 case 1: format(string, sizeof(string), "** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1], playerName, params);
5978 case 2: format(string, sizeof(string), "** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName2], playerName, params);
5979 case 3: format(string, sizeof(string), "** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName3], playerName, params);
5980 case 4: format(string, sizeof(string), "** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName4], playerName, params);
5981 case 5: format(string, sizeof(string), "** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5], playerName, params);
5982 case 6: format(string, sizeof(string), "** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6], playerName, params);
5983 default: format(string, sizeof(string), "** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1], playerName, params);
5984 }
5985 SendToGroup(P_DATA[playerid][pGroup], COLOR_RADIOCHAT, string);
5986 format(string,sizeof(string),"(radio) ''%s''",params);
5987 SetPlayerChatBubble(playerid, string, COLOR_CHATBUBBLE, 10.0, 10000);
5988 return 1;
5989}
5990
5991CMD:d(playerid, params[]) {
5992 return cmd_department(playerid, params);
5993}
5994
5995CMD:department(playerid, params[]) {
5996
5997 if(P_DATA[playerid][pStatus] != 1) return 1;
5998 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] != 1 && groupVariables[P_DATA[playerid][pGroup]][gGroupType] != 2) {
5999 return SendClientMessage(playerid, COLOR_GREY, "This group does not have an official radio frequency.");
6000 }
6001 if(P_DATA[playerid][pFreezeType] > 0) {
6002 return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while cuffed, tazed, or frozen.");
6003 }
6004 new
6005 string[128],
6006 playerName[MAX_PLAYER_NAME];
6007
6008 if(isnull(params)) return ShowSyntax(playerid, "/d(epartment) [message]");
6009
6010 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
6011
6012 switch(P_DATA[playerid][pGroupRank]) {
6013
6014 case 1: format(string, sizeof(string), "*** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1], playerName, params);
6015 case 2: format(string, sizeof(string), "*** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName2], playerName, params);
6016 case 3: format(string, sizeof(string), "*** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName3], playerName, params);
6017 case 4: format(string, sizeof(string), "*** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName4], playerName, params);
6018 case 5: format(string, sizeof(string), "*** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5], playerName, params);
6019 case 6: format(string, sizeof(string), "*** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6], playerName, params);
6020 default: format(string, sizeof(string), "*** %s %s: %s, over.", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1], playerName, params);
6021 }
6022 SendToGroup(P_DATA[playerid][pGroup], COLOR_DCHAT, string);
6023 format(string,sizeof(string),"(radio) ''%s''",params);
6024 SetPlayerChatBubble(playerid, string, COLOR_CHATBUBBLE, 10.0, 10000);
6025 return 1;
6026}
6027
6028CMD:gov(playerid, params[]) {
6029
6030 new
6031 string[128],
6032 playerName[MAX_PLAYER_NAME];
6033
6034 if(isnull(params)) ShowSyntax(playerid, "/gov [message]");
6035
6036 else if((groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1 || groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 2) && P_DATA[playerid][pGroupRank] > 4)
6037 {
6038 format(string, sizeof(string), "------------------------- Government Announcement (%s) -------------------------", groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
6039 SendClientMessageToAll(COLOR_TEAL, string);
6040
6041 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
6042 switch(P_DATA[playerid][pGroupRank]) {
6043 case 5: format(string, sizeof(string), "* %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5], playerName, params);
6044 case 6: format(string, sizeof(string), "* %s %s: %s", groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6], playerName, params);
6045 }
6046 SendClientMessageToAll(COLOR_WHITE, string);
6047 }
6048 return 1;
6049}
6050
6051CMD:bbalance(playerid, params[]) {
6052 if(getPlayerBusinessID(playerid) >= 1) {
6053 new
6054 szMessage[32],
6055 businessID = getPlayerBusinessID(playerid);
6056
6057 format(szMessage, sizeof(szMessage), "Business Vault Balance: $%d.", businessVariables[businessID][bVault]);
6058 SendClientMessage(playerid, COLOR_WHITE, szMessage);
6059 }
6060 return 1;
6061}
6062CMD:helperduty(playerid, params[]) {
6063 if(P_DATA[playerid][pHelper] >= 1) {
6064 switch(P_DATA[playerid][pHelperDuty]) {
6065 case 0: {
6066 P_DATA[playerid][pHelperDuty] = 1;
6067 SendClientMessage(playerid, COLOR_WHITE, "You are now on duty as a Helper.");
6068 }
6069 case 1: {
6070 P_DATA[playerid][pHelperDuty] = 0;
6071 SendClientMessage(playerid, COLOR_WHITE, "You are now off duty as a Helper.");
6072 }
6073 }
6074 }
6075 return 1; //
6076}
6077
6078CMD:vgroup(playerid, params[]) {
6079 if(P_DATA[playerid][pAdmin] < 4) return OnlyAdmin
6080 if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside the vehicle that you wish to alter the group requirement of.");
6081 new string[96],groupParam = strval(params);
6082 if(groupParam < 0 || groupParam > MAX_GROUPS) return SendClientMessage(playerid, COLOR_GREY, "Invalid group ID.");
6083 for(new x = 0; x < MAX_VEHICLES; x++) {
6084 if(vehicleVariables[x][vVehicleScriptID] == GetPlayerVehicleID(playerid)) {
6085 vehicleVariables[x][vVehicleGroup] = groupParam;
6086 saveVehicle(x);
6087 switch(groupParam) {
6088
6089 case 0: format(string, sizeof(string), "You have removed group restrictions from this vehicle (%d).", x);
6090 default: format(string, sizeof(string), "You have changed this vehicle's group to %s (vehicle %d).", groupVariables[groupParam][gGroupName], x);
6091 }
6092 SendClientMessage(playerid, COLOR_WHITE, string);
6093 return 1;
6094 }
6095 }
6096 return 1;
6097}
6098
6099CMD:vcolour(playerid, params[]) {
6100 if(P_DATA[playerid][pAdmin] < 4) return OnlyAdmin
6101 if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside the vehicle that you wish to alter the colour of.");
6102
6103 new
6104 string[80],
6105 colour1,
6106 colour2;
6107
6108 if(sscanf(params,"dd", colour1, colour2)) return ShowSyntax(playerid, "/vcolour [colour 1] [colour 2]");
6109
6110 for(new x = 0; x < MAX_VEHICLES; x++) {
6111 if(vehicleVariables[x][vVehicleScriptID] == GetPlayerVehicleID(playerid)) {
6112 vehicleVariables[x][vVehicleColour][0] = colour1;
6113 vehicleVariables[x][vVehicleColour][1] = colour2;
6114
6115 ChangeVehicleColor(vehicleVariables[x][vVehicleScriptID], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1]);
6116
6117 saveVehicle(x);
6118
6119 format(string, sizeof(string), "You have changed this vehicle's colour combination to %d, %d (vehicle %d).", colour1, colour2, x);
6120 SendClientMessage(playerid, COLOR_WHITE, string);
6121 return 1;
6122 }
6123 }
6124 return 1;
6125}
6126
6127CMD:vmodel(playerid, params[]) {
6128 if(P_DATA[playerid][pAdmin] < 4) return OnlyAdmin
6129 if(isnull(params)) return ShowSyntax(playerid, "/vmodel [modelid]");
6130 else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside the vehicle that you wish to change the model of.");
6131 else if(strval(params) < 400 || strval(params) > 611) return SendClientMessage(playerid, COLOR_WHITE, "Valid car IDs start at 400, and end at 611.");
6132
6133 new
6134 string[64];
6135
6136 for(new x = 0; x < MAX_VEHICLES; x++) {
6137 if(vehicleVariables[x][vVehicleScriptID] == GetPlayerVehicleID(playerid)) {
6138
6139 vehicleVariables[x][vVehicleModelID] = strval(params);
6140
6141 DestroyVehicle(vehicleVariables[x][vVehicleScriptID]);
6142 vehicleVariables[x][vVehicleScriptID] = CreateVehicle(vehicleVariables[x][vVehicleModelID], vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2], vehicleVariables[x][vVehicleRotation], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1], 60000);
6143 PutPlayerInVehicle(playerid, vehicleVariables[x][vVehicleScriptID], 0);
6144
6145 saveVehicle(x);
6146
6147 format(string, sizeof(string), "You have successfully changed vehicle %d to a %s.", x, VehicleNames[vehicleVariables[x][vVehicleModelID] - 400]);
6148 SendClientMessage(playerid, COLOR_WHITE, string);
6149 return 1;
6150 }
6151 }
6152 return 1;
6153}
6154
6155CMD:vmove(playerid, params[]) {
6156 if(P_DATA[playerid][pAdmin] < 4) return OnlyAdmin
6157 if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside the vehicle that you wish to move.");
6158
6159 new
6160 string[42];
6161
6162 for(new x = 0; x < MAX_VEHICLES; x++) {
6163 if(vehicleVariables[x][vVehicleScriptID] == GetPlayerVehicleID(playerid)) {
6164
6165 GetVehiclePos(x, vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2]);
6166 GetVehicleZAngle(x, vehicleVariables[x][vVehicleRotation]);
6167
6168 DestroyVehicle(vehicleVariables[x][vVehicleScriptID]);
6169 vehicleVariables[x][vVehicleScriptID] = CreateVehicle(vehicleVariables[x][vVehicleModelID], vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2], vehicleVariables[x][vVehicleRotation], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1], 60000);
6170 PutPlayerInVehicle(playerid, vehicleVariables[x][vVehicleScriptID], 0);
6171
6172 saveVehicle(x);
6173
6174 format(string, sizeof(string), "You have successfully moved vehicle %d.", x);
6175 SendClientMessage(playerid, COLOR_WHITE, string);
6176 return 1;
6177 }
6178 }
6179 return 1;
6180}
6181
6182CMD:ad(playerid, params[]) {
6183 if(!isnull(params)) {
6184 if(P_DATA[playerid][pPhoneNumber] != -1) {
6185 if(adTick == 0) {
6186 if(P_DATA[playerid][pMoney] >= 1000) {
6187 new
6188 adText[128],
6189 playerName[MAX_PLAYER_NAME],
6190 queryString[255];
6191
6192 mysql_real_escape_string(params, adText);
6193 format(queryString, sizeof(queryString), "INSERT INTO playerAdvertisements (playerID, advertisementText, Time2) VALUES('%d', '%s', '%d')", P_DATA[playerid][pSQL], adText, gettime());
6194 mysql_query(SQL, queryString);
6195
6196 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
6197 format(queryString, sizeof(queryString), "Advertisement: %s (by %s).", params, playerName);
6198 SendClientMessageToAll(COLOR_GREEN, queryString);
6199 P_DATA[playerid][pMoney] -= 1000;
6200 adTick = 60;
6201 }
6202 else SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for this.");
6203 }
6204 else {
6205 return SendClientMessage(playerid, COLOR_GREY, "You must wait 60 seconds to post a global advertisement.");
6206 }
6207 }
6208 else {
6209 return SendClientMessage(playerid, COLOR_GREY, "You don't have a phone, so you're unable to submit an advertisement.");
6210 }
6211 }
6212 else {
6213 return ShowSyntax(playerid, "/ad [advertisement text]");
6214 }
6215 return 1;
6216}
6217
6218CMD:tazer(playerid, params[]) {
6219
6220 new
6221 string[128],
6222 playerNames[2][MAX_PLAYER_NAME],
6223 target;
6224
6225 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] != 1) {
6226 SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
6227 return 1;
6228 }
6229 target = GetClosestPlayer(playerid);
6230 if(groupVariables[P_DATA[target][pGroup]][gGroupType] == 1) {
6231 SendClientMessage(playerid, COLOR_GREY, "You can't taze other law enforcement officers.");
6232 }
6233 else {
6234 if(IsPlayerInRangeOfPlayer(playerid, target, 7.5)) {
6235 if(P_DATA[target][pFreezeType] == 0 || P_DATA[target][pFreezeType] == 5) {
6236 if(!IsPlayerInAnyVehicle(target)) {
6237
6238 GetPlayerName(playerid, playerNames[0], MAX_PLAYER_NAME);
6239 GetPlayerName(target, playerNames[1], MAX_PLAYER_NAME);
6240
6241 TogglePlayerControllable(target, 0);
6242 P_DATA[target][pFreezeTime] = 15;
6243 P_DATA[target][pFreezeType] = 1;
6244 PlayerPlaySound(target, 1085, 0.0, 0.0, 0.0);
6245 GameTextForPlayer(target,"~n~~r~Tazed!",4000,4);
6246
6247 format(string, sizeof(string), "* %s fires their tazer at %s, stunning them.", playerNames[0], playerNames[1]);
6248 nearByMessage(playerid, COLOR_PURPLE, string);
6249 format(string, sizeof(string),"You have successfully stunned %s.", playerNames[1]);
6250 SendClientMessage(playerid, COLOR_NICESKY, string);
6251 PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
6252 ApplyAnimation(target,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
6253 }
6254 else SendClientMessage(playerid, COLOR_GREY, "You can't taze someone who is inside a vehicle.");
6255 }
6256 else SendClientMessage(playerid, COLOR_GREY, "That person has already been cuffed, stunned, or frozen.");
6257 }
6258 else SendClientMessage(playerid, COLOR_GREY, "Nobody is in range.");
6259 }
6260 return 1;
6261}
6262
6263CMD:eject(playerid, params[]) {
6264 new targetID;
6265 if(sscanf(params, "u", targetID))
6266 return ShowSyntax(playerid, "/eject [playerid]");
6267 if(GetPlayerState(playerid) == 2) {
6268 if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(targetID)) {
6269 new string[128];
6270 format(string, sizeof(string), "* %s has thrown %s out of their vehicle.", GetName(playerid), GetName(targetID));
6271 nearByMessage(playerid, COLOR_PURPLE, string);
6272 RemovePlayerFromVehicle(targetID);
6273 }
6274 else SendClientMessage(playerid, COLOR_GREY, "That person is not in your vehicle.");
6275 }
6276 else SendClientMessage(playerid, COLOR_GREY, "You're not driving a vehicle.");
6277 return 1;
6278}
6279
6280CMD:ticket(playerid, params[]) {
6281
6282 new
6283 targetID,
6284 price,
6285 string[96],
6286 playerName[2][MAX_PLAYER_NAME];
6287
6288 if(sscanf(params, "ud", targetID, price)) return ShowSyntax(playerid, "/ticket [playerid] [price]");
6289
6290 else if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1) {
6291 if(IsPlayerConnectedEx(targetID)) {
6292 if(playerid != targetID) {
6293 if(IsPlayerInRangeOfPlayer(playerid, targetID, 3.0)) {
6294 if(price >= 1 && price <= 100000) {
6295
6296 GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
6297 GetPlayerName(targetID, playerName[1], MAX_PLAYER_NAME);
6298
6299 format(string, sizeof(string), "* %s writes up a ticket, and hands it to %s.", playerName[0], playerName[1]);
6300 nearByMessage(playerid, COLOR_PURPLE, string);
6301
6302 format(string, sizeof(string), "You have issued %s a ticket costing $%d.", playerName[1], price);
6303 SendClientMessage(playerid, COLOR_WHITE, string);
6304
6305 format(string, sizeof(string), "%s has issued you a ticket costing $%d - /accept ticket to pay the fine.", playerName[0], price);
6306 SendClientMessage(targetID, COLOR_GENANNOUNCE, string);
6307
6308 SetPVarInt(targetID, "tP", price);
6309 SetPVarInt(targetID, "tID", playerid + 1);
6310 }
6311 else SendClientMessage(playerid, COLOR_GREY, "Invalid price specified (must be between $1 and $100,000).");
6312 }
6313 else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
6314 }
6315 else SendClientMessage(playerid, COLOR_GREY, "You can't ticket yourself.");
6316 }
6317 else SendClientMessage(playerid, COLOR_GREY, "The specified player is either not connected or has not authenticated.");
6318 }
6319 return 1;
6320}
6321
6322CMD:frisk(playerid, params[]) {
6323
6324 new
6325 targetID,
6326 string[128],
6327 playerNames[2][MAX_PLAYER_NAME],
6328 count;
6329
6330 if(sscanf(params, "u", targetID)) return ShowSyntax(playerid, "/frisk [playerid]");
6331
6332 else if(IsPlayerInRangeOfPlayer(playerid, targetID, 2.0)) {
6333 if(P_DATA[targetID][pFreezeType] == 2 || (GetPlayerSpecialAction(targetID) == SPECIAL_ACTION_HANDSUP && P_DATA[targetID][pFreezeType] == 0) || P_DATA[targetID][pFreezeType] == 4) {
6334
6335 GetPlayerName(playerid, playerNames[0], MAX_PLAYER_NAME);
6336 GetPlayerName(targetID, playerNames[1], MAX_PLAYER_NAME);
6337
6338 format(string, sizeof(string), "* %s has frisked %s.", playerNames[0], playerNames[1]);
6339 nearByMessage(playerid, COLOR_PURPLE, string);
6340
6341 SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------");
6342
6343 for(new x; x < 13; x++) { // Retrieve all weapons in slots, get their names, shove them into one string.
6344 if(P_DATA[targetID][pWeapons][x] > 0) {
6345 if(count == 0) format(string, sizeof(string), "* Weapons: %s", WeaponNames[P_DATA[targetID][pWeapons][x]]);
6346 else format(string, sizeof(string), "%s, %s", string, WeaponNames[P_DATA[targetID][pWeapons][x]]);
6347 count++;
6348 }
6349 }
6350 if(count >= 1) SendClientMessage(playerid, COLOR_GREY, string);
6351
6352 if(P_DATA[targetID][pMaterials] >= 1) {
6353 format(string, sizeof(string), "* Materials: %d", P_DATA[targetID][pMaterials]);
6354 SendClientMessage(playerid, COLOR_GREY, string);
6355 count++;
6356 }
6357 if(P_DATA[targetID][pPhoneNumber] != -1) {
6358 SendClientMessage(playerid, COLOR_GREY, "Phone");
6359 }
6360 if(count == 0) SendClientMessage(playerid, COLOR_GREY, "No items found.");
6361
6362 SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------");
6363 }
6364 else SendClientMessage(playerid, COLOR_GREY, "That person must first be subdued, or have their hands up.");
6365 }
6366 else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
6367 return 1;
6368}
6369
6370CMD:cuff(playerid, params[]) {
6371
6372 new
6373 string[128],
6374 playerName[2][MAX_PLAYER_NAME],
6375 target,
6376 Float:Pos[3];
6377
6378 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] != 1) return SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
6379
6380 else if(sscanf(params, "u", target)) return ShowSyntax(playerid, "/cuff [playerid]");
6381
6382 else if(target == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't cuff yourself.");
6383
6384 else {
6385 if(IsPlayerInRangeOfPlayer(playerid, target, 3.0)) {
6386 if(P_DATA[target][pFreezeType] == 5 || P_DATA[target][pFreezeType] == 1 || (GetPlayerSpecialAction(target) == SPECIAL_ACTION_HANDSUP && P_DATA[target][pFreezeType] == 0) || P_DATA[target][pFreezeType] == 4) { // CAN NEVAR BE EXPLOITED!1 Means admin-frozen people can't be exploited out with cuffs.
6387
6388 GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
6389 GetPlayerName(target, playerName[1], MAX_PLAYER_NAME);
6390
6391 TogglePlayerControllable(target, 0);
6392 P_DATA[target][pFreezeTime] = 900;
6393 P_DATA[target][pFreezeType] = 2;
6394 GameTextForPlayer(target,"~n~~r~Handcuffed!",4000,4);
6395
6396 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
6397
6398 format(string, sizeof(string), "* %s has handcuffed %s.", playerName[0], playerName[1]);
6399 nearByMessage(playerid, COLOR_PURPLE, string);
6400 format(string, sizeof(string),"You have handcuffed %s.", playerName[1]);
6401 SendClientMessage(playerid, COLOR_NICESKY, string);
6402
6403 PlayerPlaySoundEx(1145, Pos[0], Pos[1], Pos[2]);
6404 ApplyAnimation(target, "PED", "cower", 1, 1, 0, 0, 0, 0, 1);
6405 }
6406 else SendClientMessage(playerid, COLOR_GREY, "That person must first be subdued, or have their hands up.");
6407 }
6408 else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
6409 }
6410 return 1;
6411}
6412
6413CMD:freeze(playerid, params[]) {
6414
6415 if(P_DATA[playerid][pAdmin] >= 2) {
6416 new
6417 string[128],
6418 playerName[MAX_PLAYER_NAME],
6419 target;
6420
6421 if(sscanf(params, "u", target)) return ShowSyntax(playerid, "/freeze [playerid]");
6422
6423 else if(P_DATA[playerid][pAdmin] >= P_DATA[target][pAdmin]) {
6424
6425 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
6426
6427 switch(P_DATA[target][pFreezeType]) {
6428 case 3: {
6429
6430 P_DATA[target][pFreezeTime] = 0;
6431 P_DATA[target][pFreezeType] = 0;
6432 TogglePlayerControllable(target, 1);
6433
6434 format(string, sizeof(string), "You have been unfrozen by Administrator %s.", playerName);
6435 SendClientMessage(target, COLOR_WHITE, string);
6436
6437 GetPlayerName(target, playerName, MAX_PLAYER_NAME);
6438 format(string, sizeof(string), "You have unfrozen %s.", playerName);
6439 SendClientMessage(playerid, COLOR_WHITE, string);
6440 }
6441 default: {
6442
6443 TogglePlayerControllable(target, 0);
6444 P_DATA[target][pFreezeTime] = -1;
6445 P_DATA[target][pFreezeType] = 3;
6446
6447 format(string, sizeof(string), "You have been frozen by Administrator %s.", playerName);
6448 SendClientMessage(target, COLOR_WHITE, string);
6449
6450 GetPlayerName(target, playerName, MAX_PLAYER_NAME);
6451 format(string, sizeof(string), "You have frozen %s.", playerName);
6452 SendClientMessage(playerid, COLOR_WHITE, string);
6453 }
6454 }
6455 }
6456 else SendClientMessage(playerid, COLOR_GREY, "You can't freeze a higher level administrator.");
6457 }
6458 return 1;
6459}
6460
6461CMD:uncuff(playerid, params[]) {
6462
6463 new
6464 string[128],
6465 playerName[2][MAX_PLAYER_NAME],
6466 target;
6467
6468 if(sscanf(params, "u", target)) return ShowSyntax(playerid, "/uncuff [playerid]");
6469
6470 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] != 1) {
6471 SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
6472 }
6473
6474 else if(target == playerid) SendClientMessage(playerid, COLOR_GREY, "You can't uncuff yourself.");
6475
6476 else {
6477 if(IsPlayerInRangeOfPlayer(playerid, target, 4.0)) {
6478 if(P_DATA[target][pFreezeType] == 2) {
6479
6480 GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
6481 GetPlayerName(target, playerName[1], MAX_PLAYER_NAME);
6482
6483 P_DATA[target][pFreezeTime] = 0;
6484 P_DATA[target][pFreezeType] = 0;
6485
6486 TogglePlayerControllable(target, 1);
6487 PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
6488 ClearAnimations(target);
6489 ApplyAnimation(target, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
6490 GameTextForPlayer(target,"~n~~g~Uncuffed!",4000,4);
6491
6492 format(string, sizeof(string), "* %s has uncuffed %s.", playerName[0], playerName[1]);
6493 nearByMessage(playerid, COLOR_PURPLE, string);
6494 format(string, sizeof(string),"You have uncuffed %s.", playerName[1]);
6495 SendClientMessage(playerid, COLOR_NICESKY, string);
6496 PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
6497
6498 if(P_DATA[target][pDrag] != -1) {
6499 format(string, sizeof(string), "You have stopped dragging %s.", playerName[1]);
6500 SendClientMessage(playerid, COLOR_WHITE, string);
6501
6502 P_DATA[target][pDrag] = -1;
6503
6504 format(string, sizeof(string), "* %s has stopped dragging %s, releasing their grip.", playerName[0], playerName[1]);
6505
6506 return nearByMessage(playerid, COLOR_PURPLE, string);
6507 }
6508 }
6509 else SendClientMessage(playerid, COLOR_GREY, "That person is not cuffed.");
6510 }
6511 }
6512 return 1;
6513}
6514
6515CMD:deposit(playerid, params[]) {
6516
6517 new
6518 cash,
6519 string[128];
6520
6521 if(sscanf(params, "d", cash)) return ShowSyntax(playerid, "/deposit [amount]");
6522 else if(cash <= 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified.");
6523 else {
6524 if(IsPlayerInRangeOfPoint(playerid, 15.0, 2306.8481,-16.0682,26.7496) && GetPlayerVirtualWorld(playerid) == 2) {
6525 if(P_DATA[playerid][pMoney] < cash) SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for this transaction.");
6526 else if(cash >= 1) {
6527 P_DATA[playerid][pBankMoney] += cash;
6528 P_DATA[playerid][pMoney] -= cash;
6529 format(string, sizeof(string), "You have deposited $%d into your bank account. Your account balance is now $%d.", cash, P_DATA[playerid][pBankMoney]);
6530 SendClientMessage(playerid, COLOR_DCHAT, string);
6531 }
6532 else SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified.");
6533 }
6534 else {
6535 SendClientMessage(playerid, COLOR_GREY, "You're not at the bank.");
6536 }
6537 }
6538 return 1;
6539}
6540
6541CMD:wiretransfer(playerid, params[]) {
6542
6543 new
6544 cash,
6545 targetID,
6546 string[128],
6547 playerName[MAX_PLAYER_NAME];
6548
6549 if(sscanf(params, "ud", targetID, cash)) ShowSyntax(playerid, "/wiretransfer [playerid] [amount]");
6550 else if(cash <= 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified.");
6551 else if(IsPlayerInRangeOfPoint(playerid, 15.0, 2306.8481,-16.0682,26.7496) && GetPlayerVirtualWorld(playerid) == 2) {
6552 if(P_DATA[playerid][pPlayingHours] >= 10) {
6553 if(IsPlayerConnectedEx(targetID)) {
6554 if(P_DATA[playerid][pBankMoney] >= cash) {
6555 if(cash >= 1) {
6556
6557 P_DATA[playerid][pBankMoney] -= cash;
6558 P_DATA[targetID][pBankMoney] += cash;
6559
6560 GetPlayerName(targetID, playerName, MAX_PLAYER_NAME);
6561 format(string, sizeof(string), "You have transferred $%d into %s's account. Your account balance is now $%d.", cash, playerName, P_DATA[playerid][pBankMoney]);
6562 SendClientMessage(playerid, COLOR_DCHAT, string);
6563
6564 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
6565 format(string, sizeof(string), "%s has transferred $%d into your account. Your account balance is now $%d.", playerName, cash, P_DATA[playerid][pBankMoney]);
6566 SendClientMessage(targetID, COLOR_DCHAT, string);
6567 }
6568 else SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified.");
6569 }
6570 else SendClientMessage(playerid, COLOR_GREY, "Your account balance is insufficient for this transaction.");
6571 }
6572 else SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
6573 }
6574 else SendClientMessage(playerid, COLOR_GREY, "You must have at least ten playing hours to use this command.");
6575 }
6576 else SendClientMessage(playerid, COLOR_GREY, "You're not at the bank.");
6577 return 1;
6578}
6579
6580CMD:withdraw(playerid, params[]) {
6581
6582 new
6583 cash,
6584 string[128];
6585
6586 if(sscanf(params, "d", cash)) return ShowSyntax(playerid, "/withdraw [amount]");
6587 else if(cash <= 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified.");
6588 else {
6589 if(IsPlayerInRangeOfPoint(playerid, 15.0, 2306.8481,-16.0682,26.7496) && GetPlayerVirtualWorld(playerid) == 2) {
6590 if(P_DATA[playerid][pBankMoney] < cash) SendClientMessage(playerid, COLOR_GREY, "Your account balance is insufficient for this transaction.");
6591 else if(cash >= 1) {
6592 P_DATA[playerid][pMoney] += cash;
6593 P_DATA[playerid][pBankMoney] -= cash;
6594 format(string, sizeof(string), "You have withdrawn $%d from your bank account. Your account balance is now $%d.", cash, P_DATA[playerid][pBankMoney]);
6595 SendClientMessage(playerid, COLOR_DCHAT, string);
6596 }
6597 else SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified.");
6598 }
6599 else {
6600 SendClientMessage(playerid, COLOR_GREY, "You're not at the bank.");
6601 }
6602 }
6603 return 1;
6604}
6605CMD:up(playerid,params[]) {
6606 if(IsPlayerConnected(playerid)) {
6607 if (P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
6608 new Float:slx, Float:sly, Float:slz;
6609 GetPlayerPos(playerid, slx, sly, slz);
6610 SetPlayerPos(playerid, slx, sly, slz+5.0);
6611 }
6612 return 1;
6613}
6614CMD:down(playerid,params[]) {
6615 if(IsPlayerConnected(playerid)) {
6616 if (P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
6617 new Float:slx, Float:sly, Float:slz;
6618 GetPlayerPos(playerid, slx, sly, slz);
6619 SetPlayerPos(playerid, slx, sly, slz-5.0);
6620 }
6621 return 1;
6622}
6623CMD:setadmin(playerid, params[]) {
6624 if(IsPlayerConnected(playerid)) {
6625 if (P_DATA[playerid][pAdmin] < 6) return OnlyAdmin
6626 new id,adminlevel,string[200];
6627 if(sscanf(params, "ui",id,adminlevel)) return SendClientMessage(playerid, COLOR_GREY, "Sintaxa: {FFFFFF}//setadmin <Nume/ID> <Admin Level>");
6628 if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_WHITE, "Eroare: Acel player nu este conectat.");
6629 if(id != INVALID_PLAYER_ID)
6630 {
6631 P_DATA[id][pAdmin] = adminlevel;
6632 SCMF(id, COLOR_ADMCHAT, "You have been promoted to a level %d admin by %s.", adminlevel, GetName(playerid));
6633 SCMF(playerid, COLOR_ADMCHAT, "You have promoted %s to a level %d admin.", GetName(id),adminlevel);
6634 SCMF(playerid, COLOR_ADMCHAT, "You have promoted %s to a level %d admin.", GetName(id),adminlevel);
6635 format(string, sizeof(string), "AdmBot: Admin %s has set %s to a level %d admin.", GetName(playerid),GetName(id),adminlevel);
6636 submitToAdmins(string,COLOR_ADMCHAT);
6637 new wakaname[25];
6638 GetPlayerName(id,wakaname,25);
6639 new str[256];
6640 mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Admin`='%d' WHERE `name`='%s'",P_DATA[id][pAdmin],P_DATA[id][pNormalName]),mysql_tquery(SQL,str,"","");
6641 if(adminlevel > 0) Iter_Add(Admins, playerid);
6642 if(adminlevel == 0) Iter_Remove(Admins, playerid);
6643 }
6644 }
6645 return 1;
6646}
6647CMD:sethelper(playerid, params[]) {
6648 if(IsPlayerConnected(playerid)) {
6649 if (P_DATA[playerid][pAdmin] < 6) return OnlyAdmin
6650 new id,helperlevel,string[200];
6651 if(sscanf(params, "ui",id,helperlevel)) return SendClientMessage(playerid, COLOR_GREY, "Sintaxa: {FFFFFF}//setadmin <Nume/ID> <Admin Level>");
6652 if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_WHITE, "Eroare: Acel player nu este conectat.");
6653 if(id != INVALID_PLAYER_ID)
6654 {
6655 P_DATA[id][pHelper] = helperlevel;
6656 SCMF(id, COLOR_ADMCHAT, "You have been promoted to a level %d helper by %s.", helperlevel, GetName(playerid));
6657 SCMF(playerid, COLOR_ADMCHAT, "You have promoted %s to a level %d helper.", GetName(id),helperlevel);
6658 SCMF(playerid, COLOR_ADMCHAT, "You have promoted %s to a level %d helper.", GetName(id),helperlevel);
6659 format(string, sizeof(string), "AdmBot: Admin %s has set %s to a level %d helper.", GetName(playerid),GetName(id),helperlevel);
6660 submitToAdmins(string,COLOR_ADMCHAT);
6661 new wakaname[25];
6662 GetPlayerName(id,wakaname,25);
6663 new str[256];
6664 mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Admin`='%d' WHERE `name`='%s'",P_DATA[id][pHelper],P_DATA[id][pNormalName]),mysql_tquery(SQL,str,"","");
6665 if(helperlevel > 0) Iter_Add(Helpers, playerid);
6666 if(helperlevel == 0) Iter_Remove(Helpers, playerid);
6667 }
6668 }
6669 return 1;
6670}
6671CMD:acolor(playerid, params[]) {
6672 if(P_DATA[playerid][pHelper] >= 1 || P_DATA[playerid][pAdmin] >= 1) {
6673 ShowPlayerDialog(playerid, DIALOG_ACOLOR, DIALOG_STYLE_LIST, "Nickname color", "White\n{FF0000}Cool Red\n{660000}Dark Red\n{CC3300}Light Red", "Choose", "Cancel");
6674 }
6675 return 1;
6676}
6677CMD:flip(playerid, params[]) {
6678 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
6679 if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle.");
6680 new Float:angle, currentveh = GetPlayerVehicleID(playerid);
6681 GetVehicleZAngle(currentveh, angle);
6682 SetVehicleZAngle(currentveh, angle);
6683 SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been flipped back over.");
6684 return 1;
6685}
6686CMD:fv(playerid, params[]) {
6687 if(IsPlayerConnected(playerid)) {
6688 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
6689 if(IsPlayerInAnyVehicle(playerid)) RepairVehicle(GetPlayerVehicleID(playerid)),SendClientMessage(playerid, COLOR_WHITE, "Car was repaired successfully.");
6690 }
6691 return 1;
6692}
6693CMD:business(playerid, params[]) {
6694
6695 new
6696 business = getPlayerBusinessID(playerid);
6697
6698 if(business >= 1) {
6699 if(P_DATA[playerid][pCheckpoint] >= 1) {
6700 new string[96];
6701 format(string, sizeof(string), "You already have an active checkpoint (%s), reach it first, or /killcheckpoint.", getPlayerCheckpointReason(playerid));
6702 return SendClientMessage(playerid, COLOR_GREY,string);
6703 }
6704 SetPlayerCheckpoint(playerid, businessVariables[business][bExteriorPos][0], businessVariables[business][bExteriorPos][1], businessVariables[business][bExteriorPos][2], 5.0);
6705 SendClientMessage(playerid, COLOR_WHITE, "A checkpoint has been set to your business.");
6706 P_DATA[playerid][pCheckpoint] = 6;
6707 }
6708 else SendClientMessage(playerid, COLOR_GREY, "You don't own a business.");
6709 return 1;
6710}
6711CMD:home(playerid, params[]) {
6712
6713 new
6714 house = getPlayerHouseID(playerid);
6715
6716 if(house >= 1) {
6717 if(P_DATA[playerid][pCheckpoint] >= 1) {
6718 new string[96];
6719 format(string, sizeof(string), "You already have an active checkpoint (%s), reach it first, or /killcheckpoint.", getPlayerCheckpointReason(playerid));
6720 return SendClientMessage(playerid, COLOR_GREY,string);
6721 }
6722 SetPlayerCheckpoint(playerid, houseVariables[house][hHouseExteriorPos][0], houseVariables[house][hHouseExteriorPos][1], houseVariables[house][hHouseExteriorPos][2], 5.0);
6723 SendClientMessage(playerid, COLOR_WHITE, "A checkpoint has been set to your house.");
6724 P_DATA[playerid][pCheckpoint] = 6;
6725 }
6726 else SendClientMessage(playerid, COLOR_GREY, "You don't own a house.");
6727 return 1;
6728}
6729CMD:kill(playerid, params[]) {
6730 if(P_DATA[playerid][pEvent] != 0) {
6731 return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while in an event.");
6732 }
6733 else if(P_DATA[playerid][pFreezeType] != 0) {
6734 return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while cuffed, tazed, or frozen.");
6735 }
6736 else {
6737 return SetPlayerHealth(playerid, -1);
6738 }
6739}
6740
6741CMD:untie(playerid, params[]) {
6742 new
6743 targetID;
6744
6745 if(sscanf(params, "u", targetID)) { // Using sscanf instead of isnull because we're handling a playerid/name.
6746 return ShowSyntax(playerid, "/untie [playerid]");
6747 }
6748 else {
6749 if(targetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
6750 if(targetID == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't untie yourself.");
6751 if(IsPlayerInRangeOfPlayer(playerid, targetID, 2.0)) {
6752
6753 new
6754 playerName[2][MAX_PLAYER_NAME],
6755 msgSz[128]; // Need to start using 'sz', I don't know why... Must be a fetish of some sort. LIKE YOUR CRAZY KANGAROO COMMENTS, BRIAN
6756
6757 GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
6758 GetPlayerName(targetID, playerName[1], MAX_PLAYER_NAME);
6759
6760 if(random(6) < 3) {
6761 if(P_DATA[targetID][pFreezeType] != 4) {
6762 return SendClientMessage(playerid, COLOR_GREY, "This player is not tied.");
6763 }
6764 else {
6765
6766 format(msgSz, sizeof(msgSz), "* %s has attempted to untie %s and has succeeded.", playerName[0], playerName[1]);
6767 nearByMessage(playerid, COLOR_PURPLE, msgSz);
6768
6769 P_DATA[targetID][pFreezeType] = 0;
6770 P_DATA[targetID][pFreezeTime] = 0;
6771
6772 TogglePlayerControllable(targetID, true);
6773
6774 return SendClientMessage(playerid, COLOR_WHITE, "Attempt successful!");
6775 }
6776 }
6777 else {
6778 format(msgSz, sizeof(msgSz), "* %s has attempted to untie %s and has failed.", playerName[0], playerName[1]);
6779 nearByMessage(playerid, COLOR_PURPLE, msgSz);
6780
6781 return SendClientMessage(playerid, COLOR_GREY, "Attempt failed!");
6782 }
6783 }
6784 else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
6785 }
6786 return 1;
6787}
6788
6789CMD:tie(playerid, params[]) {
6790 new
6791 targetID;
6792
6793 if(sscanf(params, "u", targetID)) { // Using sscanf instead of isnull because we're handling a playerid/name.
6794 return ShowSyntax(playerid, "/tie [playerid]");
6795 }
6796 else {
6797 if(targetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
6798 if(targetID == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't tie yourself.");
6799 if(IsPlayerInRangeOfPlayer(playerid, targetID, 2.0)) {
6800
6801 new
6802 playerName[2][MAX_PLAYER_NAME],
6803 msgSz[128]; // Need to start using 'sz', I don't know why... Must be a fetish of some sort. LIKE YOUR CRAZY KANGAROO COMMENTS, BRIAN
6804
6805 GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
6806 GetPlayerName(targetID, playerName[1], MAX_PLAYER_NAME);
6807
6808 if(P_DATA[playerid][pRope] >= 1) {
6809 if(random(6) < 3) {
6810 if(P_DATA[targetID][pFreezeType] > 0 && P_DATA[targetID][pFreezeType] < 5) {
6811 return SendClientMessage(playerid, COLOR_GREY, "Attempt failed: player is already frozen.");
6812 }
6813 else {
6814 P_DATA[playerid][pRope]--;
6815
6816 format(msgSz, sizeof(msgSz), "* %s has attempted to tie %s and has succeeded.", playerName[0], playerName[1]);
6817 nearByMessage(playerid, COLOR_PURPLE, msgSz);
6818
6819 TogglePlayerControllable(targetID, false);
6820
6821 P_DATA[targetID][pFreezeType] = 4;
6822 P_DATA[targetID][pFreezeTime] = 180;
6823
6824 return SendClientMessage(playerid, COLOR_WHITE, "Attempt successful!");
6825 }
6826 }
6827 else {
6828 format(msgSz, sizeof(msgSz), "* %s has attempted to tie %s and has failed.", playerName[0], playerName[1]);
6829 nearByMessage(playerid, COLOR_PURPLE, msgSz);
6830
6831 return SendClientMessage(playerid, COLOR_GREY, "Attempt failed!");
6832 }
6833 }
6834 else return SendClientMessage(playerid, COLOR_GREY, "You don't have any rope.");
6835 }
6836 else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
6837 }
6838 return 1;
6839}
6840CMD:aduty(playerid, params[]) {
6841 if(IsPlayerConnected(playerid)) {
6842 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
6843 new string[128];
6844 switch(P_DATA[playerid][pAdminDuty]) {
6845 case 0: {
6846 P_DATA[playerid][pAdminDuty] = 1,SetPlayerHealth(playerid, 500000.0),SetPlayerArmour(playerid, 500000.0);
6847 format(string, sizeof(string), "Notice: {FFFFFF}Admin %s is now on administrative duty.", GetName(playerid));
6848 return 1;
6849 }
6850 case 1: {
6851 P_DATA[playerid][pAdminDuty] = 0,SetPlayerArmour(playerid, 0),SetPlayerHealth(playerid, 100);
6852 format(string, sizeof(string), "Notice: {FFFFFF}Admin %s is now off administrative duty.", GetName(playerid));
6853 }
6854 }
6855 submitToAdmins(string, COLOR_HOTORANGE);
6856 }
6857 return 1;
6858}
6859CMD:admins(playerid, params[]) {
6860 if(IsPlayerConnected(playerid)) {
6861 SCM(playerid, COLOR_CYAN, "------------------------Admins Online----------------------------------");
6862 foreach(new i : Admins) {
6863 if(P_DATA[i][pAdmin] >= 1 && P_DATA[i][pAdmin] <= 6) SCMF(playerid, COLOR_WHITE, "(%d) %s - admin level %d", i, GetName(i), P_DATA[i][pAdmin]);
6864 }
6865 SCM(playerid, COLOR_CYAN, "-----------------------------------------------------------------------");
6866 SCM(playerid, COLOR_WHITE, "Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
6867 SCM(playerid, COLOR_CYAN, "-----------------------------------------------------------------------");
6868 }
6869 return 1;
6870}
6871CMD:helpers(playerid, parmas[]) {
6872 if(IsPlayerConnected(playerid)) {
6873 SCM(playerid, COLOR_CYAN, "------------------------Helpers Online----------------------------------");
6874 foreach(new i : Helpers) {
6875 if(P_DATA[i][pHelper] >= 1 && P_DATA[i][pHelper] <= 6) SCMF(playerid, COLOR_WHITE, "(%d) %s - helper level %d", i, GetName(i), P_DATA[i][pHelper]);
6876 }
6877 SCM(playerid, COLOR_CYAN, "-----------------------------------------------------------------------");
6878 SCM(playerid, COLOR_WHITE, "Pentru intrebari legate de joc poti folosi /n.");
6879 SCM(playerid, COLOR_CYAN, "-----------------------------------------------------------------------");
6880 }
6881 return 1;
6882}
6883CMD:give(playerid, params[]) {
6884 new
6885 giveSz[12],
6886 amount,
6887 targetID;
6888
6889 if(sscanf(params, "us[32]d", targetID, giveSz, amount)) {
6890 ShowSyntax(playerid, "/give [playerid] [item] [amount]");
6891 return SendClientMessage(playerid, COLOR_GREY, "Items: Materials");
6892 }
6893 else {
6894 if(targetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
6895 if(!IsPlayerInRangeOfPlayer(playerid, targetID, 5.0)) return SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
6896
6897 if(strcmp(giveSz, "materials", true) == 0) {
6898 new
6899 playerName[2][MAX_PLAYER_NAME],
6900 msgSz[128];
6901
6902 GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
6903 GetPlayerName(targetID, playerName[1], MAX_PLAYER_NAME);
6904
6905 if(P_DATA[playerid][pMaterials] >= amount) {
6906 if(amount < 1) return 1;
6907
6908 P_DATA[playerid][pMaterials] -= amount;
6909 P_DATA[targetID][pMaterials] += amount;
6910
6911 format(msgSz, sizeof(msgSz), "You have given %d materials to %s.", amount, playerName[1]);
6912 SendClientMessage(playerid, COLOR_WHITE, msgSz);
6913
6914 format(msgSz, sizeof(msgSz), "%s has given you %d materials.", playerName[0], amount);
6915 SendClientMessage(targetID, COLOR_WHITE, msgSz);
6916
6917 format(msgSz, sizeof(msgSz), "* %s has given %d materials to %s.", playerName[0], amount, playerName[1]);
6918 nearByMessage(playerid, COLOR_PURPLE, msgSz);
6919 }
6920 else {
6921 format(msgSz, sizeof(msgSz), "You don't have enough materials to complete this trade. You need %d more materials.", P_DATA[playerid][pMaterials]-amount);
6922 SendClientMessage(playerid, COLOR_WHITE, msgSz);
6923 }
6924 }
6925 }
6926 return 1;
6927}
6928
6929CMD:giveweapon(playerid, params[]) {
6930 new
6931 string[128],
6932 id,
6933 weapon,
6934 playerName[MAX_PLAYER_NAME];
6935
6936 if(sscanf(params, "u", id)) {
6937
6938 ShowSyntax(playerid, "/giveweapon [playerid]");
6939 }
6940 else if(P_DATA[playerid][pFreezeType] == 0) {
6941 if(IsPlayerConnectedEx(id)) {
6942 if(IsPlayerInRangeOfPlayer(playerid, id, 4.0) && !IsPlayerInAnyVehicle(playerid)) {
6943
6944 weapon = GetPlayerWeapon(playerid);
6945
6946 switch(weapon) {
6947 case 16, 18, 35, 36, 37, 38, 39, 40, 44, 45, 46, 0: SendClientMessage(playerid, COLOR_GREY, "Invalid weapon.");
6948 default: {
6949
6950 GetPlayerName(id, playerName, MAX_PLAYER_NAME);
6951 format(string, sizeof(string), "You have offered to give %s your %s.", playerName, WeaponNames[weapon]);
6952 SendClientMessage(playerid, COLOR_WHITE, string);
6953
6954 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
6955 format(string, sizeof(string), "%s has offered to give you their %s - type /accept weapon to receive it.", playerName, WeaponNames[weapon]);
6956 SendClientMessage(id, COLOR_NICESKY, string);
6957
6958 SetPVarInt(id,"gunID",playerid);
6959 SetPVarInt(playerid,"gun",weapon);
6960 SetPVarInt(playerid,"slot",GetWeaponSlot(weapon));
6961 }
6962 }
6963 }
6964 else SendClientMessage(playerid, COLOR_GREY, "You're too far away or in a vehicle.");
6965 }
6966 else SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
6967 }
6968 else SendClientMessage(playerid, COLOR_GREY, "You can't do this while cuffed, tazed, or frozen.");
6969 return 1;
6970}
6971
6972CMD:givearmour(playerid, params[]) {
6973 new
6974 string[128],
6975 id,
6976 playerName[MAX_PLAYER_NAME];
6977
6978 if(sscanf(params, "u", id)) {
6979
6980 ShowSyntax(playerid, "/givearmour [playerid]");
6981 }
6982 else if(P_DATA[playerid][pFreezeType] == 0) {
6983 if(IsPlayerConnectedEx(id)) {
6984 if(IsPlayerInRangeOfPlayer(playerid, id, 4.0)) {
6985
6986 new
6987 Float:aoaoao;
6988
6989 GetPlayerArmour(playerid, aoaoao);
6990
6991 if(aoaoao > 0) {
6992
6993 GetPlayerName(id, playerName, MAX_PLAYER_NAME);
6994 format(string, sizeof(string), "You have offered to give %s your kevlar vest (%.1f percent).", playerName, aoaoao);
6995 SendClientMessage(playerid, COLOR_WHITE, string);
6996
6997 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
6998 format(string, sizeof(string), "%s has offered to give you their kevlar vest (%.1f percent) - type /accept armour to receive it.", playerName, aoaoao);
6999 SendClientMessage(id, COLOR_NICESKY, string);
7000
7001 SetPVarInt(id, "aID", playerid + 1);
7002 }
7003 else SendClientMessage(playerid, COLOR_GREY, "You have no armour to give.");
7004 }
7005 else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
7006 }
7007 else SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
7008 }
7009 else SendClientMessage(playerid, COLOR_GREY, "You can't do this while cuffed, tazed, or frozen.");
7010 return 1;
7011}
7012
7013CMD:addnos(playerid, params[]) {
7014 if(IsPlayerConnected(playerid)) {
7015 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
7016 if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_WHITE, "Trebuie sa fii intr-o masina pentru a putea folosi aceasta comanda.");
7017 AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
7018 }
7019 return 1;
7020}
7021CMD:seenewbie(playerid, params[]) {
7022 if(P_DATA[playerid][pNewbieEnabled] == 1) {
7023 P_DATA[playerid][pNewbieEnabled] = 0;
7024 SendClientMessage(playerid, COLOR_WHITE, "You will no longer see newbie chat.");
7025 }
7026 else {
7027 P_DATA[playerid][pNewbieEnabled] = 1;
7028 SendClientMessage(playerid, COLOR_WHITE, "You will now see newbie chat.");
7029 }
7030 return 1;
7031}
7032CMD:getmats(playerid, params[]) {
7033 if(jobVariables[P_DATA[playerid][pJob]][jJobType] != 1) return 1;
7034
7035 if(IsPlayerInRangeOfPoint(playerid, 5, 1423.9871, -1319.2954, 13.5547)) {
7036 if(P_DATA[playerid][pCheckpoint] == 0) {
7037 if(P_DATA[playerid][pMoney] >= 1000) {
7038 SetPlayerCheckpoint(playerid, 2166.6870, -2272.5073, 13.3623, 10);
7039 SendClientMessage(playerid, COLOR_WHITE, "Reach the checkpoint to collect your materials.");
7040 P_DATA[playerid][pCheckpoint] = 2;
7041 P_DATA[playerid][pMoney] -= 1000;
7042 P_DATA[playerid][pMatrunTime] = 1;
7043 }
7044 else {
7045 return SendClientMessage(playerid, COLOR_GREY, "You need to pay $1000 to collect materials.");
7046 }
7047 }
7048 else {
7049 new
7050 messageString[90];
7051
7052 format(messageString, sizeof(messageString), "You already have an active checkpoint (%s), reach it first, or /killcheckpoint.", getPlayerCheckpointReason(playerid));
7053 SendClientMessage(playerid, COLOR_WHITE, messageString);
7054 }
7055 }
7056
7057 return 1;
7058}
7059
7060CMD:dropcar(playerid, params[]) {
7061 if(P_DATA[playerid][pCheckpoint] >= 1) {
7062 new
7063 messageString[90];
7064
7065 format(messageString, sizeof(messageString), "You already have an active checkpoint (%s), reach it first, or /killcheckpoint.", getPlayerCheckpointReason(playerid));
7066 SendClientMessage(playerid, COLOR_WHITE, messageString);
7067 }
7068 else {
7069 if(P_DATA[playerid][pDropCarTimeout] >= 1) return SendClientMessage(playerid, COLOR_GREY, "You can't drop a vehicle as you still have time to wait. Check /time.");
7070 P_DATA[playerid][pCheckpoint] = 3;
7071 SendClientMessage(playerid, COLOR_WHITE, "Reach the checkpoint to drop your vehicle off at the crane.");
7072 SetPlayerCheckpoint(playerid, 2699.2781, -2225.4299, 13.5501, 10);
7073 }
7074 return 1;
7075}
7076
7077CMD:newbie(playerid, params[]) {
7078
7079 if(P_DATA[playerid][pNewbieTimeout] > 0 && P_DATA[playerid][pAdmin] < 1) {
7080 SendClientMessage(playerid,COLOR_GREY, "You must wait until you can speak again in the newbie chat channel.");
7081 return 1;
7082 }
7083 if(!isnull(params)) {
7084 new
7085 playerName[MAX_PLAYER_NAME],
7086 szMessage[128];
7087
7088 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
7089
7090 if(P_DATA[playerid][pAdmin] > 0 && P_DATA[playerid][pAdminDuty] != 0) {
7091 format(szMessage, sizeof(szMessage), "** Admin %s: %s", playerName, params);
7092 }
7093 else if(P_DATA[playerid][pHelper] >= 1 && P_DATA[playerid][pHelperDuty] >= 1) {
7094 format(szMessage, sizeof(szMessage), "** Helper %s: %s", playerName, params);
7095 P_DATA[playerid][pNewbieTimeout] = 5;
7096 }
7097 else if(P_DATA[playerid][pAdmin] > 0 && P_DATA[playerid][pAdminDuty] == 0) {
7098 format(szMessage, sizeof(szMessage), "** Player %s: %s", playerName, params);
7099 }
7100 else if(P_DATA[playerid][pPlayingHours] >= 100) {
7101 format(szMessage, sizeof(szMessage), "** Player %s: %s", playerName, params);
7102 P_DATA[playerid][pNewbieTimeout] = 30;
7103 }
7104 else {
7105 format(szMessage, sizeof(szMessage), "** Newbie %s: %s", playerName, params);
7106 P_DATA[playerid][pNewbieTimeout] = 30;
7107 }
7108 foreach(new x : Player) {
7109 if(P_DATA[x][pStatus] >= 1 && P_DATA[x][pNewbieEnabled] == 1) {
7110 SendClientMessage(x, COLOR_NEWBIE, szMessage);
7111 }
7112 }
7113 }
7114 else {
7115 return ShowSyntax(playerid, "/(n)ewbie [question]");
7116 }
7117 return 1;
7118}
7119
7120CMD:listassets(playerid, params[]) {
7121 if(P_DATA[playerid][pAdmin] >= 5) {
7122
7123 new
7124 string[128];
7125
7126 for(new x = 0; x < MAX_ASSETS; x++) {
7127 if(strlen(assetVariables[x][aAssetName]) >= 1) {
7128 format(string, sizeof(string), "Asset Name: %s | Asset ID: %d | Value: %d", assetVariables[x][aAssetName], x, assetVariables[x][aAssetValue]);
7129 SendClientMessage(playerid, COLOR_WHITE, string);
7130 }
7131 }
7132 }
7133 return 1;
7134}
7135
7136CMD:listmygroup(playerid, params[]) {
7137 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 4) {
7138
7139 new
7140 string[128];
7141
7142 SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------");
7143
7144 foreach(new i : Player) {
7145 if(IsPlayerConnectedEx(i) && P_DATA[i][pGroup] == P_DATA[playerid][pGroup] && P_DATA[i][pAdminDuty] < 1) {
7146
7147 switch(P_DATA[i][pGroupRank]) {
7148
7149 case 1: format(string, sizeof(string), "* (%d) %s %s", P_DATA[i][pGroupRank], groupVariables[P_DATA[i][pGroup]][gGroupRankName1], P_DATA[i][pNormalName]);
7150 case 2: format(string, sizeof(string), "* (%d) %s %s", P_DATA[i][pGroupRank], groupVariables[P_DATA[i][pGroup]][gGroupRankName2], P_DATA[i][pNormalName]);
7151 case 3: format(string, sizeof(string), "* (%d) %s %s", P_DATA[i][pGroupRank], groupVariables[P_DATA[i][pGroup]][gGroupRankName3], P_DATA[i][pNormalName]);
7152 case 4: format(string, sizeof(string), "* (%d) %s %s", P_DATA[i][pGroupRank], groupVariables[P_DATA[i][pGroup]][gGroupRankName4], P_DATA[i][pNormalName]);
7153 case 5: format(string, sizeof(string), "* (%d) %s %s", P_DATA[i][pGroupRank], groupVariables[P_DATA[i][pGroup]][gGroupRankName5], P_DATA[i][pNormalName]);
7154 case 6: format(string, sizeof(string), "* (%d) %s %s", P_DATA[i][pGroupRank], groupVariables[P_DATA[i][pGroup]][gGroupRankName6], P_DATA[i][pNormalName]);
7155
7156 }
7157 SendClientMessage(playerid, COLOR_WHITE, string);
7158 }
7159 }
7160 SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------");
7161 }
7162 return 1;
7163}
7164
7165CMD:n(playerid, params[]) {
7166 return cmd_newbie(playerid, params);
7167}
7168
7169CMD:set(playerid, params[]) {
7170 if(P_DATA[playerid][pAdmin] >= 3) {
7171 new
7172 item[32],
7173 messageString[128],
7174 userID,
7175 playerName[MAX_PLAYER_NAME],
7176 amount;
7177
7178 if(sscanf(params, "us[32]d", userID, item, amount)) {
7179 ShowSyntax(playerid, "/set [playerid] [item] [amount]");
7180 SendClientMessage(playerid, COLOR_GREY, "Items: Health, Armour, Money, BankMoney, Skin, Interior, VirtualWorld, Job, JobSkill1, JobSkill2,");
7181 SendClientMessage(playerid, COLOR_GREY, "Phone, Materials, Group, GroupRank, Age, Gender");
7182 }
7183 else if(IsPlayerConnectedEx(userID)) {
7184 if(P_DATA[playerid][pAdmin] >= P_DATA[userID][pAdmin]) {
7185 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
7186
7187 if(strcmp(item, "health", true) == 0) {
7188 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s health to %d.", playerName, userID, amount);
7189 SendClientMessage(playerid, COLOR_WHITE, messageString);
7190 SetPlayerHealth(userID, amount);
7191 }
7192 else if(strcmp(item, "jobskill2", true) == 0) {
7193 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s JobSkill2 to %d.", playerName, userID, amount);
7194 SendClientMessage(playerid, COLOR_WHITE, messageString);
7195 P_DATA[userID][pJobSkill][1] = amount;
7196 }
7197 else if(strcmp(item, "jobskill1", true) == 0) {
7198 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s JobSkill1 to %d.", playerName, userID, amount);
7199 SendClientMessage(playerid, COLOR_WHITE, messageString);
7200 P_DATA[userID][pJobSkill][0] = amount;
7201 }
7202 else if(strcmp(item, "virtualworld", true) == 0) {
7203 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s virtual world to %d.", playerName, userID, amount);
7204 SendClientMessage(playerid, COLOR_WHITE, messageString);
7205 SetPlayerVirtualWorld(userID, amount);
7206 P_DATA[userID][pVirtualWorld] = amount;
7207 }
7208 else if(strcmp(item, "interior", true) == 0) {
7209 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s interior to %d.", playerName, userID, amount);
7210 SendClientMessage(playerid, COLOR_WHITE, messageString);
7211 SetPlayerInterior(userID, amount);
7212 P_DATA[userID][pInterior] = amount;
7213 }
7214 else if(strcmp(item, "job", true) == 0) {
7215 if(amount >= 0 && amount <= MAX_JOBS) {
7216 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s job to %d.", playerName, userID, amount);
7217 SendClientMessage(playerid, COLOR_WHITE, messageString);
7218 P_DATA[userID][pJob] = amount;
7219 P_DATA[userID][pJobDelay] = 0;
7220 }
7221 else SendClientMessage(playerid, COLOR_GREY, "Invalid job specified.");
7222 }
7223 else if(strcmp(item, "armour", true) == 0) {
7224 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s armour to %d.", playerName, userID, amount);
7225 SendClientMessage(playerid, COLOR_WHITE, messageString);
7226 SetPlayerArmour(userID, amount);
7227 }
7228 else if(strcmp(item, "bankmoney", true) == 0) {
7229 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s bank balance to %d.", playerName, userID, amount);
7230 SendClientMessage(playerid, COLOR_WHITE, messageString);
7231 P_DATA[userID][pBankMoney] = amount;
7232 }
7233 else if(strcmp(item, "money", true) == 0) {
7234 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s money to %d.", playerName, userID, amount);
7235 SendClientMessage(playerid, COLOR_WHITE, messageString);
7236 P_DATA[userID][pMoney] = amount;
7237 }
7238 else if(strcmp(item, "materials", true) == 0) {
7239 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s materials to %d.", playerName, userID, amount);
7240 SendClientMessage(playerid, COLOR_WHITE, messageString);
7241 P_DATA[userID][pMaterials] = amount;
7242 }
7243 else if(strcmp(item, "skin", true) == 0) {
7244 if(IsValidSkin(amount)) {
7245 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s skin to %d.", playerName, userID, amount);
7246 SendClientMessage(playerid, COLOR_WHITE, messageString);
7247 SetPlayerSkin(userID, amount);
7248 if(P_DATA[userID][pEvent] == 1) SendClientMessage(playerid, COLOR_WHITE, "As this player is participating in an event, their original skin will be restored once it has ended.");
7249 else P_DATA[userID][pSkin] = amount;
7250 }
7251 else SendClientMessage(playerid, COLOR_GREY, "Invalid skin specified.");
7252 }
7253 else if(strcmp(item, "phone", true) == 0) {
7254 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s phone number to %d.", playerName, userID, amount);
7255 SendClientMessage(playerid, COLOR_WHITE, messageString);
7256 P_DATA[userID][pPhoneNumber] = amount;
7257 }
7258 else if(strcmp(item, "group", true) == 0) {
7259 if(amount >= 0 && amount <= MAX_GROUPS) {
7260
7261 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s group to %d.", playerName, userID, amount);
7262 SendClientMessage(playerid, COLOR_WHITE, messageString);
7263
7264 format(messageString, sizeof(messageString), "%s has left the group (admin-set).", playerName);
7265 SendToGroup(P_DATA[userID][pGroup], COLOR_GENANNOUNCE, messageString);
7266
7267 P_DATA[userID][pGroup] = amount;
7268
7269 format(messageString, sizeof(messageString), "%s has joined the group (admin-set).", playerName);
7270 SendToGroup(P_DATA[userID][pGroup], COLOR_GENANNOUNCE, messageString);
7271 }
7272 else SendClientMessage(playerid, COLOR_GREY, "Invalid group specified.");
7273 }
7274 else if(strcmp(item, "grouprank", true) == 0) {
7275 if(amount >= 1 && amount <= 6) {
7276 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s group rank to %d.", playerName, userID, amount);
7277 SendClientMessage(playerid, COLOR_WHITE, messageString);
7278 P_DATA[userID][pGroupRank] = amount;
7279 }
7280 else SendClientMessage(playerid, COLOR_GREY, "Invalid rank specified.");
7281 }
7282 else if(strcmp(item, "age", true) == 0) {
7283 if(amount >= 16 && amount <= 122) {
7284
7285 new
7286 dates[3];
7287
7288 getdate(dates[0], dates[1], dates[2]);
7289 P_DATA[userID][pAge] = dates[0] - amount;
7290
7291 format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s age to %d (birth year %d).", playerName, userID, amount, P_DATA[userID][pAge]);
7292 SendClientMessage(playerid, COLOR_WHITE, messageString);
7293 }
7294 else SendClientMessage(playerid, COLOR_GREY, "Invalid age specified (must be between 16 and 122 years old).");
7295 }
7296 else if(strcmp(item, "gender", true) == 0) {
7297 if(amount >= 1 && amount <= 2) {
7298
7299 P_DATA[userID][pGender] = amount;
7300
7301 switch(P_DATA[userID][pGender]) {
7302 case 1: format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s gender to male.", playerName, userID);
7303 case 2: format(messageString, sizeof(messageString), "You have set %s (ID: %d)'s gender to female.", playerName, userID);
7304 }
7305 SendClientMessage(playerid, COLOR_WHITE, messageString);
7306 }
7307 else SendClientMessage(playerid, COLOR_GREY, "Invalid gender specified; must be 1 (male) or 2 (female).");
7308 }
7309 }
7310 else SendClientMessage(playerid, COLOR_GREY, "You can't set a higher level administrator's statistics.");
7311 }
7312 else SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
7313 }
7314 return 1;
7315}
7316
7317CMD:gmotd(playerid, params[]) {
7318 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 5) {
7319 if(!isnull(params)) {
7320 new
7321 safeString[128],
7322 playerName[MAX_PLAYER_NAME];
7323
7324 format(safeString, sizeof(safeString), "You have changed the group MOTD to %s.", params);
7325 SendClientMessage(playerid, COLOR_WHITE, safeString);
7326
7327 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
7328 format(safeString, sizeof(safeString), "%s has changed the group MOTD to '%s'.", playerName, params);
7329 SendToGroup(P_DATA[playerid][pGroup], COLOR_GENANNOUNCE, safeString);
7330
7331 mysql_real_escape_string(params, safeString);
7332
7333 strcpy(groupVariables[P_DATA[playerid][pGroup]][gGroupMOTD], safeString, 128);
7334 }
7335 else {
7336 return ShowSyntax(playerid, "/gmotd [text]");
7337 }
7338 }
7339 return 1;
7340}
7341
7342CMD:gsafepos(playerid, params[]) {
7343 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 6) {
7344
7345 GetPlayerPos(playerid, groupVariables[P_DATA[playerid][pGroup]][gSafePos][0], groupVariables[P_DATA[playerid][pGroup]][gSafePos][1], groupVariables[P_DATA[playerid][pGroup]][gSafePos][2]);
7346
7347 DestroyDynamicPickup(groupVariables[P_DATA[playerid][pGroup]][gSafePickupID]);
7348 DestroyDynamic3DTextLabel(groupVariables[P_DATA[playerid][pGroup]][gSafeLabelID]);
7349
7350 new
7351 labelString[128];
7352
7353 format(labelString, sizeof(labelString), "%s\nGroup Safe", groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
7354
7355 groupVariables[P_DATA[playerid][pGroup]][gSafePickupID] = CreateDynamicPickup(1239, 23, groupVariables[P_DATA[playerid][pGroup]][gSafePos][0], groupVariables[P_DATA[playerid][pGroup]][gSafePos][1], groupVariables[P_DATA[playerid][pGroup]][gSafePos][2], GROUP_VIRTUAL_WORLD+P_DATA[playerid][pGroup], groupVariables[P_DATA[playerid][pGroup]][gGroupHQInteriorID], -1, 50);
7356 groupVariables[P_DATA[playerid][pGroup]][gSafeLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, groupVariables[P_DATA[playerid][pGroup]][gSafePos][0], groupVariables[P_DATA[playerid][pGroup]][gSafePos][1], groupVariables[P_DATA[playerid][pGroup]][gSafePos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, GROUP_VIRTUAL_WORLD+P_DATA[playerid][pGroup], groupVariables[P_DATA[playerid][pGroup]][gGroupHQInteriorID], -1, 50.0);
7357
7358 SendClientMessage(playerid, COLOR_WHITE, "You have adjusted the position of your group's safe.");
7359 }
7360 return 1;
7361}
7362
7363CMD:gname(playerid, params[]) {
7364 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 6) {
7365 if(!isnull(params)) {
7366
7367 new
7368 safeString[102];
7369
7370 format(safeString, sizeof(safeString), "You have changed the group name to %s.", params);
7371 SendClientMessage(playerid, COLOR_WHITE, safeString);
7372
7373 mysql_real_escape_string(params, safeString);
7374
7375 strcpy(groupVariables[P_DATA[playerid][pGroup]][gGroupName], safeString, 64);
7376
7377 switch(groupVariables[P_DATA[playerid][pGroup]][gGroupHQLockStatus]) {
7378 case 0: format(safeString, sizeof(safeString), "%s's HQ\n\nPress CROUCH to enter.", groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
7379 case 1: format(safeString, sizeof(safeString), "%s's HQ\n\n(locked)", groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
7380 }
7381
7382 UpdateDynamic3DTextLabelText(groupVariables[P_DATA[playerid][pGroup]][gGroupLabelID], COLOR_YELLOW, safeString);
7383
7384 format(safeString, sizeof(safeString), "%s\nGroup Safe", groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
7385
7386 UpdateDynamic3DTextLabelText(groupVariables[P_DATA[playerid][pGroup]][gSafeLabelID], COLOR_YELLOW, safeString);
7387
7388 }
7389 else ShowSyntax(playerid, "/gname [group name]");
7390 }
7391 return 1;
7392}
7393
7394CMD:showmotd(playerid, params[]) {
7395 if(P_DATA[playerid][pGroup] >= 1) {
7396
7397 new string[128];
7398 format(string, sizeof(string), "Group MOTD: {FFFFFF}%s", groupVariables[P_DATA[playerid][pGroup]][gGroupMOTD]);
7399 SendClientMessage(playerid, COLOR_GENANNOUNCE, string);
7400 }
7401 return 1;
7402}
7403
7404CMD:invite(playerid, params[]) {
7405 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 5) {
7406 new
7407 userID;
7408
7409 if(sscanf(params, "u", userID)) {
7410 return ShowSyntax(playerid, "/invite [playerid]");
7411 }
7412 else {
7413 if(!IsPlayerConnected(userID)) return SendClientMessage(playerid, COLOR_GREY, "The specified userID/name is not connected.");
7414 else if(P_DATA[userID][pGroup] > 0) return SendClientMessage(playerid, COLOR_GREY, "That player is already in a group.");
7415 new
7416 playerName[MAX_PLAYER_NAME],
7417 messageString[128];
7418
7419 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
7420 format(messageString, sizeof(messageString), "You have invited %s to join your group.", playerName);
7421 SendClientMessage(playerid, COLOR_WHITE, messageString);
7422
7423 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
7424 format(messageString, sizeof(messageString), "%s has invited you to join group %s (to accept the invitation, type '/accept invite').", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
7425 SendClientMessage(userID, COLOR_NICESKY, messageString);
7426
7427 SetPVarInt(userID, "invID", P_DATA[playerid][pGroup]); // Storing in a PVar as it's something that won't be used frequently, saving memory. Also, keeping the variable names short, as they're stored in memory and literally kill!!1
7428 }
7429 }
7430
7431 return 1;
7432}
7433
7434CMD:uninvite(playerid, params[]) {
7435 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 5) {
7436 new
7437 userID;
7438
7439 if(sscanf(params, "u", userID)) {
7440 return ShowSyntax(playerid, "/uninvite [playerid]");
7441 }
7442 else {
7443 if(!IsPlayerConnected(userID)) return SendClientMessage(playerid, COLOR_GREY, "The specified userID/name is not connected.");
7444 else if(P_DATA[playerid][pGroup] != P_DATA[userID][pGroup]) return SendClientMessage(playerid, COLOR_GREY, "That player isn't in your group.");
7445 else if(P_DATA[playerid][pGroupRank] <= P_DATA[userID][pGroupRank]) return SendClientMessage(playerid, COLOR_GREY, "You can't uninvite this person.");
7446
7447 new
7448 messageString[119],
7449 playerName[MAX_PLAYER_NAME];
7450
7451 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
7452 format(messageString, sizeof(messageString), "%s has removed you from the %s.", playerName, groupVariables[P_DATA[userID][pGroup]][gGroupName]);
7453 SendClientMessage(userID, COLOR_NICESKY, messageString);
7454
7455 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
7456 format(messageString, sizeof(messageString), "You have removed %s from your group.", playerName);
7457 SendClientMessage(playerid, COLOR_WHITE, messageString);
7458
7459 format(messageString, sizeof(messageString), "%s has left the group (uninvited).", playerName);
7460 SendToGroup(P_DATA[playerid][pGroup], COLOR_GENANNOUNCE, messageString);
7461
7462 P_DATA[userID][pGroup] = 0;
7463 P_DATA[userID][pGroupRank] = 0;
7464 }
7465 }
7466 return 1;
7467}
7468CMD:lockhq(playerid, params[]) {
7469 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 5) {
7470
7471 new
7472 labelString[102];
7473
7474 switch(groupVariables[P_DATA[playerid][pGroup]][gGroupHQLockStatus]) {
7475 case 1: {
7476 SendClientMessage(playerid, COLOR_WHITE, "HQ unlocked.");
7477 groupVariables[P_DATA[playerid][pGroup]][gGroupHQLockStatus] = 0;
7478 format(labelString, sizeof(labelString), "%s's HQ\n\nPress CROUCH to enter.", groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
7479 }
7480 case 0: {
7481 SendClientMessage(playerid, COLOR_WHITE, "HQ locked.");
7482 groupVariables[P_DATA[playerid][pGroup]][gGroupHQLockStatus] = 1;
7483 format(labelString, sizeof(labelString), "%s's HQ\n\n(locked)", groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
7484 }
7485 }
7486
7487 UpdateDynamic3DTextLabelText(groupVariables[P_DATA[playerid][pGroup]][gGroupLabelID], COLOR_YELLOW, labelString);
7488 }
7489 return 1;
7490}
7491CMD:changerank(playerid, params[]) {
7492 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 5) {
7493 new
7494 rank,
7495 userID;
7496
7497 if(sscanf(params, "ud", userID, rank)) {
7498 ShowSyntax(playerid, "/changerank [playerid] [rank]");
7499 }
7500 else {
7501 if(!IsPlayerConnected(userID)) return SendClientMessage(playerid, COLOR_GREY, "The specified userID/name is not connected.");
7502 else if(rank < 1 || rank > 6) return SendClientMessage(playerid, COLOR_GREY, "Invalid rank specified.");
7503 else if(P_DATA[playerid][pGroup] != P_DATA[userID][pGroup]) return SendClientMessage(playerid, COLOR_GREY, "That player isn't in your group.");
7504 else if(P_DATA[playerid][pGroupRank] <= rank) return SendClientMessage(playerid, COLOR_GREY, "You can't promote to this rank.");
7505 else if(P_DATA[playerid][pGroupRank] <= P_DATA[userID][pGroupRank]) return SendClientMessage(playerid, COLOR_GREY, "You can't alter this person's rank.");
7506 else if(P_DATA[userID][pGroupRank] == rank) return SendClientMessage(playerid, COLOR_GREY, "That person is already of that rank.");
7507 else {
7508
7509 new
7510 messageString[128],
7511 playerName[MAX_PLAYER_NAME];
7512
7513 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
7514 if(rank > P_DATA[userID][pGroupRank]) switch(rank) {
7515
7516 case 1: format(messageString, sizeof(messageString), "%s has promoted you to the rank of %s (1).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1]);
7517 case 2: format(messageString, sizeof(messageString), "%s has promoted you to the rank of %s (2).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName2]);
7518 case 3: format(messageString, sizeof(messageString), "%s has promoted you to the rank of %s (3).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName3]);
7519 case 4: format(messageString, sizeof(messageString), "%s has promoted you to the rank of %s (4).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName4]);
7520 case 5: format(messageString, sizeof(messageString), "%s has promoted you to the rank of %s (5).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5]);
7521 case 6: format(messageString, sizeof(messageString), "%s has promoted you to the rank of %s (6).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6]);
7522
7523 }
7524 else switch(rank) {
7525
7526 case 1: format(messageString, sizeof(messageString), "%s has demoted you to the rank of %s (1).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1]);
7527 case 2: format(messageString, sizeof(messageString), "%s has demoted you to the rank of %s (2).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName2]);
7528 case 3: format(messageString, sizeof(messageString), "%s has demoted you to the rank of %s (3).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName3]);
7529 case 4: format(messageString, sizeof(messageString), "%s has demoted you to the rank of %s (4).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName4]);
7530 case 5: format(messageString, sizeof(messageString), "%s has demoted you to the rank of %s (5).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5]);
7531 case 6: format(messageString, sizeof(messageString), "%s has demoted you to the rank of %s (6).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6]);
7532 }
7533 SendClientMessage(userID, COLOR_NICESKY, messageString);
7534
7535 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
7536
7537 if(rank > P_DATA[userID][pGroupRank]) switch(rank) {
7538
7539 case 1: format(messageString, sizeof(messageString), "You have promoted %s to the rank of %s (1).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1]);
7540 case 2: format(messageString, sizeof(messageString), "You have promoted %s to the rank of %s (2).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName2]);
7541 case 3: format(messageString, sizeof(messageString), "You have promoted %s to the rank of %s (3).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName3]);
7542 case 4: format(messageString, sizeof(messageString), "You have promoted %s to the rank of %s (4).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName4]);
7543 case 5: format(messageString, sizeof(messageString), "You have promoted %s to the rank of %s (5).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5]);
7544 case 6: format(messageString, sizeof(messageString), "You have promoted %s to the rank of %s (6).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6]);
7545
7546 }
7547 else switch(rank) {
7548
7549 case 1: format(messageString, sizeof(messageString), "You have demoted %s to the rank of %s (1).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1]);
7550 case 2: format(messageString, sizeof(messageString), "You have demoted %s to the rank of %s (2).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName2]);
7551 case 3: format(messageString, sizeof(messageString), "You have demoted %s to the rank of %s (3).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName3]);
7552 case 4: format(messageString, sizeof(messageString), "You have demoted %s to the rank of %s (4).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName4]);
7553 case 5: format(messageString, sizeof(messageString), "You have demoted %s to the rank of %s (5).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5]);
7554 case 6: format(messageString, sizeof(messageString), "You have demoted %s to the rank of %s (6).", playerName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6]);
7555 }
7556 SendClientMessage(playerid, COLOR_WHITE, messageString);
7557
7558 P_DATA[userID][pGroupRank] = rank;
7559 }
7560 }
7561 }
7562 return 1;
7563}
7564
7565CMD:granknames(playerid, params[]) {
7566 if(P_DATA[playerid][pGroup] >= 1 && P_DATA[playerid][pGroupRank] >= 6) {
7567 new
7568 rankName[32],
7569 rankID;
7570
7571 if(sscanf(params, "ds[32]", rankID, rankName)) {
7572 return ShowSyntax(playerid, "/granknames [rankid (1-6)] [rank title]");
7573 }
7574 else {
7575 new
7576 messageString[128];
7577
7578 switch(rankID) {
7579 case 1: {
7580 mysql_real_escape_string(rankName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName1]);
7581
7582 format(messageString, sizeof(messageString), "You have changed the title of Rank 1 to '%s'.", rankName);
7583 SendClientMessage(playerid, COLOR_WHITE, messageString);
7584 }
7585 case 2: {
7586 mysql_real_escape_string(rankName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName2]);
7587
7588 format(messageString, sizeof(messageString), "You have changed the title of Rank 2 to '%s'.", rankName);
7589 SendClientMessage(playerid, COLOR_WHITE, messageString);
7590 }
7591 case 3: {
7592 mysql_real_escape_string(rankName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName3]);
7593
7594 format(messageString, sizeof(messageString), "You have changed the title of Rank 3 to '%s'.", rankName);
7595 SendClientMessage(playerid, COLOR_WHITE, messageString);
7596 }
7597 case 4: {
7598 mysql_real_escape_string(rankName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName4]);
7599
7600 format(messageString, sizeof(messageString), "You have changed the title of Rank 4 to '%s'.", rankName);
7601 SendClientMessage(playerid, COLOR_WHITE, messageString);
7602 }
7603 case 5: {
7604 mysql_real_escape_string(rankName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName5]);
7605
7606 format(messageString, sizeof(messageString), "You have changed the title of Rank 5 to '%s'.", rankName);
7607 SendClientMessage(playerid, COLOR_WHITE, messageString);
7608 }
7609 case 6: {
7610 mysql_real_escape_string(rankName, groupVariables[P_DATA[playerid][pGroup]][gGroupRankName6]);
7611
7612 format(messageString, sizeof(messageString), "You have changed the title of Rank 6 to '%s'.", rankName);
7613 SendClientMessage(playerid, COLOR_WHITE, messageString);
7614 }
7615 }
7616 }
7617 }
7618 return 1;
7619}
7620
7621CMD:accept(playerid, params[]) {
7622 if(!isnull(params)) {
7623 if(strcmp(params, "ticket", true) == 0) {
7624
7625 new
7626 ticketer = GetPVarInt(playerid, "tID") - 1,
7627 ticketPrice = GetPVarInt(playerid, "tP"),
7628 ticketString[128],
7629 ticketNames[2][MAX_PLAYER_NAME];
7630
7631 if(ticketer != -1 && ticketPrice > 0) {
7632 if(IsPlayerConnectedEx(ticketer)) {
7633 if(IsPlayerInRangeOfPlayer(playerid, ticketer, 3.0)) {
7634 if(P_DATA[playerid][pMoney] >= ticketPrice) {
7635
7636 GetPlayerName(playerid, ticketNames[0], MAX_PLAYER_NAME);
7637 GetPlayerName(ticketer, ticketNames[1], MAX_PLAYER_NAME);
7638
7639 format(ticketString, sizeof(ticketString), "* %s takes out $%d in cash, and hands it to %s.", ticketNames[0], ticketPrice, ticketNames[1]);
7640 nearByMessage(playerid, COLOR_PURPLE, ticketString);
7641
7642 format(ticketString, sizeof(ticketString), "%s has accepted the $%d ticket you issued them - you have received $%d.", ticketNames[0], ticketPrice, ticketPrice / 2);
7643 SendClientMessage(ticketer, COLOR_WHITE, ticketString);
7644
7645 format(ticketString, sizeof(ticketString), "You have paid the $%d ticket %s issued you.", ticketPrice, ticketNames[1]);
7646 SendClientMessage(playerid, COLOR_WHITE, ticketString);
7647
7648 P_DATA[playerid][pMoney] -= ticketPrice;
7649 P_DATA[ticketer][pMoney] += ticketPrice / 2;
7650
7651 groupVariables[P_DATA[ticketer][pGroup]][gSafe][0] += ticketPrice / 2;
7652
7653 DeletePVar(playerid, "tID");
7654 DeletePVar(playerid, "tP");
7655
7656 }
7657 else {
7658
7659 format(ticketString, sizeof(ticketString), "You can't afford to pay this ticket of $%d - you need another $%d to do so.", ticketPrice, ticketPrice - P_DATA[playerid][pMoney]);
7660 SendClientMessage(playerid, COLOR_GREY, ticketString);
7661 }
7662 }
7663 else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
7664 }
7665 else {
7666 SendClientMessage(playerid, COLOR_GREY, "The person issuing the ticket has disconnected.");
7667 DeletePVar(playerid, "tID");
7668 DeletePVar(playerid, "tP");
7669 }
7670 }
7671 else SendClientMessage(playerid, COLOR_GREY, "Nobody has issued you a ticket.");
7672 }
7673 else if(strcmp(params, "invite", true) == 0) {
7674 if(GetPVarInt(playerid, "invID") >= 1) {
7675 new
7676 messageString[64],
7677 playerName[MAX_PLAYER_NAME];
7678
7679 P_DATA[playerid][pGroup] = GetPVarInt(playerid, "invID");
7680 P_DATA[playerid][pGroupRank] = 1;
7681
7682 DeletePVar(playerid, "invID");
7683
7684 format(messageString, sizeof(messageString), "You are now a member of the %s.", groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
7685 SendClientMessage(playerid, COLOR_NICESKY, messageString);
7686
7687 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
7688 format(messageString, sizeof(messageString), "%s has joined the group (invitation).", playerName);
7689 SendToGroup(P_DATA[playerid][pGroup], COLOR_GENANNOUNCE, messageString);
7690
7691 }
7692 else {
7693 return SendClientMessage(playerid, COLOR_GREY, "You don't have an active group invite request.");
7694 }
7695 }
7696
7697 else if(strcmp(params, "handshake", true) == 0) {
7698 if(GetPVarInt(playerid,"hs") != 0) {
7699 if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, "You can only do this while on foot.");
7700 if(IsPlayerInRangeOfPlayer(playerid, GetPVarInt(playerid,"hsID"), 1.5)) {
7701
7702 new
7703 Float: PosFloats[3],
7704 string[73],
7705 playerNames[2][MAX_PLAYER_NAME],
7706 shakeOffer = GetPVarInt(playerid,"hsID"),
7707 shakeStyle = GetPVarInt(playerid,"hs");
7708
7709 if(!IsPlayerConnectedEx(shakeOffer)) return 1;
7710
7711 PlayerFacePlayer(playerid, shakeOffer);
7712 GetPlayerPos(shakeOffer, PosFloats[0], PosFloats[1], PosFloats[2]);
7713 GetXYInFrontOfPlayer(shakeOffer, PosFloats[0], PosFloats[1], 0.5);
7714 SetPlayerPos(playerid, PosFloats[0], PosFloats[1], PosFloats[2]); // Ensures that the players are in perfect position for it to happen.
7715
7716 switch(shakeStyle) {
7717 case 1: {
7718 ApplyAnimation(playerid, "GANGS", "hndshkaa", 3.0, 1, 1, 1, 0, 1500, 1);
7719 ApplyAnimation(shakeOffer, "GANGS", "hndshkaa", 3.0, 1, 1, 1, 0, 1500, 1);
7720 ApplyAnimation(playerid, "GANGS", "hndshkaa", 3.0, 1, 1, 1, 0, 1500, 1);
7721 ApplyAnimation(shakeOffer, "GANGS", "hndshkaa", 3.0, 1, 1, 1, 0, 1500, 1);
7722 }
7723 case 2: {
7724 ApplyAnimation(playerid, "GANGS", "hndshkba", 3.0, 1, 1, 1, 0, 1500, 1 );
7725 ApplyAnimation(shakeOffer, "GANGS", "hndshkba", 3.0, 1, 1, 1, 0, 1500, 1);
7726 ApplyAnimation(playerid, "GANGS", "hndshkba", 3.0, 1, 1, 1, 0, 1500, 1 );
7727 ApplyAnimation(shakeOffer, "GANGS", "hndshkba", 3.0, 1, 1, 1, 0, 1500, 1);
7728 }
7729 case 3: {
7730 ApplyAnimation(playerid, "GANGS", "hndshkca", 3.0, 1, 1, 1, 0, 1500, 1 );
7731 ApplyAnimation(shakeOffer, "GANGS", "hndshkcb", 3.0, 1, 1, 1, 0, 1500, 1);
7732 ApplyAnimation(playerid, "GANGS", "hndshkca", 3.0, 1, 1, 1, 0, 1500, 1 );
7733 ApplyAnimation(shakeOffer, "GANGS", "hndshkcb", 3.0, 1, 1, 1, 0, 1500, 1);
7734 }
7735 case 4: {
7736 ApplyAnimation(playerid, "GANGS", "hndshkda",3.0, 1, 1, 1, 0, 1500, 1);
7737 ApplyAnimation(shakeOffer, "GANGS", "hndshkda", 3.0, 1, 1, 1, 0, 1500, 1);
7738 ApplyAnimation(playerid, "GANGS", "hndshkda",3.0, 1, 1, 1, 0, 1500, 1);
7739 ApplyAnimation(shakeOffer, "GANGS", "hndshkda", 3.0, 1, 1, 1, 0, 1500, 1);
7740 }
7741 case 5: {
7742 ApplyAnimation(playerid, "GANGS", "hndshkea", 3.0, 1, 1, 1, 0, 1500, 1);
7743 ApplyAnimation(shakeOffer, "GANGS", "hndshkea", 3.0, 1, 1, 1, 0, 1500, 1);
7744 ApplyAnimation(playerid, "GANGS", "hndshkea", 3.0, 1, 1, 1, 0, 1500, 1);
7745 ApplyAnimation(shakeOffer, "GANGS", "hndshkea", 3.0, 1, 1, 1, 0, 1500, 1);
7746 }
7747 case 6: {
7748 ApplyAnimation(playerid, "GANGS", "hndshkfa", 3.0, 1, 1, 1, 0, 1500, 1 );
7749 ApplyAnimation(shakeOffer, "GANGS", "hndshkfa", 3.0, 1, 1, 1, 0, 1500, 1);
7750 ApplyAnimation(playerid, "GANGS", "hndshkfa", 3.0, 1, 1, 1, 0, 1500, 1 );
7751 ApplyAnimation(shakeOffer, "GANGS", "hndshkfa", 3.0, 1, 1, 1, 0, 1500, 1);
7752 }
7753 case 7: {
7754 ApplyAnimation(playerid, "GANGS", "prtial_hndshk_01", 3.0, 1, 1, 1, 0, 1500, 1);
7755 ApplyAnimation(shakeOffer, "GANGS", "prtial_hndshk_01", 3.0, 1, 1, 1, 0, 1500, 1);
7756 ApplyAnimation(playerid, "GANGS", "prtial_hndshk_01", 3.0, 1, 1, 1, 0, 1500, 1);
7757 ApplyAnimation(shakeOffer, "GANGS", "prtial_hndshk_01", 3.0, 1, 1, 1, 0, 1500, 1);
7758 }
7759 case 8: {
7760 ApplyAnimation(playerid, "GANGS", "prtial_hndshk_biz_01", 3.7, 1, 1, 1, 0, 2200, 1);
7761 ApplyAnimation(shakeOffer, "GANGS", "prtial_hndshk_biz_01", 3.5, 1, 1, 1, 0, 2200, 1);
7762 ApplyAnimation(playerid, "GANGS", "prtial_hndshk_biz_01", 3.7, 1, 1, 1, 0, 2200, 1);
7763 ApplyAnimation(shakeOffer, "GANGS", "prtial_hndshk_biz_01", 3.5, 1, 1, 1, 0, 2200, 1);
7764 }
7765 }
7766 GetPlayerName(playerid, playerNames[0], MAX_PLAYER_NAME);
7767 GetPlayerName(shakeOffer, playerNames[1], MAX_PLAYER_NAME);
7768 DeletePVar(playerid,"hs");
7769 DeletePVar(playerid,"hsID");
7770 format(string, sizeof(string), "* %s has shaken hands with %s.", playerNames[1], playerNames[0]);
7771 nearByMessage(playerid, COLOR_PURPLE, string);
7772 }
7773 else {
7774 SendClientMessage( playerid, COLOR_GREY, "You're too far away.");
7775 }
7776 }
7777 else {
7778 SendClientMessage(playerid, COLOR_GREY, "You don't have a pending handshake request.");
7779 }
7780 }
7781 else if(strcmp(params, "weapon", true) == 0) {
7782
7783 new
7784 playerOffering = GetPVarInt(playerid,"gunID"),
7785 weaponOffering = GetPVarInt(GetPVarInt(playerid,"gunID"),"gun"),
7786 slotOffering = GetPVarInt(GetPVarInt(playerid,"gunID"),"slot"),
7787 WplayerName[2][MAX_PLAYER_NAME],
7788 wstring[128];
7789
7790 if(weaponOffering != 0 && slotOffering != 0) {
7791 if(IsPlayerInRangeOfPlayer(playerid, playerOffering, 5.0) && !IsPlayerInAnyVehicle(playerid) && !IsPlayerInAnyVehicle(playerOffering)) {
7792
7793 if(P_DATA[playerOffering][pWeapons][slotOffering] != weaponOffering) {
7794 return SendClientMessage(playerid, COLOR_GREY, "The player offering you a weapon no longer has it.");
7795 }
7796 else if(P_DATA[playerOffering][pFreezeType] > 0) {
7797 return SendClientMessage(playerid, COLOR_GREY, "That person is cuffed, tazed, or frozen - they can't do this.");
7798 }
7799 else if(P_DATA[playerid][pFreezeType] > 0) {
7800 return SendClientMessage(playerid, COLOR_GREY, "You can't do this while cuffed, tazed, or frozen.");
7801 }
7802 else {
7803
7804 givePlayerValidWeapon(playerid, weaponOffering);
7805 removePlayerWeapon(playerOffering, weaponOffering);
7806
7807 GetPlayerName(playerOffering, WplayerName[0], MAX_PLAYER_NAME);
7808 GetPlayerName(playerid, WplayerName[1], MAX_PLAYER_NAME);
7809
7810 format(wstring, sizeof(wstring), "You have accepted the %s from %s.", WeaponNames[weaponOffering], WplayerName[0]);
7811 SendClientMessage(playerid, COLOR_WHITE, wstring);
7812
7813 format(wstring, sizeof(wstring), "%s has accepted the %s you offered them.", WplayerName[1], WeaponNames[weaponOffering]);
7814 SendClientMessage(playerOffering, COLOR_WHITE, wstring);
7815
7816 format(wstring, sizeof(wstring), "* %s has given their %s to %s.", WplayerName[0], WeaponNames[weaponOffering], WplayerName[1]);
7817 nearByMessage(playerid, COLOR_PURPLE, wstring);
7818
7819 DeletePVar(playerOffering,"gun");
7820 DeletePVar(playerid,"gunID");
7821 DeletePVar(playerOffering,"slot");
7822 }
7823 }
7824 else SendClientMessage(playerid, COLOR_GREY, "You're too far away from the person offering, or either of you are in a vehicle.");
7825 }
7826 else SendClientMessage(playerid, COLOR_GREY, "Nobody offered you a weapon.");
7827 }
7828 else if(strcmp(params, "armour", true) == 0) {
7829
7830 new
7831 aplayerOffering = GetPVarInt(playerid,"aID") - 1,
7832 AplayerName[2][MAX_PLAYER_NAME],
7833 astring[128];
7834
7835 if(playerOffering != INVALID_PLAYER_ID) {
7836 if(IsPlayerInRangeOfPlayer(playerid, aplayerOffering, 5.0)) {
7837
7838 if(P_DATA[aplayerOffering][pFreezeType] > 0) {
7839 return SendClientMessage(playerid, COLOR_GREY, "That person is cuffed, tazed, or frozen - they can't do this.");
7840 }
7841 else if(P_DATA[playerid][pFreezeType] > 0) {
7842 return SendClientMessage(playerid, COLOR_GREY, "You can't do this while cuffed, tazed, or frozen.");
7843 }
7844 else {
7845
7846 new
7847 Float:ArmourFloats[2];
7848
7849 GetPlayerArmour(aplayerOffering, ArmourFloats[0]);
7850 GetPlayerArmour(playerid, ArmourFloats[1]);
7851
7852 if(ArmourFloats[1] + ArmourFloats[0] >= 100) SetPlayerArmour(playerid, 100);
7853 else SetPlayerArmour(playerid, ArmourFloats[1] + ArmourFloats[0]);
7854
7855 SetPlayerArmour(aplayerOffering, 0.0);
7856
7857 GetPlayerName(aplayerOffering, AplayerName[0], MAX_PLAYER_NAME);
7858 GetPlayerName(playerid, AplayerName[1], MAX_PLAYER_NAME);
7859 format(astring, sizeof(astring), "You have accepted the kevlar vest from %s.", AplayerName[0]);
7860 SendClientMessage(playerid, COLOR_WHITE, astring);
7861
7862 format(astring, sizeof(astring), "%s has accepted the kevlar vest you offered them.", AplayerName[1]);
7863 SendClientMessage(aplayerOffering, COLOR_WHITE, astring);
7864
7865 format(astring, sizeof(astring), "* %s has given their kevlar vest to %s.", AplayerName[0], AplayerName[1]);
7866 nearByMessage(playerid, COLOR_PURPLE, astring);
7867
7868 DeletePVar(playerid,"aID");
7869 }
7870 }
7871 else SendClientMessage(playerid, COLOR_GREY, "You're too far away from the person offering.");
7872 }
7873 else SendClientMessage(playerid, COLOR_GREY, "Nobody offered you armour.");
7874 }
7875 else SendClientMessage(playerid, COLOR_GREY, "Invalid item specified.");
7876 }
7877 else {
7878 ShowSyntax(playerid, "/accept [item]");
7879 SendClientMessage(playerid, COLOR_GREY, "Items: Invite, Handshake, Weapon, Givecar, Ticket, Armour");
7880 }
7881 return 1;
7882}
7883
7884CMD:a(playerid, params[]) {
7885 if(P_DATA[playerid][pAdmin] >= 1) {
7886 if(!isnull(params)) {
7887 new messageString[128];
7888 format(messageString, sizeof(messageString), "(%d) Admin %s: %s", P_DATA[playerid][pAdmin], GetName(playerid), params);
7889 submitToAdmins(messageString, COLOR_ADMCHAT);
7890 }
7891 else ShowSyntax(playerid, "/a [message]");
7892 }
7893 return 1;
7894}
7895CMD:pm(playerid, params[]) {
7896 new id, message[128];
7897 if(P_DATA[playerid][pAdmin] < 1 && P_DATA[playerid][pHelper] < 1) return OnlyAdmin
7898 if(sscanf(params, "us[128]", id, message)) return SendClientMessage(playerid, COLOR_GREY,"{FF0000}Syntax:{FFFFFF} /pm [name/playerid] [message]");
7899 if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat.");
7900 SCMF(id,COLOR_YELLOW,"(( PM from %s: %s ))",GetName(playerid), message),SCMF(playerid, COLOR_YELLOW,"(( PM sent to %s: %s ))",GetName(id),message);
7901 return 1;
7902}
7903CMD:w(playerid, params[]) {
7904 return cmd_whisper(playerid, params);
7905}
7906CMD:whisper(playerid, params[]) {
7907 new message[128],id;
7908 if(sscanf(params, "us[128]", id, message)) {
7909 ShowSyntax(playerid, "/whisper [playerid] [message]");
7910 }
7911 else {
7912 if(IsPlayerConnected(id) && P_DATA[id][pStatus] >= 1) {
7913 if(IsPlayerInRangeOfPlayer(playerid, id, 2.0)) {
7914 if(P_DATA[id][pSeeWhisper] == 0) {
7915 new
7916 szMessage[128],
7917 playerName[MAX_PLAYER_NAME],
7918 giveplayerName[MAX_PLAYER_NAME];
7919
7920 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
7921
7922 format(szMessage, sizeof(szMessage), "%s whispers: %s", playerName, message);
7923 SendClientMessage(id, COLOR_NICESKY, szMessage);
7924
7925 GetPlayerName(id, giveplayerName, MAX_PLAYER_NAME);
7926
7927 format(szMessage, sizeof(szMessage), "You whisper to %s: %s", giveplayerName, message);
7928 SendClientMessage(playerid, COLOR_NICESKY, szMessage);
7929
7930 format(szMessage, sizeof(szMessage), "* %s whispers something to %s.", playerName, giveplayerName);
7931 nearByMessage(playerid, COLOR_PURPLE, szMessage, 2.0);
7932 }
7933 else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
7934 }
7935 else {
7936 SendClientMessage(playerid, COLOR_GREY, "That player's whispers aren't enabled.");
7937 }
7938 }
7939 else {
7940 SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
7941 }
7942 }
7943 return 1;
7944}
7945
7946CMD:commands(playerid, params[]) {
7947 return showHelp(playerid);
7948}
7949
7950stock showHelp(playerid) {
7951 return ShowPlayerDialog(playerid, DIALOG_HELP, DIALOG_STYLE_LIST, "SERVER: Commands", "General\nChat\nGroups\nAnimations\nHouses\nJobs\n\nBusinesses\nHelpers\nVehicles\nBank\nVIP", "Select", "Exit");
7952}
7953
7954CMD:asellbusiness(playerid, params[]) {
7955 if(P_DATA[playerid][pAdmin] < 3) return OnlyAdmin
7956 new
7957 houseID = strval(params);
7958
7959 if(!isnull(params)) {
7960 if(houseID < 1 || houseID > MAX_BUSINESSES) return SendClientMessage(playerid, COLOR_GREY, "Invalid business ID.");
7961
7962 new
7963 labelString[96];
7964
7965 format(businessVariables[houseID][bOwner], MAX_PLAYER_NAME, "Nobody");
7966
7967 DestroyDynamicPickup(businessVariables[houseID][bPickupID]);
7968 DestroyDynamic3DTextLabel(businessVariables[houseID][bLabelID]);
7969
7970 format(labelString, sizeof(labelString), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\n(locked)", businessVariables[houseID][bName], houseID, businessVariables[houseID][bPrice]);
7971
7972 businessVariables[houseID][bLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, businessVariables[houseID][bExteriorPos][0], businessVariables[houseID][bExteriorPos][1], businessVariables[houseID][bExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
7973 businessVariables[houseID][bPickupID] = CreateDynamicPickup(1239, 23, businessVariables[houseID][bExteriorPos][0], businessVariables[houseID][bExteriorPos][1], businessVariables[houseID][bExteriorPos][2], 0, 0, -1, 250);
7974
7975 businessVariables[houseID][bLocked] = 1;
7976
7977 format(labelString, sizeof(labelString), "You have admin-sold business ID %d.", houseID);
7978 SendClientMessage(playerid, COLOR_WHITE, labelString);
7979
7980 saveHouse(houseID);
7981 }
7982 else {
7983 return ShowSyntax(playerid, "/asellbusiness [businessid]");
7984 }
7985 return 1;
7986}
7987
7988CMD:he(playerid, params[]) {
7989 if(P_DATA[playerid][pHelper] >= 1 || P_DATA[playerid][pAdmin] >= 1) {
7990 if(!isnull(params)) {
7991 new
7992 msgSz[128];
7993
7994 if(P_DATA[playerid][pAdmin] >= 1)
7995 format(msgSz, sizeof(msgSz), "* Administrator %s (%d): %s", GetName(playerid), P_DATA[playerid][pAdmin], params);
7996
7997 if(P_DATA[playerid][pHelper] >= 1)
7998 format(msgSz, sizeof(msgSz), "* Helper %s (%d): %s", P_DATA[playerid][pNormalName], P_DATA[playerid][pHelper], params);
7999
8000
8001 foreach(new x : Player) {
8002 if(P_DATA[x][pHelper] >= 1 || P_DATA[x][pAdmin] >= 1) {
8003 SendClientMessage(x, COLOR_GENANNOUNCE, msgSz);
8004 }
8005 }
8006 }
8007 else {
8008 return ShowSyntax(playerid, "/he [message]");
8009 }
8010 }
8011 else OnlyAdmin
8012 return 1;
8013}
8014
8015CMD:asellhouse(playerid, params[]) {
8016 if(P_DATA[playerid][pAdmin] >= 3) {
8017 new
8018 houseID = strval(params);
8019
8020 if(!isnull(params)) {
8021 if(houseID < 1 || houseID > MAX_HOUSES) return SendClientMessage(playerid, COLOR_GREY, "Invalid house ID.");
8022
8023 new
8024 labelString[96];
8025
8026 format(houseVariables[houseID][hHouseOwner], MAX_PLAYER_NAME, "Nobody");
8027 format(labelString, sizeof(labelString), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\n(locked)", houseID, houseVariables[houseID][hHousePrice]);
8028
8029 DestroyDynamicPickup(houseVariables[houseID][hPickupID]);
8030 DestroyDynamic3DTextLabel(houseVariables[houseID][hLabelID]);
8031
8032 houseVariables[houseID][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
8033 houseVariables[houseID][hPickupID] = CreateDynamicPickup(1273, 23, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 0, houseVariables[houseID][hHouseExteriorID], -1, 250);
8034
8035 houseVariables[houseID][hHouseLocked] = 1;
8036
8037 format(labelString, sizeof(labelString), "You have admin-sold house ID %d.", houseID);
8038 SendClientMessage(playerid, COLOR_WHITE, labelString);
8039
8040 saveHouse(houseID);
8041 }
8042 else {
8043 return ShowSyntax(playerid, "/asellhouse [houseid]");
8044 }
8045 }
8046 else OnlyAdmin
8047 return 1;
8048}
8049
8050CMD:sellbusiness(playerid, params[]) {
8051 if(P_DATA[playerid][pStatus] >= 1) {
8052 new
8053 businessID = getPlayerBusinessID(playerid);
8054
8055 if(businessID < 1)
8056 return 1;
8057
8058 new
8059 labelString[96];
8060
8061 P_DATA[playerid][pMoney] += businessVariables[businessID][bPrice];
8062
8063 format(businessVariables[businessID][bOwner], MAX_PLAYER_NAME, "Nobody");
8064 format(labelString, sizeof(labelString), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\nPress CROUCH to enter", businessVariables[businessID][bName], businessID, businessVariables[businessID][bPrice]);
8065
8066 DestroyDynamicPickup(businessVariables[businessID][bPickupID]);
8067 DestroyDynamic3DTextLabel(businessVariables[businessID][bLabelID]);
8068
8069 businessVariables[businessID][bLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, businessVariables[businessID][bExteriorPos][0], businessVariables[businessID][bExteriorPos][1], businessVariables[businessID][bExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
8070 businessVariables[businessID][bPickupID] = CreateDynamicPickup(1239, 23, businessVariables[businessID][bExteriorPos][0], businessVariables[businessID][bExteriorPos][1], businessVariables[businessID][bExteriorPos][2], 0, 0, -1, 250);
8071
8072 businessVariables[businessID][bLocked] = 1;
8073
8074 format(labelString, sizeof(labelString), "Business sold! You have been given back $%d for the business.", businessVariables[businessID][bPrice]);
8075 SendClientMessage(playerid, COLOR_WHITE, labelString);
8076
8077 saveBusiness(businessID);
8078 }
8079 return 1;
8080}
8081
8082CMD:sellhouse(playerid, params[]) {
8083 if(P_DATA[playerid][pStatus] >= 1) {
8084 new
8085 houseID = getPlayerHouseID(playerid);
8086
8087 if(houseID < 1)
8088 return 1;
8089
8090 new
8091 labelString[96];
8092
8093 P_DATA[playerid][pMoney] += houseVariables[houseID][hHousePrice];
8094
8095 format(houseVariables[houseID][hHouseOwner], MAX_PLAYER_NAME, "Nobody");
8096 format(labelString, sizeof(labelString), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\n(locked)", houseID, houseVariables[houseID][hHousePrice]);
8097
8098 DestroyDynamicPickup(houseVariables[houseID][hPickupID]);
8099 DestroyDynamic3DTextLabel(houseVariables[houseID][hLabelID]);
8100
8101 houseVariables[houseID][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
8102 houseVariables[houseID][hPickupID] = CreateDynamicPickup(1273, 23, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 0, houseVariables[houseID][hHouseExteriorID], -1, 250);
8103
8104 houseVariables[houseID][hHouseLocked] = 1;
8105
8106 format(labelString, sizeof(labelString), "House sold! You have been given back $%d for the house.", houseVariables[houseID][hHousePrice]);
8107 SendClientMessage(playerid, COLOR_WHITE, labelString);
8108
8109 saveHouse(houseID);
8110 }
8111 return 1;
8112}
8113
8114CMD:lockhouse(playerid, params[]) {
8115 if(P_DATA[playerid][pStatus] >= 1) {
8116 new
8117 houseID = getPlayerHouseID(playerid);
8118
8119 if(houseID >= 1) {
8120 if(IsPlayerInRangeOfPoint(playerid, 2.0, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2]) || IsPlayerInRangeOfPoint(playerid, 2.0, houseVariables[houseID][hHouseInteriorPos][0], houseVariables[houseID][hHouseInteriorPos][1], houseVariables[houseID][hHouseInteriorPos][2])) {
8121
8122 new
8123 labelString[96];
8124
8125 switch(houseVariables[houseID][hHouseLocked]) {
8126 case 1: {
8127 houseVariables[houseID][hHouseLocked] = 0;
8128 SendClientMessage(playerid, COLOR_WHITE, "House unlocked.");
8129 format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\n\nPress CROUCH to enter.", houseID, houseVariables[houseID][hHouseOwner]);
8130 }
8131 case 0: {
8132 houseVariables[houseID][hHouseLocked] = 1;
8133 SendClientMessage(playerid, COLOR_WHITE, "House locked.");
8134 format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\n\n(locked)", houseID, houseVariables[houseID][hHouseOwner]);
8135 }
8136 }
8137
8138 UpdateDynamic3DTextLabelText(houseVariables[houseID][hLabelID], COLOR_YELLOW, labelString);
8139 PlayerPlaySoundEx(1145, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2]);
8140 PlayerPlaySoundEx(1145, houseVariables[houseID][hHouseInteriorPos][0], houseVariables[houseID][hHouseInteriorPos][1], houseVariables[houseID][hHouseInteriorPos][2]);
8141 }
8142 else SendClientMessage(playerid, COLOR_GREY, "You're not at your house.");
8143 }
8144 else SendClientMessage(playerid, COLOR_GREY, "You don't own a house.");
8145 }
8146
8147 return 1;
8148}
8149
8150CMD:listgroups(playerid, params[]) {
8151 if(P_DATA[playerid][pAdmin] >= 1) {
8152 new szMessage[128];
8153 for(new xf = 0; xf < MAX_GROUPS; xf++) {
8154 if(strlen(groupVariables[xf][gGroupName]) >= 1 && strcmp(groupVariables[xf][gGroupName], "None", true)) {
8155 format(szMessage, sizeof(szMessage), "ID: %d | Group Name: %s | Group Type: %d", xf, groupVariables[xf][gGroupName], groupVariables[xf][gGroupType]);
8156 SendClientMessage(playerid, COLOR_WHITE, szMessage);
8157 }
8158 }
8159 }
8160 return 1;
8161}
8162
8163CMD:bwithdraw(playerid, params[]) {
8164 if(getPlayerBusinessID(playerid) >= 1) {
8165 if(!isnull(params)) {
8166 new
8167 amount = strval(params),
8168 szMessage[64],
8169 businessID = getPlayerBusinessID(playerid);
8170
8171 if(amount < 1 || amount >= 5000000)
8172 return SendClientMessage(playerid, COLOR_GREY, "Withdrawl attempt failed.");
8173
8174 if(businessVariables[businessID][bVault] >= amount) {
8175 format(szMessage, sizeof(szMessage), "You have withdrawn $%d from your business.", amount);
8176 SendClientMessage(playerid, COLOR_WHITE, szMessage);
8177
8178 businessVariables[businessID][bVault] -= amount;
8179 P_DATA[playerid][pMoney] += amount;
8180 }
8181 }
8182 else {
8183 return ShowSyntax(playerid, "/bwithdraw [amount]");
8184 }
8185 }
8186 return 1;
8187}
8188
8189CMD:coin(playerid, params[]) {
8190 if(P_DATA[playerid][pStatus] >= 1) {
8191 new
8192 playerName[MAX_PLAYER_NAME],
8193 szMessage[90];
8194
8195 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8196
8197 if(P_DATA[playerid][pMoney] < 1)
8198 return SendClientMessage(playerid, COLOR_GREY, "You have no coins to flip.");
8199
8200 if(random(5) < 3) {
8201 format(szMessage, sizeof(szMessage), "* %s has flipped their coin. The coin lands on the 'heads' side.", playerName);
8202 nearByMessage(playerid, COLOR_PURPLE, szMessage);
8203 }
8204 else {
8205 format(szMessage, sizeof(szMessage), "* %s has flipped their coin. The coin lands on the 'tails' side.", playerName);
8206 nearByMessage(playerid, COLOR_PURPLE, szMessage);
8207 }
8208 }
8209 return 1;
8210}
8211
8212CMD:creategun(playerid, params[])
8213{
8214 if(jobVariables[P_DATA[playerid][pJob]][jJobType] == 1) {
8215 if(P_DATA[playerid][pFreezeType] == 0) {
8216 if(P_DATA[playerid][pJobDelay] == 0) {
8217 switch(P_DATA[playerid][pJobSkill][0]) {
8218 case 0 .. 49: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)","Select", "Cancel");
8219 case 50 .. 99: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\nColt 45 (250)","Select", "Cancel");
8220 case 100 .. 149: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)","Select", "Cancel");
8221 case 150 .. 199: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)","Select", "Cancel");
8222 case 200 .. 249: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)","Select", "Cancel");
8223 case 250 .. 299: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)","Select", "Cancel");
8224 case 300 .. 349: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)","Select", "Cancel");
8225 case 350 .. 399: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)\nAK-47 (1500)","Select", "Cancel");
8226 case 400 .. 449: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)\nAK-47 (1500)\nM4A1 (2000)","Select", "Cancel");
8227 case 450 .. 499: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)\nAK-47 (1500)\nM4A1 (2000)\nSniper (2450)","Select", "Cancel");
8228 default: ShowPlayerDialog(playerid, DIALOG_CREATEGUN, DIALOG_STYLE_LIST, "Weapon Selection", "Katana (30)\nCane (30)\nPool Cue (33)\nBaseball Bat (35)\nShovel (50)\n9mm Pistol (250)\nSilenced Pistol (300)\nShotgun (550)\nDesert Eagle (680)\nMP5 (850)\nMicro Uzi (900)\nAK-47 (1500)\nM4A1 (2000)\nSniper (2450)\nSPAS12 (2550)\nKevlar Vest (1750)","Select", "Cancel");
8229 }
8230 }
8231 else SendClientMessage(playerid, COLOR_GREY, "You must wait your reload time (30 seconds).");
8232 }
8233 else SendClientMessage(playerid, COLOR_GREY, "You can't do this while cuffed, tazed, or frozen.");
8234 }
8235 return 1;
8236}
8237
8238CMD:me(playerid, params[]) {
8239 if(P_DATA[playerid][pStatus] >= 1) {
8240 if(!isnull(params)) {
8241 new
8242 playerName[MAX_PLAYER_NAME],
8243 szMessage[128];
8244
8245 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8246
8247 format(szMessage, sizeof(szMessage), "* %s %s", playerName, params);
8248 nearByMessage(playerid, COLOR_PURPLE, szMessage);
8249 }
8250 else {
8251 return ShowSyntax(playerid, "/me [action]");
8252 }
8253 }
8254 return 1;
8255}
8256
8257CMD:shout(playerid, params[]) {
8258 if(P_DATA[playerid][pStatus] >= 1) {
8259
8260 if(isnull(params)) return ShowSyntax(playerid, "/shout [message]");
8261 new
8262 playerName[MAX_PLAYER_NAME],
8263 queryString[255],
8264 textString[128];
8265
8266 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8267 format(textString, sizeof(textString), "(shouts) \"%s!\"", params);
8268 SetPlayerChatBubble(playerid, textString, COLOR_CHATBUBBLE, 30.0, 10000);
8269 mysql_real_escape_string(textString, textString);
8270
8271 format(queryString, sizeof(queryString), "INSERT INTO chatLogs (value, playerinternalid) VALUES('%s', '%d')", textString, P_DATA[playerid][pSQL]);
8272 mysql_query(SQL, queryString);
8273 }
8274 return 1;
8275}
8276
8277CMD:m(playerid, params[]) {
8278 return cmd_megaphone(playerid, params);
8279}
8280
8281CMD:megaphone(playerid, params[]) {
8282 if(P_DATA[playerid][pStatus] >= 1) {
8283 if(groupVariables[P_DATA[playerid][pGroup]][gGroupType] == 1) {
8284 if(isnull(params)) return ShowSyntax(playerid, "/megaphone [message]");
8285 else if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle.");
8286
8287 new
8288 playerName[MAX_PLAYER_NAME],
8289 queryString[255],
8290 textString[128];
8291
8292 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8293 format(textString, sizeof(textString), "(megaphone) %s says: %s", playerName, params);
8294 nearByMessage(playerid, COLOR_HOTORANGE, textString, 50.0);
8295
8296
8297 mysql_real_escape_string(textString, textString);
8298
8299 format(queryString, sizeof(queryString), "INSERT INTO chatLogs (value, playerinternalid) VALUES('%s', '%d')", textString, P_DATA[playerid][pSQL]);
8300 mysql_query(SQL, queryString);
8301 }
8302 else SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
8303 }
8304 return 1;
8305}
8306
8307CMD:s(playerid, params[]) {
8308 return cmd_shout(playerid, params);
8309}
8310
8311CMD:b(playerid, params[]) {
8312 if(P_DATA[playerid][pStatus] >= 1) {
8313
8314 if(isnull(params)) return ShowSyntax(playerid, "/b [message]");
8315 new
8316 playerName[MAX_PLAYER_NAME],
8317 queryString[255],
8318 textString[128];
8319
8320 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8321 format(textString, sizeof(textString), "%s says: (( %s ))", playerName, params);
8322 nearByMessage(playerid, COLOR_WHITE, textString, 5.0);
8323 mysql_real_escape_string(textString, textString);
8324
8325 format(queryString, sizeof(queryString), "INSERT INTO chatLogs (value, playerinternalid) VALUES('%s', '%d')", textString, P_DATA[playerid][pSQL]);
8326 mysql_query(SQL, queryString);
8327 }
8328 return 1;
8329}
8330
8331public OnPlayerClickPlayer(playerid, clickedplayerid, source) {
8332 return 1;
8333}
8334
8335CMD:buydrink(playerid, params[]) {
8336 if(GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD >= 1) {
8337 new
8338 businessID = GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD;
8339
8340 if(businessVariables[businessID][bType] == 3) {
8341 return ShowPlayerDialog(playerid, DIALOG_BAR, DIALOG_STYLE_LIST, "SERVER: Bar Dialog", "Stock Bar Cigars ($2)\nSprunk ($3)\nBeer ($5)\nWine ($10)", "Select", "Exit");
8342 }
8343 }
8344 return 1;
8345}
8346
8347CMD:buytoys(playerid, params[]) {
8348 if(GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD >= 1) {
8349 new
8350 businessID = GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD;
8351
8352 if(businessVariables[businessID][bType] == 4) {
8353 return ShowPlayerDialog(playerid, DIALOG_SEX_SHOP, DIALOG_STYLE_LIST, "SERVER: Sex Shop Dialog", "Purple Dildo ($5)\nSmall White Vibrator ($8)\nSilver Vibrator ($10)\nLarge White Vibrator ($12)\nFlowers ($14)\n", "Select", "Exit");
8354 }
8355 }
8356 return 1;
8357}
8358
8359CMD:buyclothes(playerid, params[]) {
8360 if(GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD >= 1) {
8361
8362 new
8363 skinID,
8364 slotID,
8365 houseID = getPlayerHouseID(playerid),
8366 businessID = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
8367
8368 if(businessVariables[businessID][bType] == 2) {
8369 if(houseID >= 1) {
8370
8371 if(sscanf(params, "dd", skinID, slotID)) {
8372 return ShowSyntax(playerid, "/buyclothes [skinid] [house slot] (Skins cost $500.)");
8373 }
8374 else if(!IsValidSkin(skinID)) {
8375 return SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID.");
8376 }
8377 else if(!IsPublicSkin(skinID) && P_DATA[playerid][pGroup] != 1) {
8378 return SendClientMessage(playerid, COLOR_GREY, "You can't purchase this skin.");
8379 }
8380 else if(slotID < 1 || slotID > 5) {
8381 return SendClientMessage(playerid, COLOR_GREY, "Invalid slot specified.");
8382 }
8383 else if(P_DATA[playerid][pMoney] >= 500) {
8384 P_DATA[playerid][pMoney] -= 500;
8385 businessVariables[businessID][bVault] += 500;
8386 P_DATA[playerid][pSkin] = skinID;
8387 houseVariables[houseID][hWardrobe][slotID - 1] = skinID;
8388 return SetPlayerSkin(playerid, skinID);
8389 }
8390 else SendClientMessage(playerid, COLOR_GREY, "You don't have $500 available.");
8391 }
8392 else if(!isnull(params)) {
8393
8394 skinID = strval(params);
8395
8396 if(!IsValidSkin(skinID)) {
8397 return SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID.");
8398 }
8399 else if(!IsPublicSkin(skinID) && P_DATA[playerid][pGroup] != 1) {
8400 return SendClientMessage(playerid, COLOR_GREY, "You can't purchase this skin.");
8401 }
8402 else if(P_DATA[playerid][pMoney] >= 500) {
8403 P_DATA[playerid][pMoney] -= 500;
8404 businessVariables[businessID][bVault] += 500;
8405 P_DATA[playerid][pSkin] = skinID;
8406 return SetPlayerSkin(playerid, skinID);
8407 }
8408 else SendClientMessage(playerid, COLOR_GREY, "You don't have $500 available.");
8409 }
8410 else ShowSyntax(playerid, "/buyclothes [skinid] (Skins cost $500.)");
8411 }
8412 }
8413 return 1;
8414}
8415
8416CMD:buyfood(playerid, params[]) {
8417 if(GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD >= 1) {
8418 new
8419 businessID = GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD;
8420
8421 switch(businessVariables[businessID][bType]) {
8422 case 7: ShowPlayerDialog(playerid, DIALOG_FOOD_ONE, DIALOG_STYLE_LIST, "SERVER: Food Vendor", "Cluckin' Little Meal ($10)\nCluckin' Big Meal ($25)\nCluckin' Huge Meal ($50)\n", "Select", "Exit");
8423 case 8: ShowPlayerDialog(playerid, DIALOG_FOOD_TWO, DIALOG_STYLE_LIST, "SERVER: Food Vendor", "Moo Kids Meal ($10)\nBeef Tower ($25)\nMeat Stack ($50)\n", "Select", "Exit");
8424 case 9: ShowPlayerDialog(playerid, DIALOG_FOOD_THREE, DIALOG_STYLE_LIST, "SERVER: Food Vendor", "Buster ($10)\nDouble Deluxe ($25)\nFull Rack ($50)\n", "Select", "Exit");
8425 }
8426 }
8427 return 1;
8428}
8429
8430CMD:buy(playerid, params[]) {
8431 if(GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD >= 1) {
8432 new
8433 businessID = GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD;
8434
8435 switch(businessVariables[businessID][bType]) {
8436 case 1: ShowPlayerDialog(playerid, DIALOG_TWENTYFOURSEVEN, DIALOG_STYLE_LIST, "SERVER: 24/7", "Rope ($5)\nCellphone ($100)\nPhone Book ($75)\nPhone Credit ($25)\nWalkie Talkie ($750)", "Select", "Exit");
8437 }
8438 }
8439 return 1;
8440}
8441
8442CMD:buyfightstyle(playerid, params[]) {
8443 if(GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD >= 1) {
8444 new
8445 businessID = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
8446
8447 switch(businessVariables[businessID][bType]) {
8448 case 6: ShowPlayerDialog(playerid, DIALOG_FIGHTSTYLE, DIALOG_STYLE_LIST, "SERVER: Fighting Styles", "Boxing ($10,000)\nKung Fu ($25,000)\nKnee Head ($15,000)\nGrab & Kick ($12,000)\nElbow ($10,000)\nGhetto ($5,000)", "Select", "Cancel");
8449 }
8450 }
8451 return 1;
8452}
8453
8454CMD:changeclothes(playerid, params[]) {
8455
8456 new
8457 slot = strval(params),
8458 houseID = getPlayerHouseID(playerid),
8459 string[64],
8460 playerName[MAX_PLAYER_NAME];
8461
8462 if(isnull(params))
8463 return ShowSyntax(playerid, "/changeclothes [slot 1-5]");
8464
8465 if(getPlayerHouseID(playerid) >= 1) {
8466 if(GetPlayerVirtualWorld(playerid) == HOUSE_VIRTUAL_WORLD + houseID) {
8467 if(slot >= 1 && slot <= 5) {
8468 if(houseVariables[houseID][hWardrobe][slot - 1] != 0) {
8469
8470 SetPlayerSkin(playerid, houseVariables[houseID][hWardrobe][slot - 1]);
8471 P_DATA[playerid][pSkin] = houseVariables[houseID][hWardrobe][slot - 1];
8472
8473 format(string, sizeof(string), "You have changed your clothing (skin %d, slot %d).", houseVariables[houseID][hWardrobe][slot - 1], slot);
8474 SendClientMessage(playerid, COLOR_WHITE, string);
8475
8476 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8477 format(string, sizeof(string), "* %s dresses in their new clothing.", playerName);
8478 nearByMessage(playerid, COLOR_PURPLE, string);
8479 }
8480 else SendClientMessage(playerid, COLOR_GREY, "You don't have any clothing in that slot.");
8481 }
8482 else SendClientMessage(playerid, COLOR_GREY, "Invalid slot specified.");
8483 }
8484 else SendClientMessage(playerid, COLOR_GREY, "You're not inside your house.");
8485 }
8486 else SendClientMessage(playerid, COLOR_GREY, "You don't have a house.");
8487 return 1;
8488}
8489
8490CMD:hbalance(playerid, params[]) {
8491 new
8492 houseID = getPlayerHouseID(playerid), // So we don't have to loop every single time... It's worth the 4 bytes!
8493 x;
8494
8495 if(getPlayerHouseID(playerid) >= 1) {
8496 new
8497 messageString[128];
8498
8499 format(messageString, sizeof(messageString), "Money: $%d | Materials: %d", houseVariables[houseID][hMoney], houseVariables[houseID][hMaterials]);
8500
8501 for(new i; i < 5; i++) {
8502 if(houseVariables[houseID][hWeapons][i] > 0) {
8503 if(x == 0) format(messageString, sizeof(messageString),"%s | Weapons: %s (slot %d)", messageString, WeaponNames[houseVariables[houseID][hWeapons][i]], i);
8504 else format(messageString, sizeof(messageString),"%s, %s (slot %d)", messageString, WeaponNames[houseVariables[houseID][hWeapons][i]], i);
8505 x++;
8506 }
8507 }
8508 SendClientMessage(playerid, COLOR_WHITE, messageString);
8509 }
8510 else {
8511 return SendClientMessage(playerid, COLOR_GREY, "You don't have a house.");
8512 }
8513 return 1;
8514}
8515
8516CMD:hwithdraw(playerid, params[]) {
8517 new
8518 houseID = getPlayerHouseID(playerid); // So we don't have to loop every single time... It's worth the 4 bytes!
8519
8520 if(getPlayerHouseID(playerid) >= 1) {
8521 if(GetPlayerVirtualWorld(playerid) == HOUSE_VIRTUAL_WORLD+houseID) {
8522 new
8523 amount,
8524 playerName[MAX_PLAYER_NAME],
8525 houseOperation[72]; // For formatting afterwards.
8526
8527 if(sscanf(params, "s[32]d", houseOperation, amount))
8528 return ShowSyntax(playerid, "/hwithdraw [money/materials] [amount]");
8529
8530 if(!strcmp(houseOperation, "money", true)) {
8531 if(houseVariables[houseID][hMoney] >= amount) {
8532 if(amount >= 1 && amount < 60000000) {
8533 houseVariables[houseID][hMoney] -= amount;
8534 P_DATA[playerid][pMoney] += amount;
8535
8536 if(houseVariables[houseID][hMoney] < 1)
8537 houseVariables[houseID][hMoney] = 0;
8538
8539 if(P_DATA[playerid][pMoney] < 1)
8540 P_DATA[playerid][pMoney] = 0;
8541
8542 format(houseOperation, sizeof(houseOperation), "You have withdrawn $%d from your safe.", amount);
8543 SendClientMessage(playerid, COLOR_WHITE, houseOperation);
8544
8545 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8546 format(houseOperation, sizeof(houseOperation), "* %s withdraws $%d from their safe.", playerName, amount);
8547 nearByMessage(playerid, COLOR_PURPLE, houseOperation);
8548 }
8549 else {
8550 return SendClientMessage(playerid, COLOR_GREY, "(error) 01x03");
8551 }
8552 }
8553 }
8554 else if(!strcmp(houseOperation, "materials", true)) {
8555 if(houseVariables[houseID][hMaterials] >= amount) {
8556 if(amount >= 1 && amount < 60000000) {
8557 houseVariables[houseID][hMaterials] -= amount;
8558 P_DATA[playerid][pMaterials] += amount;
8559
8560 if(houseVariables[houseID][hMaterials] < 1)
8561 houseVariables[houseID][hMaterials] = 0;
8562
8563 if(P_DATA[playerid][pMaterials] < 1)
8564 P_DATA[playerid][pMaterials] = 0;
8565
8566 format(houseOperation, sizeof(houseOperation), "You have withdrawn %d materials from your safe.", amount);
8567 SendClientMessage(playerid, COLOR_WHITE, houseOperation);
8568
8569 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8570 format(houseOperation, sizeof(houseOperation), "* %s withdraws %d materials from their safe.", playerName, amount);
8571 nearByMessage(playerid, COLOR_PURPLE, houseOperation);
8572 }
8573 else {
8574 return SendClientMessage(playerid, COLOR_GREY, "(error) 01x04");
8575 }
8576 }
8577 }
8578 else {
8579 return ShowSyntax(playerid, "/hwithdraw [money/materials] [amount]");
8580 }
8581 }
8582 }
8583 else {
8584 return SendClientMessage(playerid, COLOR_GREY, "You're not inside your house.");
8585 }
8586 return 1;
8587}
8588
8589CMD:hdeposit(playerid, params[]) {
8590 new
8591 houseID = getPlayerHouseID(playerid); // So we don't have to loop every single time... It's worth the 4 bytes!
8592
8593 if(getPlayerHouseID(playerid) >= 1) {
8594 if(GetPlayerVirtualWorld(playerid) == HOUSE_VIRTUAL_WORLD+houseID) {
8595 new
8596 amount,
8597 playerName[MAX_PLAYER_NAME],
8598 houseOperation[72]; // For formatting afterwards.
8599
8600 if(sscanf(params, "s[32]d", houseOperation, amount)) {
8601 return ShowSyntax(playerid, "/hdeposit [money/materials] [amount]");
8602 }
8603 else {
8604 if(!strcmp(houseOperation, "money", true)) {
8605 if(P_DATA[playerid][pMoney] >= amount) {
8606 if(amount >= 1 && amount < 60000000) {
8607 houseVariables[houseID][hMoney] += amount;
8608 P_DATA[playerid][pMoney] -= amount;
8609
8610 if(houseVariables[houseID][hMoney] < 1) houseVariables[houseID][hMoney] = 0;
8611 if(P_DATA[playerid][pMoney] < 1) P_DATA[playerid][pMoney] = 0;
8612
8613 format(houseOperation, sizeof(houseOperation), "You have deposited $%d in your safe.", amount);
8614 SendClientMessage(playerid, COLOR_WHITE, houseOperation);
8615
8616 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8617 format(houseOperation, sizeof(houseOperation), "* %s deposits $%d in their safe.", playerName, amount);
8618 nearByMessage(playerid, COLOR_PURPLE, houseOperation);
8619
8620 }
8621 else {
8622 return SendClientMessage(playerid, COLOR_GREY, "(error) 01x01");
8623 }
8624 }
8625 }
8626 else if(!strcmp(houseOperation, "materials", true)) {
8627 if(P_DATA[playerid][pMaterials] >= amount) {
8628 if(amount >= 1 && amount < 60000000) {
8629 houseVariables[houseID][hMaterials] += amount;
8630 P_DATA[playerid][pMaterials] -= amount;
8631
8632 if(houseVariables[houseID][hMaterials] < 1) houseVariables[houseID][hMaterials] = 0;
8633 if(P_DATA[playerid][pMaterials] < 1) P_DATA[playerid][pMaterials] = 0;
8634
8635 format(houseOperation, sizeof(houseOperation), "You have deposited %d materials in your safe.", amount);
8636 SendClientMessage(playerid, COLOR_WHITE, houseOperation);
8637
8638 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
8639 format(houseOperation, sizeof(houseOperation), "* %s deposits %d materials in their safe.", playerName, amount);
8640 nearByMessage(playerid, COLOR_PURPLE, houseOperation);
8641 }
8642 else {
8643 return SendClientMessage(playerid, COLOR_GREY, "(error) 01x02");
8644 }
8645 }
8646 }
8647 else {
8648 return ShowSyntax(playerid, "/hdeposit [money/materials] [amount]");
8649 }
8650 }
8651 }
8652 else {
8653 return SendClientMessage(playerid, COLOR_GREY, "You're not inside your house.");
8654 }
8655 }
8656 return 1;
8657}
8658
8659CMD:btype(playerid, params[]) {
8660 if(P_DATA[playerid][pAdmin] >= 4) {
8661 new
8662 bCID,
8663 bCType;
8664
8665 if(sscanf(params, "dd", bCID, bCType)) {
8666 ShowSyntax(playerid, "/btype [businessid] [type]");
8667 SendClientMessage(playerid, COLOR_GREY, "Types: 1 - 24/7 | 2 - Clothing Store | 3 - Bar | 4 - Sex Shop | 5 - Vehicle Dealership | 6 - Gym");
8668 SendClientMessage(playerid, COLOR_GREY, "Types: 7 - Cluckin' Bell | 8 - Burger Shot | 9 - Pizza Stack ");
8669 return 1;
8670 }
8671
8672 if(!isnull(businessVariables[bCID][bOwner])) {
8673 new
8674 szMessage[64];
8675
8676 format(szMessage, sizeof(szMessage), "You have changed business ID %d to type %d.", bCID, bCType);
8677 SendClientMessage(playerid, COLOR_WHITE, szMessage);
8678
8679 businessVariables[bCID][bType] = bCType;
8680 saveBusiness(bCID);
8681 return 1;
8682 }
8683
8684 return SendClientMessage(playerid, COLOR_GREY, "Invalid business ID.");
8685 }
8686 return 1;
8687}
8688
8689CMD:createbusiness(playerid, params[]) {
8690 if(P_DATA[playerid][pAdmin] >= 4) {
8691 new
8692 Float: floatPos[3];
8693
8694 if(!strcmp(params, "exterior", true)) {
8695 GetPlayerPos(playerid, floatPos[0], floatPos[1], floatPos[2]);
8696
8697 SetPVarFloat(playerid, "pBeX", floatPos[0]);
8698 SetPVarFloat(playerid, "pBeY", floatPos[1]);
8699 SetPVarFloat(playerid, "pBeZ", floatPos[2]);
8700
8701 SetPVarInt(playerid, "bExt", 1);
8702
8703 SendClientMessage(playerid, COLOR_WHITE, "Business exterior position configured.");
8704 }
8705 else if(!strcmp(params, "interior", true)) {
8706 GetPlayerPos(playerid, floatPos[0], floatPos[1], floatPos[2]);
8707
8708 SetPVarFloat(playerid, "pBiX", floatPos[0]);
8709 SetPVarFloat(playerid, "pBiY", floatPos[1]);
8710 SetPVarFloat(playerid, "pBiZ", floatPos[2]);
8711
8712 SetPVarInt(playerid, "pBiID", GetPlayerInterior(playerid));
8713 SetPVarInt(playerid, "bInt", 1);
8714
8715 SendClientMessage(playerid, COLOR_WHITE, "Business interior position configured.");
8716 }
8717 else if(!strcmp(params, "Complete", true)) {
8718 if(GetPVarInt(playerid, "bExt") != 1 || GetPVarInt(playerid, "bInt") != 1)
8719 return SendClientMessage(playerid, COLOR_GREY, "You haven't configured either the business exterior or interior. Creation attempt failed.");
8720
8721 new
8722 i,
8723 labelString[128], Cache:r;
8724
8725 r = mysql_query(SQL, "INSERT INTO businesses (businessOwner, businessName) VALUES('Nobody', 'New Business')", true);
8726 i = cache_insert_id();
8727 cache_delete(r);
8728
8729 if(isnull(businessVariables[i][bOwner])) {
8730 businessVariables[i][bExteriorPos][0] = GetPVarFloat(playerid, "pBeX");
8731 businessVariables[i][bExteriorPos][1] = GetPVarFloat(playerid, "pBeY");
8732 businessVariables[i][bExteriorPos][2] = GetPVarFloat(playerid, "pBeZ");
8733
8734 businessVariables[i][bInteriorPos][0] = GetPVarFloat(playerid, "pBiX");
8735 businessVariables[i][bInteriorPos][1] = GetPVarFloat(playerid, "pBiY");
8736 businessVariables[i][bInteriorPos][2] = GetPVarFloat(playerid, "pBiZ");
8737
8738 businessVariables[i][bInterior] = GetPVarInt(playerid, "pBiID");
8739
8740 format(businessVariables[i][bOwner], MAX_PLAYER_NAME, "Nobody");
8741 format(businessVariables[i][bName], 32, "Nothing");
8742
8743 businessVariables[i][bLocked] = 1;
8744
8745 format(labelString, sizeof(labelString), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\n(locked)", businessVariables[i][bName], i, businessVariables[i][bPrice]);
8746
8747 businessVariables[i][bLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, businessVariables[i][bExteriorPos][0], businessVariables[i][bExteriorPos][1], businessVariables[i][bExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
8748 businessVariables[i][bPickupID] = CreateDynamicPickup(1239, 23, businessVariables[i][bExteriorPos][0], businessVariables[i][bExteriorPos][1], businessVariables[i][bExteriorPos][2], 0, 0, -1, 250);
8749
8750 saveBusiness(i);
8751
8752 DeletePVar(playerid, "pBeX");
8753 DeletePVar(playerid, "pBeY");
8754 DeletePVar(playerid, "pBeZ");
8755 DeletePVar(playerid, "pBiX");
8756 DeletePVar(playerid, "pBeY");
8757 DeletePVar(playerid, "pBeZ");
8758 DeletePVar(playerid, "pBiID");
8759
8760 SetPlayerInterior(playerid, 0);
8761 SetPlayerPos(playerid, businessVariables[i][bExteriorPos][0], businessVariables[i][bExteriorPos][1], businessVariables[i][bExteriorPos][2]);
8762 systemVariables[businessCount]++;
8763 SendClientMessage(playerid, COLOR_WHITE, "Business created!");
8764 }
8765 if(!isnull(businessVariables[i][bOwner])) return SendClientMessage(playerid, COLOR_WHITE, "There are no available business slots left.");
8766
8767 } else
8768 return ShowSyntax(playerid, "/createbusiness [interior/exit/complete]");
8769 }
8770 else OnlyAdmin
8771 return 1;
8772}
8773
8774CMD:savevehicle(playerid, params[]) {
8775 if(P_DATA[playerid][pAdmin] >= 4) {
8776 if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be in a vehicle to save it.");
8777 if(GetPVarInt(playerid, "sCc") == 1) {
8778
8779 new
8780 i,
8781 queryString[255],
8782 Float: vPos[4]; // x, y, z + z angle
8783
8784 GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
8785 GetVehicleZAngle(GetPlayerVehicleID(playerid), vPos[3]);
8786
8787 new
8788 Cache: r;
8789
8790 format(queryString, sizeof(queryString), "INSERT INTO vehicles (vehicleModelID, vehiclePosX, vehiclePosY, vehiclePosZ, vehiclePosRotation) VALUES('%d', '%f', '%f', '%f', '%f')", GetVehicleModel(GetPlayerVehicleID(playerid)), vPos[0], vPos[1], vPos[2], vPos[3]);
8791 r = mysql_query(SQL, queryString);
8792 i = cache_insert_id();
8793 cache_delete(r);
8794
8795 SendClientMessage(playerid, COLOR_WHITE, "Vehicle saved!");
8796
8797 vehicleVariables[i][vVehicleModelID] = GetVehicleModel(GetPlayerVehicleID(playerid));
8798 vehicleVariables[i][vVehiclePosition][0] = vPos[0];
8799 vehicleVariables[i][vVehiclePosition][1] = vPos[1];
8800 vehicleVariables[i][vVehiclePosition][2] = vPos[2];
8801
8802 vehicleVariables[i][vVehicleRotation] = vPos[3];
8803 vehicleVariables[i][vVehicleGroup] = 0;
8804
8805 vehicleVariables[i][vVehicleScriptID] = GetPlayerVehicleID(playerid);
8806
8807 for(new x = 0; x < MAX_VEHICLES; x++) {
8808 if(AdminSpawnedVehicles[x] == GetPlayerVehicleID(playerid)) {
8809 AdminSpawnedVehicles[x] = 0; // If the vehicle is admin-spawned, we can remove it from the array and move it to the vehicle script enum/arrays.
8810 }
8811 }
8812 systemVariables[vehicleCounts][2]--;
8813 systemVariables[vehicleCounts][0]++;
8814 DeletePVar(playerid, "sCc");
8815 }
8816 else {
8817 SetPVarInt(playerid, "sCc", 1);
8818 return SendClientMessage(playerid, COLOR_GREY, "Are you sure you wish to save this vehicle? Re-type the command to verify your action is legitimate.");
8819 }
8820 }
8821 return 1;
8822}
8823
8824CMD:businessname(playerid, params[]) {
8825 if(getPlayerBusinessID(playerid) >= 1) {
8826 if(isnull(params))
8827 return ShowSyntax(playerid, "/businessname [businessname]");
8828
8829 if(strlen(params) >= 43 || strlen(params) < 1)
8830 return SendClientMessage(playerid, COLOR_GREY, "Invalid name length (1-42).");
8831
8832 new
8833 result[92],
8834 x = getPlayerBusinessID(playerid);
8835
8836 format(result, sizeof(result), "You have changed the name of your business to '%s'.", params);
8837 SendClientMessage(playerid, COLOR_WHITE, result);
8838
8839 mysql_escape_string(params, params, SQL, 42);
8840 strcpy(businessVariables[x][bName], params, 20);
8841
8842 switch(businessVariables[x][bLocked]) {
8843 case 1: {
8844 format(result, sizeof(result), "%s\n(Business %d - owned by %s)\n\n(locked)", businessVariables[x][bName], x, businessVariables[x][bOwner]);
8845 }
8846 case 0: {
8847 format(result, sizeof(result), "%s\n(Business %d - owned by %s)\n\nPress CROUCH to enter", businessVariables[x][bName], x, businessVariables[x][bOwner]);
8848 }
8849 }
8850
8851 UpdateDynamic3DTextLabelText(businessVariables[x][bLabelID], COLOR_YELLOW, result);
8852 }
8853 return 1;
8854}
8855
8856CMD:createhouse(playerid, params[]) {
8857 if(P_DATA[playerid][pAdmin] >= 4) {
8858 new
8859 Float: floatPos[3];
8860
8861 if(!strcmp(params, "Exterior", true)) {
8862 GetPlayerPos(playerid, floatPos[0], floatPos[1], floatPos[2]);
8863
8864 SetPVarFloat(playerid, "pHeX", floatPos[0]);
8865 SetPVarFloat(playerid, "pHeY", floatPos[1]);
8866 SetPVarFloat(playerid, "pHeZ", floatPos[2]);
8867
8868 SetPVarInt(playerid, "hExt", 1);
8869
8870 SendClientMessage(playerid, COLOR_WHITE, "House exterior position configured.");
8871 } else if(!strcmp(params, "Interior", true)) {
8872 GetPlayerPos(playerid, floatPos[0], floatPos[1], floatPos[2]);
8873
8874 SetPVarFloat(playerid, "pHiX", floatPos[0]);
8875 SetPVarFloat(playerid, "pHiY", floatPos[1]);
8876 SetPVarFloat(playerid, "pHiZ", floatPos[2]);
8877
8878 SetPVarInt(playerid, "pHiID", GetPlayerInterior(playerid));
8879 SetPVarInt(playerid, "hInt", 1);
8880
8881 SendClientMessage(playerid, COLOR_WHITE, "House interior position configured.");
8882 } else if(!strcmp(params, "Complete", true)) {
8883 if(GetPVarInt(playerid, "hExt") != 1 || GetPVarInt(playerid, "hInt") != 1)
8884 return SendClientMessage(playerid, COLOR_GREY, "You haven't configured either the house exterior or interior. Creation attempt failed.");
8885
8886 new
8887 i,
8888 labelString[96],
8889 Cache: r;
8890
8891 r = mysql_query(SQL, "INSERT INTO houses (houseOwner, houseLocked) VALUES('Nobody', '1')");
8892 i = cache_insert_id();
8893 cache_delete(r);
8894
8895 if(isnull(houseVariables[i][hHouseOwner])) {
8896 houseVariables[i][hHouseExteriorPos][0] = GetPVarFloat(playerid, "pHeX");
8897 houseVariables[i][hHouseExteriorPos][1] = GetPVarFloat(playerid, "pHeY");
8898 houseVariables[i][hHouseExteriorPos][2] = GetPVarFloat(playerid, "pHeZ");
8899
8900 houseVariables[i][hHouseInteriorPos][0] = GetPVarFloat(playerid, "pHiX");
8901 houseVariables[i][hHouseInteriorPos][1] = GetPVarFloat(playerid, "pHiY");
8902 houseVariables[i][hHouseInteriorPos][2] = GetPVarFloat(playerid, "pHiZ");
8903
8904 houseVariables[i][hHouseExteriorID] = 0;
8905 houseVariables[i][hHouseInteriorID] = GetPVarInt(playerid, "pHiID");
8906
8907 houseVariables[i][hHouseLocked] = 1;
8908
8909 format(houseVariables[i][hHouseOwner], MAX_PLAYER_NAME, "Nobody");
8910 format(labelString, sizeof(labelString), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\n(locked)", i, houseVariables[i][hHousePrice]);
8911
8912 houseVariables[i][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[i][hHouseExteriorPos][0], houseVariables[i][hHouseExteriorPos][1], houseVariables[i][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
8913 houseVariables[i][hPickupID] = CreateDynamicPickup(1273, 23, houseVariables[i][hHouseExteriorPos][0], houseVariables[i][hHouseExteriorPos][1], houseVariables[i][hHouseExteriorPos][2], 0, 0, -1, 250);
8914
8915 saveHouse(i);
8916
8917 DeletePVar(playerid, "pHeX");
8918 DeletePVar(playerid, "pHeY");
8919 DeletePVar(playerid, "pHeZ");
8920 DeletePVar(playerid, "pHiX");
8921 DeletePVar(playerid, "pHeY");
8922 DeletePVar(playerid, "pHeZ");
8923 DeletePVar(playerid, "pHiID");
8924
8925 SetPlayerInterior(playerid, 0);
8926 SetPlayerPos(playerid, houseVariables[i][hHouseExteriorPos][0], houseVariables[i][hHouseExteriorPos][1], houseVariables[i][hHouseExteriorPos][2]);
8927
8928 systemVariables[houseCount]++;
8929 return SendClientMessage(playerid, COLOR_WHITE, "House created!");
8930 } else
8931 return SendClientMessage(playerid, COLOR_WHITE, "There are no available house slots left, sorry!");
8932 } else
8933 return 1;
8934 }
8935 else OnlyAdmin
8936 return 1;
8937}
8938
8939CMD:spawnweapon(playerid, params[]) {
8940 if(P_DATA[playerid][pAdmin] < 3) return OnlyAdmin
8941 new weaponID,userID;
8942 if(sscanf(params, "ud", userID, weaponID))
8943 return ShowSyntax(playerid, "/spawnweapon [playerid] [weaponid]");
8944 if(userID != INVALID_PLAYER_ID) {
8945
8946 new
8947 string[63],
8948 playerName[MAX_PLAYER_NAME];
8949
8950 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
8951
8952 if(weaponID == 19) {
8953 if(GetPlayerState(userID) != 1) {
8954 return SendClientMessage(playerid, COLOR_GREY, "The specified player must be on foot.");
8955 }
8956 else {
8957 format(string, sizeof(string), "You have given %s a jetpack.", playerName);
8958 SendClientMessage(playerid, COLOR_WHITE, string);
8959 P_DATA[userID][pJetpack] = 1;
8960 return SetPlayerSpecialAction(userID, SPECIAL_ACTION_USEJETPACK);
8961 }
8962 }
8963 else {
8964 format(string, sizeof(string), "You have given %s a %s.", playerName, WeaponNames[weaponID]);
8965 SendClientMessage(playerid, COLOR_WHITE, string);
8966 return givePlayerValidWeapon(userID, weaponID);
8967 }
8968 }
8969 else SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
8970 return 1;
8971}
8972
8973CMD:get(playerid, params[]) {
8974 if(P_DATA[playerid][pAdmin] >= 1) {
8975 new
8976 userID;
8977
8978 if(sscanf(params, "u", userID)) {
8979 return ShowSyntax(playerid, "/get [playerid]");
8980 }
8981 else {
8982 if(userID == INVALID_PLAYER_ID)
8983 return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
8984
8985 if(P_DATA[playerid][pAdmin] >= P_DATA[userID][pAdmin]) {
8986 new
8987 messageString[64],
8988 playerName[MAX_PLAYER_NAME],
8989 Float: fPos[3];
8990
8991 GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
8992 if(GetPlayerState(userID) == 2) {
8993
8994 SetVehiclePos(GetPlayerVehicleID(userID), fPos[0], fPos[1]+2, fPos[2]);
8995 LinkVehicleToInterior(GetPlayerVehicleID(userID), GetPlayerInterior(playerid));
8996 SetVehicleVirtualWorld(GetPlayerVehicleID(userID), GetPlayerVirtualWorld(playerid));
8997 }
8998
8999 else SetPlayerPos(userID, fPos[0], fPos[1]+2, fPos[2]); // If they're driving a vehicle, it gets the vehicle; otherwise, it warps them only.
9000
9001 SetPlayerInterior(userID, GetPlayerInterior(playerid));
9002 SetPlayerVirtualWorld(userID, GetPlayerVirtualWorld(playerid));
9003
9004 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
9005 format(messageString, sizeof(messageString), "You have teleported %s to you.", playerName);
9006 SendClientMessage(playerid, COLOR_WHITE, messageString);
9007 }
9008 else SendClientMessage(playerid, COLOR_GREY, "You can't teleport a higher level administrator - request them to teleport to you.");
9009 }
9010 }
9011
9012 return 1;
9013}
9014
9015CMD:bprice(playerid, params[]) {
9016 if(P_DATA[playerid][pAdmin] >= 3) {
9017 new
9018 businessID,
9019 businessPrice;
9020
9021 if(sscanf(params, "dd", businessID, businessPrice)) {
9022 return ShowSyntax(playerid, "/bprice [businessid] [price]");
9023 }
9024 else {
9025 if(businessID < 1 || businessID > MAX_BUSINESSES) {
9026 return SendClientMessage(playerid, COLOR_GREY, "Invalid business ID.");
9027 }
9028 else {
9029 new
9030 szMessage[128];
9031
9032 format(szMessage, sizeof(szMessage), "You have set business %d's price to $%d.", businessID, businessPrice);
9033 SendClientMessage(playerid, COLOR_WHITE, szMessage);
9034
9035 businessVariables[businessID][bPrice] = businessPrice;
9036
9037 if(!strcmp(businessVariables[businessID][bOwner], "Nobody", true) && strlen(businessVariables[businessID][bOwner]) >= 1) {
9038 switch(businessVariables[businessID][bLocked]) {
9039 case 1: format(szMessage, sizeof(szMessage), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\n(locked)", businessVariables[businessID][bName], businessID, businessVariables[businessID][bPrice]);
9040 default: format(szMessage, sizeof(szMessage), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\nPress CROUCH to enter.", businessVariables[businessID][bName], businessID, businessVariables[businessID][bPrice]);
9041 }
9042
9043 UpdateDynamic3DTextLabelText(businessVariables[businessID][bLabelID], COLOR_YELLOW, szMessage);
9044 }
9045 }
9046 }
9047 }
9048 return 1;
9049}
9050
9051CMD:hprice(playerid, params[]) {
9052 if(P_DATA[playerid][pAdmin] >= 3) {
9053 new
9054 houseID,
9055 housePrice;
9056
9057 if(sscanf(params, "dd", houseID, housePrice))
9058 return ShowSyntax(playerid, "/hprice [houseid] [price]");
9059
9060 if(houseID < 1 || houseID > MAX_HOUSES)
9061 return SendClientMessage(playerid, COLOR_GREY, "Invalid house ID.");
9062
9063 new
9064 szMessage[128];
9065
9066 format(szMessage, sizeof(szMessage), "You have set house %d's price to $%d.", houseID, housePrice);
9067 SendClientMessage(playerid, COLOR_WHITE, szMessage);
9068
9069 houseVariables[houseID][hHousePrice] = housePrice;
9070
9071 if(!strcmp(houseVariables[houseID][hHouseOwner], "Nobody", true) && strlen(houseVariables[houseID][hHouseOwner]) >= 1) {
9072 switch(houseVariables[houseID][hHouseLocked]) {
9073 case 0: format(szMessage, sizeof(szMessage), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\n(locked)", houseID, houseVariables[houseID][hHousePrice]);
9074 default: format(szMessage, sizeof(szMessage), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\nPress CROUCH to enter.", houseID, houseVariables[houseID][hHousePrice]);
9075 }
9076
9077 UpdateDynamic3DTextLabelText(houseVariables[houseID][hLabelID], COLOR_YELLOW, szMessage);
9078 }
9079 }
9080 return 1;
9081}
9082CMD:gotolv(playerid, params[]) {
9083 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
9084 if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid), 1699.2, 1435.1, 10.7);
9085 else SetPlayerPos(playerid, 1699.2,1435.1, 10.7);
9086 SetPlayerInterior(playerid,0);
9087 SetPlayerVirtualWorld(playerid,0);
9088 return 1;
9089}
9090CMD:gotosf(playerid, params[]) {
9091 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
9092 if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid), -1417.0,-295.8,14.1);
9093 else SetPlayerPos(playerid, -1417.0,-295.8,14.1);
9094 SetPlayerInterior(playerid,0);
9095 SetPlayerVirtualWorld(playerid,0);
9096 return 1;
9097}
9098CMD:gotols(playerid, params[]) {
9099 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
9100 if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid), 1529.6,-1691.2,13.3);
9101 else SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
9102 SetPlayerInterior(playerid,0);
9103 SetPlayerVirtualWorld(playerid,0);
9104 return 1;
9105}
9106CMD:gotospawn(playerid,params[]) {
9107 if(P_DATA[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_LG3,"You are not an admin");
9108 if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid), 1699.2, 1435.1, 10.7);
9109 else SetPlayerPos(playerid, 1699.2, 1435.1, 10.7);
9110 SetPlayerInterior(playerid,0);
9111 SetPlayerVirtualWorld(playerid,0);
9112 return 1;
9113}
9114CMD:gotods(playerid,params[]) {
9115 if(P_DATA[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_LG3,"You are not an admin");
9116 if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid), 2200.8110,1394.6212,11.0625);
9117 else SetPlayerPos(playerid, 2200.8110,1394.6212,11.0625);
9118 SetPlayerInterior(playerid,0);
9119 SetPlayerVirtualWorld(playerid,0);
9120 return 1;
9121}
9122CMD:goto(playerid, params[]) {
9123 if(P_DATA[playerid][pAdmin] >= 1) {
9124 new
9125 userID;
9126
9127 if(sscanf(params, "u", userID)) {
9128 return ShowSyntax(playerid, "/goto [playerid]");
9129 }
9130 else {
9131 if(!IsPlayerConnected(userID)) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
9132
9133 new
9134 messageString[64],
9135 playerName[MAX_PLAYER_NAME],
9136 Float: fPos[3];
9137
9138 GetPlayerPos(userID, fPos[0], fPos[1], fPos[2]);
9139
9140 if(GetPlayerState(playerid) == 2) {
9141
9142 SetVehiclePos(GetPlayerVehicleID(playerid), fPos[0], fPos[1]+2, fPos[2]);
9143
9144 LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(userID));
9145 SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(userID));
9146 }
9147
9148 else SetPlayerPos(playerid, fPos[0], fPos[1]+2, fPos[2]);
9149
9150 SetPlayerInterior(playerid, GetPlayerInterior(userID));
9151 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(userID));
9152
9153 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
9154
9155 format(messageString, sizeof(messageString), "You have teleported to %s.", playerName);
9156 SendClientMessage(playerid, COLOR_WHITE, messageString);
9157 }
9158 }
9159 else OnlyAdmin
9160 return 1;
9161}
9162
9163CMD:setleader(playerid, params[]) {
9164 if(P_DATA[playerid][pAdmin] >= 3) {
9165 new
9166 groupID,
9167 userID;
9168
9169 if(sscanf(params, "ud", userID, groupID)) {
9170 return ShowSyntax(playerid, "/setleader [playerid] [groupid]");
9171 }
9172 else {
9173 if(groupID < 1 || groupID > MAX_GROUPS) return SendClientMessage(playerid, COLOR_GREY, "Invalid group ID.");
9174
9175 P_DATA[userID][pGroup] = groupID;
9176 P_DATA[userID][pGroupRank] = 6;
9177
9178 new
9179 playerName[MAX_PLAYER_NAME],
9180 string[128];
9181
9182 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
9183
9184 format(string, sizeof(string), "You have set %s to lead group %s.", playerName, groupVariables[groupID][gGroupName]);
9185 SendClientMessage(playerid, COLOR_WHITE, string);
9186
9187 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
9188
9189 format(string, sizeof(string), "Administrator %s has set you to lead group %s.", playerName, groupVariables[groupID][gGroupName]);
9190 SendClientMessage(userID, COLOR_WHITE, string);
9191 }
9192 }
9193 else OnlyAdmin
9194 return 1;
9195}
9196CMD:buybusiness(playerid, params[]) {
9197 if(P_DATA[playerid][pStatus] >= 1) {
9198 for(new x = 0; x < MAX_BUSINESSES; x++) {
9199 if(IsPlayerInRangeOfPoint(playerid, 5, businessVariables[x][bExteriorPos][0], businessVariables[x][bExteriorPos][1], businessVariables[x][bExteriorPos][2])) {
9200 if(!strcmp(businessVariables[x][bOwner], "Nobody", true)) {
9201 if(businessVariables[x][bPrice] == -1) return SendClientMessage(playerid, COLOR_GREY, "This business was blocked from being purchased by an administrator.");
9202 if(getPlayerBusinessID(playerid) >= 1) return SendClientMessage(playerid, COLOR_GREY, "You already own a business.");
9203 if(P_DATA[playerid][pMoney] >= businessVariables[x][bPrice]) {
9204 P_DATA[playerid][pMoney] -= businessVariables[x][bPrice];
9205
9206 new
9207 labelString[96];
9208
9209 strcpy(businessVariables[x][bOwner], P_DATA[playerid][pNormalName], MAX_PLAYER_NAME);
9210
9211 DestroyDynamicPickup(businessVariables[x][bPickupID]);
9212
9213 if(businessVariables[x][bLocked] == 1) {
9214 format(labelString, sizeof(labelString), "%s\n(Business %d - owned by %s)\n\n(locked)", businessVariables[x][bName], x, businessVariables[x][bOwner]);
9215 }
9216 else {
9217 format(labelString, sizeof(labelString), "%s\n(Business %d - owned by %s)\n\nPress CROUCH to enter", businessVariables[x][bName], x, businessVariables[x][bOwner]);
9218 }
9219 UpdateDynamic3DTextLabelText(businessVariables[x][bLabelID], COLOR_YELLOW, labelString);
9220 businessVariables[x][bPickupID] = CreateDynamicPickup(1239, 23, businessVariables[x][bExteriorPos][0], businessVariables[x][bExteriorPos][1], businessVariables[x][bExteriorPos][2], 0, 0, -1, 250);
9221
9222 SendClientMessage(playerid, COLOR_WHITE, "Congratulations on your purchase!");
9223
9224 saveBusiness(x);
9225 }
9226 else SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this business.");
9227 }
9228 else {
9229 return SendClientMessage(playerid, COLOR_GREY, "You can't purchase an owned business.");
9230 }
9231 }
9232 }
9233 }
9234 return 1;
9235}
9236
9237CMD:bspawnpos(playerid, params[]) {
9238
9239 if(getPlayerBusinessID(playerid) >= 1) {
9240
9241 new
9242 businessID = getPlayerBusinessID(playerid);
9243
9244 if(businessVariables[businessID][bType] == 5) {
9245 if(IsPlayerInRangeOfPoint(playerid, 30.0, businessVariables[businessID][bExteriorPos][0], businessVariables[businessID][bExteriorPos][1], businessVariables[businessID][bExteriorPos][2])) {
9246 GetPlayerPos(playerid, businessVariables[businessID][bMiscPos][0], businessVariables[businessID][bMiscPos][1], businessVariables[businessID][bMiscPos][2]);
9247 SendClientMessage(playerid, COLOR_WHITE, "You have successfully altered the spawn position of your vehicle dealership business.");
9248 }
9249 else SendClientMessage(playerid, COLOR_GREY, "You must be within thirty metres of the exterior of your business.");
9250 }
9251 else SendClientMessage(playerid, COLOR_GREY, "You don't own a vehicle dealership.");
9252 }
9253 return 1;
9254}
9255
9256CMD:movebusiness(playerid, params[]) {
9257 if(P_DATA[playerid][pAdmin] >= 3) {
9258 new
9259 houseID,
9260 subject[32];
9261
9262 if(sscanf(params, "ds[32]", houseID, subject)) {
9263 ShowSyntax(playerid, "/movebusiness [businessid] [exterior/interior]");
9264 }
9265 else {
9266 if(houseID < 1 || houseID > MAX_BUSINESSES) return SendClientMessage(playerid, COLOR_GREY, "Invalid business ID.");
9267
9268 if(strcmp(subject, "exterior", true) == 0) {
9269 GetPlayerPos(playerid, businessVariables[houseID][bExteriorPos][0], businessVariables[houseID][bExteriorPos][1], businessVariables[houseID][bExteriorPos][2]);
9270
9271 DestroyDynamic3DTextLabel(businessVariables[houseID][bLabelID]);
9272 DestroyDynamicPickup(businessVariables[houseID][bPickupID]);
9273
9274 if(!strcmp(businessVariables[houseID][bOwner], "Nobody", true) && strlen(businessVariables[houseID][bOwner]) >= 1) {
9275 new
9276 labelString[96];
9277
9278 if(businessVariables[houseID][bLocked] == 1) {
9279 format(labelString, sizeof(labelString), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\n(locked)", businessVariables[houseID][bName], houseID, businessVariables[houseID][bPrice]);
9280 }
9281 else {
9282 format(labelString, sizeof(labelString), "%s\n(Business %d - un-owned)\nPrice: $%d (/buybusiness)\n\nPress CROUCH to enter.", businessVariables[houseID][bName], houseID, businessVariables[houseID][bPrice]);
9283 }
9284
9285 businessVariables[houseID][bLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, businessVariables[houseID][bExteriorPos][0], businessVariables[houseID][bExteriorPos][1], businessVariables[houseID][bExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
9286 businessVariables[houseID][bPickupID] = CreateDynamicPickup(1239, 23, businessVariables[houseID][bExteriorPos][0], businessVariables[houseID][bExteriorPos][1], businessVariables[houseID][bExteriorPos][2], 0, 0, -1, 250);
9287
9288 }
9289 else {
9290 new
9291 labelString[96];
9292
9293 if(businessVariables[houseID][bLocked] == 1) {
9294 format(labelString, sizeof(labelString), "%s\n(Business %d - owned by %s)\n\n(locked)", businessVariables[houseID][bName], houseID, businessVariables[houseID][bOwner]);
9295 }
9296 else {
9297 format(labelString, sizeof(labelString), "%s\n(Business %d - owned by %s)\n\nPress CROUCH to enter", businessVariables[houseID][bName], houseID, businessVariables[houseID][bOwner]);
9298 }
9299
9300 businessVariables[houseID][bLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, businessVariables[houseID][bExteriorPos][0], businessVariables[houseID][bExteriorPos][1], businessVariables[houseID][bExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
9301 businessVariables[houseID][bPickupID] = CreateDynamicPickup(1239, 23, businessVariables[houseID][bExteriorPos][0], businessVariables[houseID][bExteriorPos][1], businessVariables[houseID][bExteriorPos][2], 0, 0, -1, 250);
9302 }
9303
9304 SendClientMessage(playerid, COLOR_WHITE, "The business exterior has successfully been changed.");
9305 }
9306 else if(strcmp(subject, "interior", true) == 0) {
9307 GetPlayerPos(playerid, businessVariables[houseID][bInteriorPos][0], businessVariables[houseID][bInteriorPos][1], businessVariables[houseID][bInteriorPos][2]);
9308 businessVariables[houseID][bInterior] = GetPlayerInterior(playerid);
9309 SendClientMessage(playerid, COLOR_WHITE, "The business interior has successfully been changed.");
9310 }
9311 saveBusiness(houseID);
9312 }
9313 }
9314
9315 return 1;
9316}
9317
9318CMD:movehq(playerid, params[]) {
9319 if(P_DATA[playerid][pAdmin] >= 3) {
9320 new
9321 ID,
9322 subject[32],
9323 string[128];
9324
9325 if(sscanf(params, "ds[32]", ID, subject)) {
9326 ShowSyntax(playerid, "/movehq [group ID] [exterior/interior]");
9327 }
9328 else {
9329 if(ID < 1 || ID > MAX_GROUPS) return SendClientMessage(playerid, COLOR_GREY, "Invalid group ID.");
9330
9331 if(strcmp(subject, "exterior", true) == 0) {
9332 GetPlayerPos(playerid, groupVariables[ID][gGroupExteriorPos][0], groupVariables[ID][gGroupExteriorPos][1], groupVariables[ID][gGroupExteriorPos][2]);
9333
9334 DestroyDynamic3DTextLabel(groupVariables[ID][gGroupLabelID]);
9335 DestroyDynamicPickup(groupVariables[ID][gGroupPickupID]);
9336
9337 new
9338 labelString[96];
9339
9340 switch(groupVariables[ID][gGroupHQLockStatus]) {
9341 case 0: format(labelString, sizeof(labelString), "%s's HQ\n\nPress CROUCH to enter.", groupVariables[ID][gGroupName]);
9342 case 1: format(labelString, sizeof(labelString), "%s's HQ\n\n(locked)", groupVariables[ID][gGroupName]);
9343 }
9344
9345 groupVariables[ID][gGroupLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, groupVariables[ID][gGroupExteriorPos][0], groupVariables[ID][gGroupExteriorPos][1], groupVariables[ID][gGroupExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 50.0);
9346 groupVariables[ID][gGroupPickupID] = CreateDynamicPickup(1239, 23, groupVariables[ID][gGroupExteriorPos][0], groupVariables[ID][gGroupExteriorPos][1], groupVariables[ID][gGroupExteriorPos][2], 0, -1, -1, 50);
9347 }
9348 else if(strcmp(subject, "interior", true) == 0){
9349 GetPlayerPos(playerid, groupVariables[ID][gGroupInteriorPos][0], groupVariables[ID][gGroupInteriorPos][1], groupVariables[ID][gGroupInteriorPos][2]);
9350 groupVariables[ID][gGroupHQInteriorID] = GetPlayerInterior(playerid);
9351
9352 }
9353 format(string,sizeof(string),"You have successfully moved the %s of the %s group (ID %d).",subject,groupVariables[ID][gGroupName],ID);
9354 SendClientMessage(playerid, COLOR_WHITE, string);
9355 }
9356 }
9357 else OnlyAdmin
9358 return 1;
9359}
9360
9361CMD:movehouse(playerid, params[]) {
9362 if(P_DATA[playerid][pAdmin] >= 3) {
9363 new
9364 houseID,
9365 subject[32];
9366
9367 if(sscanf(params, "ds[32]", houseID, subject)) {
9368 ShowSyntax(playerid, "/movehouse [houseid] [exterior/interior]");
9369 }
9370 else {
9371 if(houseID < 1 || houseID > MAX_HOUSES) return SendClientMessage(playerid, COLOR_GREY, "Invalid house ID.");
9372
9373 if(strcmp(subject, "exterior", true) == 0) {
9374 GetPlayerPos(playerid, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2]);
9375
9376 DestroyDynamic3DTextLabel(houseVariables[houseID][hLabelID]);
9377 DestroyDynamicPickup(houseVariables[houseID][hPickupID]);
9378
9379 if(!strcmp(houseVariables[houseID][hHouseOwner], "Nobody", true) && strlen(houseVariables[houseID][hHouseOwner]) >= 1) {
9380 new
9381 labelString[96];
9382
9383 if(houseVariables[houseID][hHouseLocked] == 1) {
9384 format(labelString, sizeof(labelString), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\n(locked)", houseID, houseVariables[houseID][hHousePrice]);
9385 }
9386 else {
9387 format(labelString, sizeof(labelString), "House %d (un-owned - /buyhouse)\nPrice: $%d\n\nPress CROUCH to enter.", houseID, houseVariables[houseID][hHousePrice]);
9388 }
9389
9390 houseVariables[houseID][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
9391 houseVariables[houseID][hPickupID] = CreateDynamicPickup(1273, 23, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 0, houseVariables[houseID][hHouseExteriorID], -1, 250);
9392
9393 }
9394 else {
9395 new
9396 labelString[96];
9397
9398 if(houseVariables[houseID][hHouseLocked] == 1) {
9399 format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\n\n(locked)", houseID, houseVariables[houseID][hHouseOwner]);
9400 }
9401 else {
9402 format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\n\nPress CROUCH to enter.", houseID, houseVariables[houseID][hHouseOwner]);
9403 }
9404
9405 houseVariables[houseID][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
9406 houseVariables[houseID][hPickupID] = CreateDynamicPickup(1272, 23, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 0, houseVariables[houseID][hHouseExteriorID], -1, 50);
9407 }
9408
9409 SendClientMessage(playerid, COLOR_WHITE, "The house exterior has successfully been changed.");
9410 }
9411 else if(strcmp(subject, "interior", true) == 0) {
9412 GetPlayerPos(playerid, houseVariables[houseID][hHouseInteriorPos][0], houseVariables[houseID][hHouseInteriorPos][1], houseVariables[houseID][hHouseInteriorPos][2]);
9413 houseVariables[houseID][hHouseInteriorID] = GetPlayerInterior(playerid);
9414 SendClientMessage(playerid, COLOR_WHITE, "The house interior has successfully been changed.");
9415 }
9416
9417 saveHouse(houseID);
9418 }
9419 }
9420 else OnlyAdmin
9421 return 1;
9422}
9423
9424CMD:gotohouse(playerid, params[]) {
9425 if(P_DATA[playerid][pAdmin] < 3) return OnlyAdmin
9426 if(isnull(params)) return ShowSyntax(playerid, "/gotohouse [houseid]");
9427 new
9428 houseID = strval(params);
9429 if(houseID < 1 || houseID > MAX_HOUSES) return SendClientMessage(playerid, COLOR_GREY, "Invalid house ID.");
9430 SetPlayerPos(playerid, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2]);
9431 SetPlayerInterior(playerid, 0);
9432 SetPlayerVirtualWorld(playerid, 0);
9433 return 1;
9434}
9435
9436CMD:gotobusiness(playerid, params[]) {
9437 if(P_DATA[playerid][pAdmin] >= 3) {
9438
9439 if(isnull(params)) return ShowSyntax(playerid, "/gotobusiness [businessid]");
9440 new
9441 houseID = strval(params);
9442
9443 if(houseID < 1 || houseID > MAX_BUSINESSES) return SendClientMessage(playerid, COLOR_GREY, "Invalid business ID.");
9444
9445 SetPlayerPos(playerid, businessVariables[houseID][bExteriorPos][0],businessVariables[houseID][bExteriorPos][1], businessVariables[houseID][bExteriorPos][2]);
9446 SetPlayerInterior(playerid, 0);
9447 SetPlayerVirtualWorld(playerid, 0);
9448
9449 }
9450 return 1;
9451}
9452
9453CMD:fish(playerid, params[]) {
9454 if(P_DATA[playerid][pJob] == 4 && IsPlayerInAnyVehicle(playerid) && P_DATA[playerid][pFishing] == 0) {
9455 if(P_DATA[playerid][pJobDelay] > 0) {
9456
9457 new
9458 string[57];
9459
9460 format(string, sizeof(string), "You must wait %d minutes (%d seconds) until you can go fishing again.", P_DATA[playerid][pJobDelay] / 60, P_DATA[playerid][pJobDelay]);
9461 return SendClientMessage(playerid, COLOR_GREY, string);
9462 }
9463 else if(IsABoat(GetPlayerVehicleID(playerid))) {
9464
9465 //P_DATA[playerid][pFishingBar] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_LIGHT, 100.0);
9466 P_DATA[playerid][pFishing] = 1;
9467 //ShowProgressBarForPlayer(playerid, P_DATA[playerid][pFishingBar]);
9468 SendClientMessage(playerid, COLOR_WHITE, "You're now fishing. It will take a few seconds to reel your fish in.");
9469 }
9470 else SendClientMessage(playerid, COLOR_GREY, "This vehicle cannot be used for fishing.");
9471 }
9472 return 1;
9473}
9474
9475CMD:anno(playerid,params[]) {
9476 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
9477 new text[256],string[300];
9478 if(sscanf(params, "s[256]",text)) return ShowSyntax(playerid, "/anno [message]");
9479 if(P_DATA[playerid][pAdmin] >= 1)
9480 {
9481 format(string, sizeof string, "(( %s says: %s ))", P_DATA[playerid][pNormalName], text);
9482 foreach(new x : Player) SendSplitMessage(x, COLOR_GENANNOUNCE,string);
9483 }
9484 return 1;
9485}
9486CMD:changename(playerid, params[]) {
9487 if(P_DATA[playerid][pAdmin] >= 4) {
9488 new
9489 newName[MAX_PLAYER_NAME],
9490 targetID;
9491
9492 if(sscanf(params, "us[24]", targetID, newName)) {
9493 return ShowSyntax(playerid, "/changename [playerid] [newname]");
9494 }
9495 else {
9496 if(!IsPlayerConnected(targetID) || P_DATA[playerid][pStatus] < 1) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
9497
9498 if(getPlayerBusinessID(targetID) >= 1) strcpy(businessVariables[getPlayerBusinessID(targetID)][bOwner], newName, MAX_PLAYER_NAME);
9499 if(getPlayerHouseID(targetID) >= 1) strcpy(houseVariables[getPlayerHouseID(targetID)][hHouseOwner], newName, MAX_PLAYER_NAME);
9500
9501 new
9502 playerName[2][MAX_PLAYER_NAME],
9503 querySz[90],
9504 Cache: r;
9505
9506 format(querySz, sizeof(querySz), "SELECT playerName FROM playeraccounts WHERE playerName = '%s'", newName);
9507 r = mysql_query(SQL, querySz);
9508 if(cache_get_row_count()) {
9509 SendClientMessage(playerid, COLOR_GREY, "That name is already taken.");
9510 cache_delete(r);
9511 return 1;
9512 }
9513 cache_delete(r);
9514 mysql_real_escape_string(newName, newName);
9515
9516 GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
9517 GetPlayerName(targetID, playerName[1], MAX_PLAYER_NAME);
9518
9519 format(querySz, sizeof(querySz), "UPDATE playeraccounts SET playerName = '%s' WHERE playerID = '%d'", newName, P_DATA[targetID][pSQL]);
9520 mysql_query(SQL, querySz); // No point in threading a simple response...
9521
9522 format(querySz, sizeof(querySz), "Administrator %s has changed your name to %s.", playerName[0], newName); // Might as well re-use the string...
9523 SendClientMessage(targetID, COLOR_WHITE, querySz);
9524
9525 format(querySz, sizeof(querySz), "You have changed %s (ID: %d)'s name to %s.", playerName[1], targetID, newName);
9526 SendClientMessage(playerid, COLOR_WHITE, querySz);
9527
9528 SetPlayerName(targetID, newName);
9529
9530 strcpy(P_DATA[targetID][pNormalName], newName, MAX_PLAYER_NAME);
9531 }
9532 }
9533 return 1;
9534}
9535CMD:ah(playerid, params[]) {
9536 if(P_DATA[playerid][pAdmin] >= 1) {
9537 SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
9538
9539 SendClientMessage(playerid, COLOR_WHITE, "Level 1: /ban, /kick, /check, /reports, /announce, /warn, /listgroups, /a, /adminduty, /vrespawn");
9540 SendClientMessage(playerid, COLOR_WHITE, "Level 1: /go, /get, /goto, /spec, /slap, /listguns, /gotoplayervehicle, /serverstats, /closestcar");
9541 if(P_DATA[playerid][pAdmin] >= 2) {
9542 SendClientMessage(playerid, COLOR_GREY, "Level 2: /enableooc, /disableooc, /prison, /jail, /release, /mute, /omute, /fine, /freeze, /forcelogout");
9543 }
9544 if(P_DATA[playerid][pAdmin] >= 3) {
9545 SendClientMessage(playerid, COLOR_WHITE, "Level 3: /unban, /spawnvehicle, /despawnavehicles, /spawnweapon, /gotopoint, /setleader, /movehouse, /asellhouse");
9546 SendClientMessage(playerid, COLOR_WHITE, "Level 3: /set, /hprice, /bprice, /vehname, /gunname, /explode, /gotohouse, /gotobusiness");
9547 SendClientMessage(playerid, COLOR_WHITE, "Level 3: /eventproperties, /startevent, /endevent, /setplayervehicle, /tod, /vdespawn");
9548 }
9549 if(P_DATA[playerid][pAdmin] >= 4) {
9550 SendClientMessage(playerid, COLOR_GREY, "Level 4: /setadminname, /createhouse, /createbusiness, /btype, /gtype");
9551 SendClientMessage(playerid, COLOR_GREY, "Level 4: /savevehicle, /vgroup, /vcolour, /vmove, /vmodel, /vrespawnall, /changename");
9552 }
9553 if(P_DATA[playerid][pAdmin] >= 5) {
9554 SendClientMessage(playerid, COLOR_WHITE, "Level 5: /savedata, /gmx, /sethelper, /setvip, /listassets");
9555 }
9556
9557 SendClientMessage(playerid, COLOR_TEAL, "--------------------------------------------------------------------------------------------------------------------------------");
9558 }
9559
9560 return 1;
9561}
9562
9563CMD:lockbusiness(playerid, params[]) {
9564 if(getPlayerBusinessID(playerid) >= 1) {
9565 new
9566 result[128],
9567 x = getPlayerBusinessID(playerid);
9568
9569 switch(businessVariables[x][bLocked]) {
9570 case 0: {
9571 format(result, sizeof(result), "%s\n(Business %d - owned by %s)\n\n(locked)", businessVariables[x][bName], x, businessVariables[x][bOwner]);
9572
9573 businessVariables[x][bLocked] = 1;
9574 SendClientMessage(playerid, COLOR_WHITE, "Business locked.");
9575 }
9576 case 1: {
9577 format(result, sizeof(result), "%s\n(Business %d - owned by %s)\n\nPress CROUCH to enter", businessVariables[x][bName], x, businessVariables[x][bOwner]);
9578
9579 businessVariables[x][bLocked] = 0;
9580 SendClientMessage(playerid, COLOR_WHITE, "Business unlocked.");
9581 }
9582 }
9583 UpdateDynamic3DTextLabelText(businessVariables[x][bLabelID], COLOR_YELLOW, result);
9584 }
9585
9586 return 1;
9587}
9588
9589CMD:number(playerid, params[]) {
9590 if(P_DATA[playerid][pPhoneBook] >= 1) {
9591 new
9592 userID;
9593
9594 if(sscanf(params, "u", userID)) {
9595 return ShowSyntax(playerid, "/number [playerid]");
9596 }
9597 else {
9598 if(!IsPlayerConnected(userID)) {
9599 return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
9600 }
9601 else {
9602 new
9603 playerName[MAX_PLAYER_NAME],
9604 szMessage[128];
9605
9606 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
9607
9608 if(P_DATA[userID][pPhoneNumber] == -1) {
9609 format(szMessage, sizeof(szMessage), "Name: "EMBED_GREY"%s{FFFFFF} | Number: "EMBED_GREY"None", playerName);
9610 SendClientMessage(playerid, COLOR_WHITE, szMessage);
9611 }
9612 else {
9613 format(szMessage, sizeof(szMessage), "Name: "EMBED_GREY"%s{FFFFFF} | Number: "EMBED_GREY"%d", playerName, P_DATA[userID][pPhoneNumber]);
9614 SendClientMessage(playerid, COLOR_WHITE, szMessage);
9615 }
9616 }
9617 }
9618 }
9619 else SendClientMessage(playerid, COLOR_GREY, "You don't have a phonebook.");
9620 return 1;
9621}
9622
9623CMD:slap(playerid,params[]) {
9624 if(P_DATA[playerid][pAdmin] >= 1) {
9625 new
9626 userID;
9627
9628 if(sscanf(params, "u", userID))
9629 return ShowSyntax(playerid, "/slap [playerid]");
9630
9631 if(P_DATA[userID][pStatus] != 1 || !IsPlayerConnected(userID))
9632 return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
9633
9634 if(P_DATA[playerid][pAdmin] >= P_DATA[userID][pAdmin]) {
9635 new
9636 string[64],
9637 playerName[MAX_PLAYER_NAME],
9638 Float: playerHealth,
9639 Float: fPos[3];
9640
9641 GetPlayerName(userID, playerName, MAX_PLAYER_NAME);
9642
9643 GetPlayerPos(userID, fPos[0], fPos[1], fPos[2]);
9644 PlayerPlaySoundEx(1190, fPos[0], fPos[1], fPos[2]);
9645 SetPlayerPos(userID, fPos[0], fPos[1], fPos[2]+5);
9646
9647 GetPlayerHealth(userID, playerHealth);
9648 SetPlayerHealth(userID, playerHealth-5);
9649
9650 format(string, sizeof(string), "You have slapped %s.", playerName);
9651 SendClientMessage(playerid, COLOR_WHITE, string);
9652 }
9653 }
9654 else OnlyAdmin
9655 return 1;
9656}
9657
9658CMD:help(playerid, params[]) {
9659 return showHelp(playerid);
9660}
9661
9662CMD:check(playerid,params[]) {
9663 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
9664 new targetid;
9665 if(sscanf(params, "u", targetid)) return ShowSyntax(playerid, "/check [playerid]");
9666 if(P_DATA[targetid][pStatus] != 1) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
9667 if(P_DATA[playerid][pAdmin] < P_DATA[targetid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "You can't check a higher level administrator.");
9668 showStats(playerid, targetid);
9669 return 1;
9670}
9671
9672CMD:quitgroup(playerid, params[]) {
9673
9674 if(P_DATA[playerid][pGroup] != 0) {
9675 new
9676 playerName[MAX_PLAYER_NAME],
9677 string[128];
9678
9679 format(string, sizeof(string), "%s has left the group (quit).", playerName);
9680 SendToGroup(P_DATA[playerid][pGroup], COLOR_GENANNOUNCE, string);
9681 format(string,sizeof(string), "You have left the %s.",groupVariables[P_DATA[playerid][pGroup]][gGroupName]);
9682 SendClientMessage(playerid,COLOR_WHITE,string);
9683 P_DATA[playerid][pGroup] = 0;
9684 P_DATA[playerid][pGroupRank] = 0;
9685 }
9686 else return SendClientMessage(playerid, COLOR_WHITE, "You don't have a group to quit.");
9687 return 1;
9688}
9689
9690CMD:vdespawn(playerid, params[]) {
9691 if(P_DATA[playerid][pAdmin] >= 3) {
9692
9693 for(new i = 0; i < MAX_VEHICLES; i++) {
9694 if(AdminSpawnedVehicles[i] == GetPlayerVehicleID(playerid)) {
9695
9696 new
9697 szMessage[45];
9698
9699 format(szMessage, sizeof(szMessage), "You have successfully despawned vehicle %d.", AdminSpawnedVehicles[i]);
9700 DestroyVehicle(AdminSpawnedVehicles[i]);
9701 AdminSpawnedVehicles[i] = 0;
9702 systemVariables[vehicleCounts][2]--;
9703 SendClientMessage(playerid, COLOR_WHITE, szMessage);
9704 return 1;
9705 }
9706 }
9707 SendClientMessage(playerid, COLOR_WHITE, "You are not in an admin spawned vehicle.");
9708 }
9709 return 1;
9710}
9711CMD:spawncar(playerid, params[]) {
9712 if(P_DATA[playerid][pAdmin] >= 1)
9713 {
9714 new model,sendername[25],string[256];
9715 if(sscanf(params, "i", model)) return ShowSyntax(playerid, "/spawncar [model]");
9716 if(model < 400 || model > 611) return SCM(playerid, COLOR_GREY, "Invalid car model.");
9717 new Float:X,Float:Y,Float:Z;
9718 GetPlayerPos(playerid, X,Y,Z);
9719 new carid = CreateVehicle(model, X,Y,Z, 0.0, -1, -1, -1);
9720 Carspawn[carid] = carid;
9721 SetVehicleNumberPlate(carid, "ADMCAR");
9722 GetPlayerName(playerid, sendername, sizeof(sendername));
9723 new vehicles = GetVehicleModel(carid) - 400;
9724 format(string, sizeof(string), "{FF0000}AdmCmd{FFFFFF} %s has spawned a %s.",sendername,VehicleNames[vehicles]);
9725 submitToAdmins(string, COLOR_WHITE);
9726 LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
9727 SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
9728 PutPlayerInVehicle(playerid, carid, 0);
9729 }
9730 else OnlyAdmin
9731 return 1;
9732}
9733CMD:vre(playerid, params[]) {
9734 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
9735 new string[128], count;
9736 if(IsPlayerInAnyVehicle(playerid)) {
9737 for(new x; x < MAX_VEHICLES; x++) {
9738 if(Carspawn[x] == GetPlayerVehicleID(playerid)) {
9739 DestroyVehicle(x),Carspawn[x] = 0, count++, format(string,sizeof string, "{FF0000}AdmCmd{FFFFFF} Admin %s respawned vehicle %d.",GetName(playerid),x),submitToAdmins(string,COLOR_WHITE);
9740 StopAudioStreamForPlayer(playerid);
9741 break;
9742 }
9743 if(count == 0) {
9744 SetVehicleToRespawn(GetPlayerVehicleID(playerid));
9745 format(string,sizeof(string),"{FF0000}AdmCmd{FFFFFF} Admin %s respawned vehicle %d.",GetName(playerid),GetPlayerVehicleID(playerid)), submitToAdmins(string,COLOR_WHITE);
9746 StopAudioStreamForPlayer(playerid);
9747 }
9748 }
9749 }
9750 else {
9751 new car;
9752 if(sscanf(params, "d",car)) return ShowSyntax(playerid, "/vre [carid]");
9753 new bool:unwanted[MAX_VEHICLES];
9754 for(new player=0; player<MAX_PLAYERS; player++) if(IsPlayerInAnyVehicle(player)) unwanted[GetPlayerVehicleID(player)]=true;
9755 if(!unwanted[car]) {
9756 for(new x; x < MAX_VEHICLES; x++) {
9757 if(Carspawn[x] == car) {
9758 if(!unwanted[car]) {
9759 DestroyVehicle(x),Carspawn[x] = 0, count++;
9760 format(string, sizeof string, "{FF0000}AdmCmd{FFFFFF} Admin %s respawned vehicle %d.",GetName(playerid),x),submitToAdmins(string,COLOR_WHITE);
9761 break;
9762 }
9763 }
9764 }
9765 if(count == 0) {
9766 if(!unwanted[car]) {
9767 SetVehicleToRespawn(car);
9768 format(string,sizeof(string),"{FF0000}AdmCmd{FFFFFF} Admin %s respawned vehicle %d.",GetName(playerid),car),submitToAdmins(string,COLOR_WHITE);
9769 }
9770 }
9771 }
9772 }
9773 return 1;
9774}
9775CMD:serverstats(playerid, params[]) {
9776 if(P_DATA[playerid][pAdmin] >= 1) {
9777
9778 new
9779 statString[128];
9780
9781 SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------------------");
9782 SendClientMessage(playerid, COLOR_WHITE, "System variables (current):");
9783 format(statString, sizeof(statString), "Objects: %d | Pickups: %d | 3D Text Labels: %d | Static vehicles: %d | Player vehicles: %d | Admin vehicles: %d", CountDynamicObjects(), CountDynamicPickups(), CountDynamic3DTextLabels(), systemVariables[vehicleCounts][0], systemVariables[vehicleCounts][1], systemVariables[vehicleCounts][2]);
9784 SendClientMessage(playerid, COLOR_WHITE, statString);
9785 format(statString, sizeof(statString), "Houses: %d | Businesses: %d | Total vehicle count: %d/%d | Weather: %d | Pending weather change: %d/%d", systemVariables[houseCount], systemVariables[businessCount], systemVariables[vehicleCounts][0] + systemVariables[vehicleCounts][1] + systemVariables[vehicleCounts][2], MAX_VEHICLES, weatherVariables[0], weatherVariables[1], MAX_WEATHER_POINTS);
9786 SendClientMessage(playerid, COLOR_WHITE, statString);
9787 SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------------------");
9788 }
9789 else OnlyAdmin
9790 return 1;
9791}
9792CMD:serverpass(playerid, params[]) {
9793 if(P_DATA[playerid][pAdmin] < 6) return OnlyAdmin
9794 new pass[64], string[64];
9795 if(sscanf(params, "s[64]",pass)) return ShowSyntax(playerid, "/serverpass [password]");
9796 format(string, sizeof string, "password %s",pass),SendRconCommand(string);
9797 SCMF(playerid, COLOR_YELLOW, "You changed the server password in: %s.",pass);
9798 return 1;
9799}
9800CMD:servername(playerid, params[]) {
9801 if(P_DATA[playerid][pAdmin] < 6) return OnlyAdmin
9802 new name[64],string[64];
9803 if(sscanf(params, "s[64]", name)) return ShowSyntax(playerid, "/servername [name]");
9804 format(string,sizeof(string),"hostname %s",name), SendRconCommand(string);
9805 SCMF(playerid, COLOR_YELLOW, "You changed the server name in: %s.",name);
9806 return 1;
9807}
9808new viddd[MAX_PLAYERS];
9809timer RACtime[10000]() {
9810 for(new car = 1; car <= MAX_VEHICLES; car++) {
9811 new neocupat;
9812 if(!IsVehicleOccupied(car)) {
9813 foreach(new i : Player) if(viddd[i] == car) neocupat = 1;
9814 if(neocupat == 0) SetVehicleToRespawn(car);
9815 }
9816 }
9817 return 1;
9818}
9819CMD:rac(playerid, params[]) {
9820 if(IsPlayerConnected(playerid)) {
9821 if(P_DATA[playerid][pAdmin] < 3) return OnlyAdmin
9822 new string[256];
9823 defer RACtime();
9824 format(string, sizeof string, "{FFFFFF}All unsued cars will be respawned in {950000}10{ffffff} seconds by %s!", GetName(playerid)),SendClientMessageToAll(COLOR_WHITE,string);
9825 }
9826 return 1;
9827}
9828CMD:warn(playerid, params[]) {
9829 if(P_DATA[playerid][pAdmin] >= 1) {
9830 new
9831 playerWarnID,
9832 playerWarnReason[32];
9833
9834 if(sscanf(params, "us[32]", playerWarnID, playerWarnReason)) {
9835 ShowSyntax(playerid, "/warn [playerid] [reason (length is 32 characters maximum)]]");
9836 }
9837 else {
9838 if(!IsPlayerConnectedEx(playerWarnID)) return SendClientMessage(playerid, COLOR_GREY, "The specified player is not connected, or has not authenticated.");
9839
9840 if(P_DATA[playerWarnID][pAdmin] >= P_DATA[playerid][pAdmin])
9841 return SendClientMessage(playerid, COLOR_GREY, "You can't warn a higher (or equal) level administrator.");
9842
9843 if(!strcmp(P_DATA[playerWarnID][pWarning1], "(null)", true)) {
9844 new
9845 playerName[MAX_PLAYER_NAME],
9846 messageString[128];
9847
9848 mysql_real_escape_string(playerWarnReason, P_DATA[playerWarnID][pWarning1]);
9849
9850 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
9851
9852 format(messageString, sizeof(messageString), "You have been warned by Administrator %s, reason: %s. This is your first warning.", playerName, playerWarnReason);
9853 SendClientMessage(playerWarnID, COLOR_LIGHTRED, messageString);
9854
9855 GetPlayerName(playerWarnID, playerName, MAX_PLAYER_NAME);
9856
9857 format(messageString, sizeof(messageString), "You have warned %s (for %s). This is their first warning.", playerName, playerWarnReason);
9858 SendClientMessage(playerWarnID, COLOR_LIGHTRED, messageString);
9859 }
9860 else if(!strcmp(P_DATA[playerWarnID][pWarning2], "(null)", true)) {
9861 new
9862 playerName[MAX_PLAYER_NAME],
9863 messageString[128];
9864
9865 mysql_real_escape_string(playerWarnReason, P_DATA[playerWarnID][pWarning2]);
9866
9867 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
9868
9869 format(messageString, sizeof(messageString), "You have been warned by Administrator %s, reason: %s. This is your second warning.", playerName, playerWarnReason);
9870 SendClientMessage(playerWarnID, COLOR_LIGHTRED, messageString);
9871
9872 GetPlayerName(playerWarnID, playerName, MAX_PLAYER_NAME);
9873
9874 format(messageString, sizeof(messageString), "You have warned %s (for %s). This is their second warning.", playerName, playerWarnReason);
9875 SendClientMessage(playerWarnID, COLOR_LIGHTRED, messageString);
9876 }
9877 else {
9878 new
9879 playerName[MAX_PLAYER_NAME],
9880 messageString[128];
9881
9882 mysql_real_escape_string(playerWarnReason, P_DATA[playerWarnID][pWarning3]);
9883
9884 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
9885
9886 format(messageString, sizeof(messageString), "You have been warned by Administrator %s, reason: %s. This is your third warning.", playerName, playerWarnReason);
9887 SendClientMessage(playerWarnID, COLOR_LIGHTRED, messageString);
9888
9889 GetPlayerName(playerWarnID, playerName, MAX_PLAYER_NAME);
9890
9891 format(messageString, sizeof(messageString), "You have warned %s (for %s). This is their third warning.", playerName, playerWarnReason);
9892 SendClientMessage(playerWarnID, COLOR_LIGHTRED, messageString);
9893
9894 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
9895
9896 format(messageString, 42, "Third warning (last from %s)", playerName);
9897 scriptBan(playerWarnID, messageString);
9898 }
9899 }
9900 }
9901 else OnlyAdmin
9902 return 1;
9903}
9904
9905CMD:stats(playerid, params[]) return showStats(playerid,playerid);
9906CMD:tod(playerid, params[]) {
9907 if(P_DATA[playerid][pAdmin] < 3) return OnlyAdmin
9908 if(!isnull(params)) {
9909 new weatherID = strval(params);
9910 if(weatherID >= 1 && weatherID <= 45) {
9911 weatherVariables[0] = weatherID;
9912 foreach(new i : Player) if(!GetPlayerInterior(i)) SetPlayerWeather(i, weatherVariables[0]);
9913 }
9914 else SendClientMessage(playerid, COLOR_GREY, "Invalid weather ID specified (must be between 1 and 45).");
9915 }
9916 else SendClientMessage(playerid, COLOR_GREY, "No weather ID specified.");
9917 return 1;
9918}
9919
9920CMD:ban(playerid, params[]) {
9921 if(P_DATA[playerid][pAdmin] < 1) return OnlyAdmin
9922 new playerBanID,playerBanReason[60];
9923 if(sscanf(params, "us[60]", playerBanID, playerBanReason)) return ShowSyntax(playerid, "/ban [playerid] [reason]");
9924 if(P_DATA[playerBanID][pAdmin] >= P_DATA[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "You can't ban a higher (or equal) level administrator.");
9925 if(playerBanID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
9926 new
9927 playerName[MAX_PLAYER_NAME],
9928 playerIP[32],
9929 playerNameBanned[MAX_PLAYER_NAME],
9930 aString[384]; // Due to the fact that we'll be dealing with a large query after the ban announcement...
9931
9932 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
9933 GetPlayerName(playerBanID, playerNameBanned, MAX_PLAYER_NAME);
9934
9935 GetPlayerIp(playerBanID, playerIP, sizeof(playerIP));
9936
9937 P_DATA[playerBanID][pBanned] = 1;
9938
9939 format(aString, sizeof(aString), "Ban: %s has been banned by %s, reason: %s", playerNameBanned, GetName(playerid), playerBanReason);
9940 SendClientMessageToAll(COLOR_LIGHTRED, aString);
9941 mysql_real_escape_string(aString, aString);
9942 adminLog(aString);
9943
9944 mysql_real_escape_string(playerName, playerName);
9945 mysql_real_escape_string(playerNameBanned, playerNameBanned);
9946
9947 mysql_format(SQL, aString, sizeof(aString), "INSERT INTO bans (playerNameBanned, playerBannedBy, playerBanReason, IPBanned) VALUES('%e', '%e', '%e', '%e')", playerNameBanned, playerName, playerBanReason, playerIP);
9948 mysql_tquery(SQL, aString, "", "");
9949 format(aString, sizeof(aString), "UPDATE playeraccounts SET playerBanned = 1 WHERE playerID = %d LIMIT 1;", P_DATA[playerBanID][pSQL]);
9950 mysql_tquery(SQL, aString, "", "");
9951 KickEx(playerBanID);
9952 return 1;
9953}
9954
9955CMD:kick(playerid, params[]) {
9956 if(P_DATA[playerid][pAdmin] >= 1) {
9957 new
9958 playerKickID,
9959 playerKickReason[60];
9960
9961 if(sscanf(params, "us[60]", playerKickID, playerKickReason))
9962 return ShowSyntax(playerid, "/kick [playerid] [reason]");
9963
9964 if(P_DATA[playerKickID][pAdmin] >= P_DATA[playerid][pAdmin])
9965 return SendClientMessage(playerid, COLOR_GREY, "You can't kick a higher (or equal) level administrator.");
9966
9967 if(playerKickID == INVALID_PLAYER_ID)
9968 return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
9969
9970 new
9971 playerName[MAX_PLAYER_NAME],
9972 playerNameKicked[MAX_PLAYER_NAME],
9973 aString[128];
9974
9975 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
9976 GetPlayerName(playerKickID, playerNameKicked, MAX_PLAYER_NAME);
9977
9978 format(aString, sizeof(aString), "Kick: %s has been kicked by %s, reason: %s", playerNameKicked, GetName(playerid), playerKickReason);
9979 SendClientMessageToAll(COLOR_LIGHTRED, aString);
9980 mysql_real_escape_string(aString, aString);
9981 adminLog(aString);
9982
9983 Kick(playerKickID);
9984 }
9985 else OnlyAdmin
9986 return 1;
9987}
9988
9989CMD:mute(playerid, params[]) {
9990 if(P_DATA[playerid][pAdmin] >= 2) {
9991
9992 new
9993 ID;
9994
9995 if(sscanf(params, "u", ID))
9996 return ShowSyntax(playerid, "/mute [playerid]");
9997
9998 if(P_DATA[ID][pAdmin] > 0)
9999 return SendClientMessage(playerid, COLOR_GREY, "You can't mute an administrator.");
10000
10001 if(ID == INVALID_PLAYER_ID)
10002 return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
10003
10004 new
10005 playerName[MAX_PLAYER_NAME],
10006 string[55];
10007
10008 switch(P_DATA[ID][pMuted]) {
10009 case 0: {
10010 format(string, sizeof(string), "Administrator %s has muted you.", GetName(playerid));
10011 SendClientMessage(ID, COLOR_WHITE, string);
10012
10013 GetPlayerName(ID, playerName, MAX_PLAYER_NAME);
10014 format(string, sizeof(string), "You have muted %s.", playerName);
10015 SendClientMessage(playerid, COLOR_WHITE, string);
10016
10017 P_DATA[ID][pMuted] = -1;
10018 }
10019 default: {
10020 format(string, sizeof(string), "Administrator %s has unmuted you.", GetName(playerid));
10021 SendClientMessage(ID, COLOR_WHITE, string);
10022
10023 GetPlayerName(ID, playerName, MAX_PLAYER_NAME);
10024 format(string, sizeof(string), "You have unmuted %s.", playerName);
10025 SendClientMessage(playerid, COLOR_WHITE, string);
10026
10027 P_DATA[ID][pMuted] = 0;
10028 }
10029 }
10030 }
10031 else OnlyAdmin
10032 return 1;
10033}
10034
10035CMD:savedata(playerid, params[]) {
10036 if(P_DATA[playerid][pAdmin] >= 5) {
10037 foreach(new x : Player) {
10038 savePlayerData(x);
10039 }
10040 SendClientMessage(playerid, COLOR_YELLOW, "Player data saved.");
10041
10042 for(new xh = 0; xh < MAX_HOUSES; xh++) {
10043 saveHouse(xh);
10044 }
10045 SendClientMessage(playerid, COLOR_YELLOW, "House data saved.");
10046
10047 for(new xf = 0; xf < MAX_GROUPS; xf++) {
10048 saveGroup(xf);
10049 }
10050 SendClientMessage(playerid, COLOR_YELLOW, "Group data saved.");
10051
10052 for(new xf = 0; xf < MAX_BUSINESSES; xf++) {
10053 saveBusiness(xf);
10054 }
10055 SendClientMessage(playerid, COLOR_YELLOW, "Business data saved.");
10056
10057 for(new xf = 0; xf < MAX_ASSETS; xf++) {
10058 saveAsset(xf);
10059 }
10060 SendClientMessage(playerid, COLOR_YELLOW, "Server asset data saved.");
10061 }
10062
10063 return 1;
10064}
10065
10066CMD:gmx(playerid, params[]) {
10067 if(P_DATA[playerid][pAdmin] >= 5) {
10068 ShowPlayerDialog(playerid, DIALOG_GMX, DIALOG_STYLE_MSGBOX, "Server Restart", "Please confirm whether you are positive that you wish to initiate a server restart?", "Yes", "No");
10069 }
10070 else OnlyAdmin
10071 return 1;
10072}
10073
10074CMD:unban(playerid, params[]) {
10075 /* if(P_DATA[playerid][pAdmin] >= 3) {
10076 if(!isnull(params)) {
10077 if(strlen(params) < MAX_PLAYER_NAME) {
10078 new
10079 szQuery[150],
10080 Cache:r;
10081
10082 mysql_real_escape_string(params, P_DATA[playerid][pNameUnbanning]);
10083 format(szQuery, sizeof(szQuery), "SELECT * FROM `playeraccounts` WHERE `playerName` = '%s'", P_DATA[playerid][pNameUnbanning]);
10084 mysql_query(SQL, szQuery, THREAD_CHECK_PLAYER_NAME_BANNED, playerid);
10085 mysql_format(szQuery, sizeof(szQuery), "SELECT `playerID` FROM `playeraccounts` WHERE `playerName` = '%e' AND `playerBanned` = 1", params);
10086 r = mysql_query(SQL, szQuery, true);
10087 if(cache_get_row_count())
10088 {
10089 mysql_format(szQuery, sizeof(szQuery), "DELETE FROM `bans` WHERE `playerNameBanned` = '%s'", params);
10090 mysql_tquery(SQL, szQuery);
10091 mysql_format(szQuery, sizeof(szQuery), "UPDATE `playeraccounts` SET `playerBanned` = 0 WHERE `playerName` = '%e'", params);
10092 mysql_tquery(SQL, szQuery);
10093 SCM(playerid, -1, "The unban was successful.");
10094 format(szQuery, sizeof(szQuery), "Warning: {FFFFFF}%s has unbanned player %s.", GetName(playerid), params);
10095 submitToAdmins(szQuery, COLOR_HOTORANGE);
10096
10097 } else SCM(playerid, -1, "This player not exists or is not banned !");
10098 cache_delete(r);
10099
10100 }
10101 else {
10102 SendClientMessage(playerid, COLOR_GREY, "Invalid name length specified (1-24).");
10103 }
10104 }
10105 else {
10106 ShowSyntax(playerid, "/unban [account name]");
10107 }
10108 }*/
10109 SCM(playerid, -1, "This command is under mantinance");
10110 return 1;
10111}
10112
10113CMD:buyhouse(playerid, params[]) {
10114 if(P_DATA[playerid][pStatus] >= 1) {
10115 for(new x = 0; x < MAX_HOUSES; x++) {
10116 if(IsPlayerInRangeOfPoint(playerid, 5, houseVariables[x][hHouseExteriorPos][0], houseVariables[x][hHouseExteriorPos][1], houseVariables[x][hHouseExteriorPos][2])) {
10117 if(!strcmp(houseVariables[x][hHouseOwner], "Nobody", true)) {
10118 if(houseVariables[x][hHousePrice] == -1) return SendClientMessage(playerid, COLOR_GREY, "This house was blocked from being purchased by an administrator.");
10119 if(getPlayerHouseID(playerid) >= 1) return SendClientMessage(playerid, COLOR_GREY, "You can't own 2 houses.");
10120 if(P_DATA[playerid][pMoney] >= houseVariables[x][hHousePrice]) {
10121 P_DATA[playerid][pMoney] -= houseVariables[x][hHousePrice];
10122
10123 new
10124 labelString[96];
10125
10126 strcpy(houseVariables[x][hHouseOwner], P_DATA[playerid][pNormalName], MAX_PLAYER_NAME);
10127
10128 DestroyDynamicPickup(houseVariables[x][hPickupID]);
10129 DestroyDynamic3DTextLabel(houseVariables[x][hLabelID]);
10130
10131 if(houseVariables[x][hHouseLocked] == 1) {
10132 format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\n\n(locked)", x, houseVariables[x][hHouseOwner]);
10133 }
10134 else {
10135 format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\n\nPress CROUCH to enter.", x, houseVariables[x][hHouseOwner]);
10136 }
10137
10138 houseVariables[x][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[x][hHouseExteriorPos][0], houseVariables[x][hHouseExteriorPos][1], houseVariables[x][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
10139 houseVariables[x][hPickupID] = CreateDynamicPickup(1272, 23, houseVariables[x][hHouseExteriorPos][0], houseVariables[x][hHouseExteriorPos][1], houseVariables[x][hHouseExteriorPos][2], 0, houseVariables[x][hHouseExteriorID], -1, 50);
10140
10141 SendClientMessage(playerid, COLOR_WHITE, "Congratulations on your purchase - you are now the proud owner of this house!");
10142
10143 saveHouse(x);
10144 }
10145 else SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this house.");
10146 }
10147 else {
10148 return SendClientMessage(playerid, COLOR_GREY, "You can't purchase an owned house.");
10149 }
10150 }
10151 }
10152 }
10153 return 1;
10154}
10155CMD:pay(playerid, params[]) {
10156 new
10157 id,
10158 cash,
10159 string[128],
10160 ip1[32],
10161 ip2[32],
10162 playerName[MAX_PLAYER_NAME],
10163 giveplayerName[MAX_PLAYER_NAME];
10164
10165 if(sscanf(params, "ud", id, cash)) return ShowSyntax(playerid, "/pay [playerid] [amount]");
10166
10167 if(P_DATA[playerid][pMoney] >= cash) {
10168 if(id != playerid && IsPlayerConnectedEx(id)) {
10169 if(cash > 0 && ((P_DATA[playerid][pPlayingHours] < 10 && cash < 5000) || P_DATA[playerid][pPlayingHours] >= 10)) {
10170 if(P_DATA[playerid][pAdminDuty] != 0 && P_DATA[playerid][pAdmin] > 0 || (IsPlayerInRangeOfPlayer(playerid, id, 4.0) && P_DATA[id][pSpectating] == INVALID_PLAYER_ID)) {
10171
10172 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
10173 GetPlayerName(id, giveplayerName, MAX_PLAYER_NAME);
10174
10175 P_DATA[playerid][pMoney] -= cash;
10176 P_DATA[id][pMoney] += cash;
10177
10178 PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
10179 PlayerPlaySound(id, 1052, 0.0, 0.0, 0.0);
10180
10181 format(string, sizeof(string), "You have paid $%d to %s.", cash, giveplayerName);
10182 SendClientMessage(playerid, COLOR_WHITE, string);
10183
10184 format(string, sizeof(string), "* %s takes out $%d in cash, and hands it to %s.", playerName, cash, giveplayerName);
10185 nearByMessage(playerid, COLOR_PURPLE, string);
10186
10187 GetPlayerIp(playerid, ip1, 32);
10188 GetPlayerIp(id, ip2, 32);
10189
10190 format(string, sizeof(string), "%s has paid you $%d.", playerName, cash);
10191 SendClientMessage(id, COLOR_WHITE, string);
10192
10193 if(P_DATA[playerid][pSpamCount] >= 3)
10194 {
10195 if(!strcmp(ip1, ip2,true))
10196 {
10197 format(string, sizeof(string), "Warning: {FFFFFF}%s has attempted to repeatedly pay $%d to %s (sharing IP address %s).", playerName, cash, giveplayerName, ip1);
10198 submitToAdmins(string, COLOR_HOTORANGE);
10199 }
10200 else if(P_DATA[playerid][pPlayingHours] < 2) {
10201 format(string, sizeof(string), "Warning: {FFFFFF}%s has attempted to repeatedly pay $%d to %s (with less than two playing hours).", playerName, cash, giveplayerName);
10202 submitToAdmins(string, COLOR_HOTORANGE);
10203 }
10204 }
10205 }
10206 else SendClientMessage(playerid, COLOR_GREY, "You're too far away from this person.");
10207 }
10208 else SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified (too high, or too low).");
10209 }
10210 else SendClientMessage(playerid, COLOR_GREY, "Invalid player specified (either yourself, or not connected).");
10211 }
10212 return 1;
10213}
10214
10215CMD:getjob(playerid, params[]) {
10216 if(P_DATA[playerid][pStatus] >= 1) {
10217
10218 new string[72];
10219 if(P_DATA[playerid][pJob] < 1) {
10220 for(new h = 0; h < sizeof(jobVariables); h++) {
10221 if(IsPlayerInRangeOfPoint(playerid, 5, jobVariables[h][jJobPosition][0], jobVariables[h][jJobPosition][1], jobVariables[h][jJobPosition][2])) {
10222 format(string, sizeof(string), "Congratulations. You have now become a %s.", jobVariables[h][jJobName]);
10223 SendClientMessage(playerid, COLOR_WHITE, string);
10224 P_DATA[playerid][pJob] = h;
10225 }
10226 }
10227 }
10228 else {
10229 SendClientMessage(playerid, COLOR_WHITE, "You already have a job (type /quitjob first).");
10230 }
10231 }
10232 return 1;
10233}
10234
10235CMD:quitjob(playerid, params[]) {
10236 if(P_DATA[playerid][pStatus] >= 1) {
10237 new string[128];
10238 if(P_DATA[playerid][pJob] >= 1) {
10239 format(string, sizeof(string), "You have quit your job (%s).", jobVariables[P_DATA[playerid][pJob]][jJobName]);
10240 SendClientMessage(playerid, COLOR_WHITE, string);
10241 P_DATA[playerid][pJob] = 0;
10242 P_DATA[playerid][pJobDelay] = 0;
10243 }
10244 }
10245 return 1;
10246}
10247
10248CMD:sms(playerid, params[]) {
10249 new szMessage[128], number, szQuery[256],szClearMsg[94],count,message[94];
10250 if(sscanf(params, "ds[94]",number,message)) return ShowSyntax(playerid, "/sms [number] [message]");
10251 if(number == -1) return SendClientMessage(playerid, COLOR_GREY, "Invalid number.");
10252 if(P_DATA[playerid][pPhoneStatus] != 1) return SendClientMessage(playerid, COLOR_GREY, "Your phone is not switched on.");
10253 if(P_DATA[playerid][pPhoneCredit] < 1) return SendClientMessage(playerid, COLOR_GREY, "You have no remaining phone credit - visit a 24/7 to top it up.");
10254 foreach(new x : Player) {
10255 if(P_DATA[x][pPhoneNumber] == number) {
10256 if(P_DATA[x][pPhoneStatus] == 1 && P_DATA[x][pPrisonID] != 3) {
10257 format(szMessage, sizeof(szMessage), "SMS from %s (%d): %s", GetName(playerid), P_DATA[playerid][pPhoneNumber], message),SendClientMessage(x, COLOR_SMS, szMessage);
10258 format(szMessage, sizeof(szMessage), "SMS sent to %s (%d): %s", GetName(x), P_DATA[x][pPhoneNumber], message),SendClientMessage(playerid, COLOR_SMS, szMessage);
10259 P_DATA[playerid][pPhoneCredit] -= 3;
10260 mysql_real_escape_string(message, szClearMsg);
10261 format(szQuery, sizeof(szQuery), "INSERT INTO `phoneLogs` (`phoneNumber`, `phoneAction`) VALUES('%d', 'SMS to %s: %s')", P_DATA[playerid][pPhoneNumber], GetName(x), message);
10262 mysql_query(SQL, szQuery);
10263 return 1;
10264 }
10265 else return SendClientMessage(playerid, COLOR_GREY, "The cellphone that you're trying to SMS is currently unavailable.");
10266 }
10267 count++;
10268 }
10269 return 1;
10270}
10271CMD:t(playerid, params[]) return cmd_sms(playerid, params);
10272CMD:call(playerid, params[]) {
10273 new number = strval(params), playerName[MAX_PLAYER_NAME],string[128];
10274 if(isnull(params)) return ShowSyntax(playerid, "/call [number]");
10275 if(P_DATA[playerid][pPhoneNumber] == -1) SendClientMessage(playerid, COLOR_GREY, "You don't have a phone.");
10276 else if(P_DATA[playerid][pPhoneNumber] == number) SendClientMessage(playerid, COLOR_GREY, "You're trying to call yourself.");
10277 else {
10278 if(P_DATA[playerid][pPhoneStatus] == 1) {
10279 if(P_DATA[playerid][pPhoneCredit] >= 1) {
10280 if(P_DATA[playerid][pPhoneCall] == -1) {
10281 if(number == 911) {
10282 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
10283 P_DATA[playerid][pPhoneCall] = 911;
10284 SendClientMessage(playerid, COLOR_WHITE, "You've called Emergency services, please select the department you desire (i.e: LSPD, LSFMD).");
10285 }
10286 else if(number != -1) {
10287 GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
10288 format(string, sizeof(string), "* %s takes out their cellphone, and dials in a number.", playerName, number);
10289 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
10290 nearByMessage(playerid, COLOR_PURPLE, string);
10291
10292 foreach(new i : Player) {
10293 if(P_DATA[i][pPhoneNumber] == number) {
10294 if(P_DATA[i][pStatus] == 1 && P_DATA[i][pSpectating] == INVALID_PLAYER_ID && P_DATA[i][pPhoneStatus] == 1 && P_DATA[i][pPhoneCall] == -1 && P_DATA[i][pPrisonID] != 3) {
10295
10296 GetPlayerName(i, playerName, MAX_PLAYER_NAME);
10297 format(string, sizeof(string), "* %s's cellphone starts to ring...", playerName);
10298 nearByMessage(i, COLOR_PURPLE, string);
10299 SendClientMessage(i, COLOR_WHITE, "Use /p(ickup) to answer your phone.");
10300
10301 SendClientMessage(playerid, COLOR_WHITE, "You can use the 'T' chat to proceed to talk.");
10302 P_DATA[playerid][pPhoneCall] = i;
10303 return 1;
10304 }
10305 else {
10306 SendClientMessage(playerid, COLOR_GREY, "(cellphone) *busy tone*");
10307 return 1;
10308 }
10309 }
10310 }
10311 if(P_DATA[playerid][pPhoneCall] == -1) SendClientMessage(playerid, COLOR_GREY, "(cellphone) *busy tone*");
10312 }
10313 else SendClientMessage(playerid, COLOR_GREY, "Invalid number.");
10314 }
10315 else SendClientMessage(playerid, COLOR_GREY, "You are currently in a call.");
10316 }
10317 else SendClientMessage(playerid, COLOR_GREY, "You have no remaining phone credit - visit a 24/7 to top it up.");
10318 }
10319 else SendClientMessage(playerid, COLOR_GREY, "You must switch your phone on first (/togphone).");
10320 }
10321 return 1;
10322}
10323CMD:pickup(playerid, params[]) {
10324 foreach(new i : Player) if(P_DATA[i][pPhoneCall] == playerid) P_DATA[playerid][pPhoneCall] = i,SendClientMessage(playerid, COLOR_WHITE, "You have answered your phone."),SendClientMessage(P_DATA[playerid][pPhoneCall], COLOR_WHITE, "The other person has answered the call."),SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
10325 return 1;
10326}
10327CMD:p(playerid, params[]) return cmd_pickup(playerid, params);
10328CMD:h(playerid, params[]) return cmd_hangup(playerid, params);
10329
10330CMD:togphone(playerid, params[]) {
10331 if(P_DATA[playerid][pPhoneNumber] != -1) {
10332 if(P_DATA[playerid][pPhoneStatus] == 1) {
10333 P_DATA[playerid][pPhoneStatus] = 0;
10334 SendClientMessage(playerid, COLOR_WHITE, "Your phone has been turned off.");
10335 }
10336 else {
10337 P_DATA[playerid][pPhoneStatus] = 1;
10338 SendClientMessage(playerid, COLOR_WHITE, "Your phone is now switched on.");
10339 }
10340 }
10341 else SendClientMessage(playerid, COLOR_GREY, "You don't have a phone.");
10342 return 1;
10343}
10344CMD:skip(playerid, params[]) {
10345 if(P_DATA[playerid][pTutorial] > 0) return SCM(playerid, COLOR_WHITE, "Nu te aflii in Tutorial.");
10346 ShowPlayerDialog(playerid, DIALOG_SKIP, DIALOG_STYLE_MSGBOX, "Tutorial Skip", "Are you sure you want to go over the tutorial?\nHere you can find useful informations.", "Yes", "No");
10347 return 1;
10348}
10349CMD:hangup(playerid, params[]) {
10350
10351 if(P_DATA[playerid][pPhoneCall] != -1)
10352 SendClientMessage(playerid, COLOR_WHITE, "You have terminated the current call.");
10353
10354 if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE)
10355 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
10356
10357 if(P_DATA[playerid][pPhoneCall] != -1 && P_DATA[playerid][pPhoneCall] < MAX_PLAYERS) { // Valid values are 0-MAX_PLAYERS, 911 and such are used for 911 calls.
10358 SendClientMessage(P_DATA[playerid][pPhoneCall], COLOR_WHITE, "Your call has been terminated by the other party.");
10359
10360 if(GetPlayerSpecialAction(P_DATA[playerid][pPhoneCall]) == SPECIAL_ACTION_USECELLPHONE)
10361 SetPlayerSpecialAction(P_DATA[playerid][pPhoneCall], SPECIAL_ACTION_STOPUSECELLPHONE);
10362
10363 P_DATA[P_DATA[playerid][pPhoneCall]][pPhoneCall] = -1;
10364 }
10365
10366 P_DATA[playerid][pPhoneCall] = -1;
10367 return 1;
10368}
10369function UpdateVar(playerid, varname[], amount) {
10370 if(playerid == INVALID_PLAYER_ID) return 1;
10371 new query[256];
10372 mysql_format(SQL, query, sizeof(query), "UPDATE `playeraccounts` SET `%s`='%d' WHERE `playerName`='%s'", varname, amount, GetName(playerid)),mysql_tquery(SQL, query, "", "");
10373 return 1;
10374}
10375function OnPlayerLogin(const playerid, const stat)
10376{
10377 GameTextForPlayer(playerid, "~r~CHECKING THE PASSWORD", 700, 3);
10378 if(stat == 0)
10379 {
10380 SetPVarInt(playerid, "LA", GetPVarInt(playerid, "LA") + 1);
10381 if(GetPVarInt(playerid, "LA") >= MAX_LOGIN_ATTEMPTS) KickEx(playerid);
10382 else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "SERVER: Login", "Welcome to the "SERVER_NAME" Server.\n\nPlease enter your password below!", "Login", "Cancel");
10383 }
10384 else
10385 {
10386 DeletePVar(playerid, "LA");
10387
10388 /*====================================================================
10389 LoadPlayerData
10390 ====================================================================*/
10391
10392 /* Strings */
10393 cache_get_field_content(0, "playerPassword", P_DATA[playerid][pPassword], SQL, 129);
10394 cache_get_field_content(0, "playerEmail", P_DATA[playerid][pEmail], SQL, 129);
10395 cache_get_field_content(0, "playerWarning1", P_DATA[playerid][pWarning1], SQL, 32);
10396 cache_get_field_content(0, "playerWarning2", P_DATA[playerid][pWarning2], SQL, 32);
10397 cache_get_field_content(0, "playerWarning3", P_DATA[playerid][pWarning3], SQL, 32);
10398
10399 /* Integers */
10400 P_DATA[playerid][pSkin] = cache_get_field_content_int(0, "playerSkin");
10401 P_DATA[playerid][pMoney] = cache_get_field_content_int(0, "playerMoney");
10402 P_DATA[playerid][pBankMoney] = cache_get_field_content_int(0, "playerBankMoney");
10403 P_DATA[playerid][pAdmin] = cache_get_field_content_int(0, "playerAdminLevel");
10404 P_DATA[playerid][pInterior] = cache_get_field_content_int(0, "playerInterior");
10405 P_DATA[playerid][pVirtualWorld] = cache_get_field_content_int(0, "playerVirtualWorld");
10406 P_DATA[playerid][pSQL] = cache_get_field_content_int(0, "playerID");
10407 P_DATA[playerid][pJob] = cache_get_field_content_int(0, "playerJob");
10408 P_DATA[playerid][pBanned] = cache_get_field_content_int(0, "playerBanned");
10409 P_DATA[playerid][pWeapons][0] = cache_get_field_content_int(0, "playerWeapon0");
10410 P_DATA[playerid][pWeapons][1] = cache_get_field_content_int(0, "playerWeapon1");
10411 P_DATA[playerid][pWeapons][2] = cache_get_field_content_int(0, "playerWeapon2");
10412 P_DATA[playerid][pWeapons][3] = cache_get_field_content_int(0, "playerWeapon3");
10413 P_DATA[playerid][pWeapons][4] = cache_get_field_content_int(0, "playerWeapon4");
10414 P_DATA[playerid][pWeapons][5] = cache_get_field_content_int(0, "playerWeapon5");
10415 P_DATA[playerid][pWeapons][6] = cache_get_field_content_int(0, "playerWeapon6");
10416 P_DATA[playerid][pWeapons][7] = cache_get_field_content_int(0, "playerWeapon7");
10417 P_DATA[playerid][pWeapons][8] = cache_get_field_content_int(0, "playerWeapon8");
10418 P_DATA[playerid][pWeapons][9] = cache_get_field_content_int(0, "playerWeapon9");
10419 P_DATA[playerid][pWeapons][10] = cache_get_field_content_int(0, "playerWeapon10");
10420 P_DATA[playerid][pWeapons][11] = cache_get_field_content_int(0, "playerWeapon11");
10421 P_DATA[playerid][pWeapons][12] = cache_get_field_content_int(0, "playerWeapon12");
10422 P_DATA[playerid][pMaterials] = cache_get_field_content_int(0, "playerMaterials");
10423 P_DATA[playerid][pGroup] = cache_get_field_content_int(0, "playerGroup");
10424 P_DATA[playerid][pGroupRank] = cache_get_field_content_int(0, "playerGroupRank");
10425 P_DATA[playerid][pPlayingHours] = cache_get_field_content_int(0, "playerHours");
10426 P_DATA[playerid][pFirstLogin] = cache_get_field_content_int(0, "playerFirstLogin");
10427 P_DATA[playerid][pGender] = cache_get_field_content_int(0, "playerGender");
10428 P_DATA[playerid][pPrisonID] = cache_get_field_content_int(0, "playerPrisonID");
10429 P_DATA[playerid][pPrisonTime] = cache_get_field_content_int(0, "playerPrisonTime");
10430 P_DATA[playerid][pPhoneNumber] = cache_get_field_content_int(0, "playerPhoneNumber");
10431 P_DATA[playerid][pPhoneBook] = cache_get_field_content_int(0, "playerPhoneBook");
10432 P_DATA[playerid][pHelper] = cache_get_field_content_int(0, "playerHelperLevel");
10433 P_DATA[playerid][pDropCarTimeout] = cache_get_field_content_int(0, "playerDropCarTimeout");
10434 P_DATA[playerid][pRope] = cache_get_field_content_int(0, "playerRope");
10435 P_DATA[playerid][pAdminDuty] = cache_get_field_content_int(0, "playerAdminDuty");
10436 P_DATA[playerid][pCrimes] = cache_get_field_content_int(0, "playerCrimes");
10437 P_DATA[playerid][pArrests] = cache_get_field_content_int(0, "playerArrests");
10438 P_DATA[playerid][pWarrants] = cache_get_field_content_int(0, "playerWarrants");
10439 P_DATA[playerid][pAge] = cache_get_field_content_int(0, "playerAge");
10440 P_DATA[playerid][pFightStyle] = cache_get_field_content_int(0, "playerFightStyle");
10441 P_DATA[playerid][pPhoneCredit] = cache_get_field_content_int(0, "playerPhoneCredit");
10442 P_DATA[playerid][pWalkieTalkie] = cache_get_field_content_int(0, "playerWalkieTalkie");
10443 P_DATA[playerid][pCarLic] = cache_get_field_content_int(0, "playerCarLic");
10444 P_DATA[playerid][pLanguage] = cache_get_field_content_int(0, "playerLanguage");
10445 P_DATA[playerid][pColor] = cache_get_field_content_int(0, "playerColor");
10446 P_DATA[playerid][pSex] = cache_get_field_content_int(0, "playerSex");
10447 P_DATA[playerid][pPremiumPoints] = cache_get_field_content_int(0, "premiumPoints");
10448 P_DATA[playerid][v_Slots] = cache_get_field_content_int(0, "vSlots");
10449
10450 /* Floats */
10451 P_DATA[playerid][pArmour] = cache_get_field_content_int(0, "playerArmour");
10452 P_DATA[playerid][pHealth] = cache_get_field_content_int(0, "playerHealth");
10453
10454 P_DATA[playerid][pStatus] = 1;
10455
10456 /* PlayerVehicles */
10457 for(new x = 0; x < MAX_VEHICLE_SLOTS; x++)
10458 {
10459 dSelectedSlot[playerid][x] = -1;
10460 P_DATA[playerid][v_SQL][x] = 0;
10461 P_DATA[playerid][v_Model][x] = 0;
10462 P_DATA[playerid][v_Col1][x] = 0;
10463 P_DATA[playerid][v_Col2][x] = 0;
10464 P_DATA[playerid][v_KM][x] = 0;
10465 P_DATA[playerid][v_Age][x] = 0;
10466 P_DATA[playerid][v_PosX][x] = 0;
10467 P_DATA[playerid][v_PosY][x] = 0;
10468 P_DATA[playerid][v_PosZ][x] = 0;
10469 P_DATA[playerid][v_PosA][x] = 0;
10470 P_DATA[playerid][v_Spawned][x] = 0;
10471 for(new y = 0; y < 14; y++)
10472 v_Mod[playerid][x][y] = 0;
10473 }
10474 loadPlayerVehicles(playerid);
10475
10476 new
10477 szQuery[256];
10478
10479 format(szQuery, sizeof(szQuery), "INSERT INTO playerconnections (conName, conIP) VALUES('%s', '%s')", P_DATA[playerid][pNormalName], P_DATA[playerid][pConnectionIP]);
10480 mysql_tquery(SQL, szQuery);
10481
10482 format(szQuery, sizeof(szQuery), "UPDATE playeraccounts SET playerStatus = '1' WHERE playerID = '%d'", P_DATA[playerid][pSQL]);
10483 mysql_tquery(SQL, szQuery);
10484
10485 if(P_DATA[playerid][pFirstLogin] >= 1) {
10486 return initiateTutorial(playerid);
10487 }
10488
10489 SetSpawnInfo(playerid, 0, P_DATA[playerid][pSkin], SERVER_SPAWN, 0, 0, 0, 0, 0, 0, 0);
10490 SpawnPlayer(playerid);
10491 GetPlayerName(playerid, P_DATA[playerid][pNormalName], MAX_PLAYER_NAME);
10492
10493 if(P_DATA[playerid][pGroup] >= 1) {
10494
10495 new
10496 string[128];
10497
10498 format(string, sizeof(string), "%s from your group has logged in.", GetName(playerid));
10499 SendToGroup(P_DATA[playerid][pGroup], COLOR_GENANNOUNCE, string);
10500
10501 format(string, sizeof(string), "Group MOTD: {FFFFFF}%s", groupVariables[P_DATA[playerid][pGroup]][gGroupMOTD]);
10502 SendClientMessage(playerid, COLOR_GENANNOUNCE, string);
10503 }
10504
10505 if(P_DATA[playerid][pAdmin] > 0) {
10506 new string[128];
10507 format(string, sizeof string, "You are a level %d admin. There are %d admins online.",P_DATA[playerid][pAdmin],Iter_Count(Admins)),SCM(playerid, COLOR_WHITE,string);
10508 format(string, sizeof string, "(B) HelloBot: %s has just logged in.",GetName(playerid)),submitToAdmins(string,COLOR_ADMCHAT);
10509 Iter_Add(Admins, playerid);
10510 }
10511 if(P_DATA[playerid][pHelper] > 0) {
10512 new string[128];
10513 format(string, sizeof string, "You are a level %d helper. There are %d helpers online.",P_DATA[playerid][pHelper],Iter_Count(Helpers)),SCM(playerid, COLOR_WHITE,string);
10514 format(string, sizeof string, "(B) HelloBot: %s has just logged in.",GetName(playerid)),submitToAdmins(string,COLOR_ADMCHAT);
10515 Iter_Add(Helpers, playerid);
10516 }
10517 new name[30];
10518 format(name,sizeof name,"%s/%s", GetName(playerid), SERVER_NAME),PlayerTextDrawSetString(playerid, logo, name),PlayerTextDrawShow(playerid, logo);
10519 }
10520 return 1;
10521}
10522
10523CMD:v(playerid) {
10524 ShowPlayerVehicleMenu(playerid, 1);
10525 return 1;
10526}
10527
10528CMD:towcar(playerid)
10529{
10530 ShowPlayerVehicleMenu(playerid, 2);
10531 return 1;
10532}
10533
10534CMD:findcar(playerid)
10535{
10536 ShowPlayerVehicleMenu(playerid, 3);
10537 return 1;
10538}
10539
10540CMD:park(playerid)
10541{
10542 if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, -1, ""R"Error"W": You need to be in one of your cars");
10543 new vID = GetPlayerVehicleID(playerid);
10544 if(!IsAnOwnableVehicle(vID) || V_DATA[vID][vOwner] != P_DATA[playerid][pSQL]) return SCM(playerid, -1, ""R"Error"W": You can't park this vehicle !");
10545 new x = V_DATA[vID][vSlot];
10546 GetVehiclePos(vID, P_DATA[playerid][v_PosX][x], P_DATA[playerid][v_PosY][x], P_DATA[playerid][v_PosZ][x]);
10547 GetVehicleZAngle(vID, P_DATA[playerid][v_PosA][x]);
10548 SavePlayerVehicle(playerid, x);
10549 DespawnVehicle(playerid, x);
10550 SpawnVehicle(playerid, x);
10551 PutPlayerInVehicle(playerid, vID, 0);
10552 SCM(playerid, -1, ""B"(Server)"W": You just parked your vehicle !");
10553 return 1;
10554}
10555
10556CMD:lock(playerid)
10557{
10558 new vID, count = 0, Float: fPos[3];
10559 for(new x = 0; x < P_DATA[playerid][v_Slots]; x++)
10560 {
10561 if(!P_DATA[playerid][v_Spawned][x])
10562 continue;
10563
10564 GetVehiclePos(P_DATA[playerid][pVeh][x], fPos[0], fPos[1], fPos[2]);
10565 if(IsPlayerInRangeOfPoint(playerid, 2.5, fPos[0], fPos[1], fPos[2]))
10566 {
10567 vID = P_DATA[playerid][pVeh][x];
10568 count ++;
10569 }
10570 }
10571 if(!count) return SCM(playerid, -1, ""R"Error"W": You are not near of your cars.");
10572 V_DATA[vID][vLock] = !V_DATA[vID][vLock];
10573 new vParam[7];
10574 GetVehicleParamsEx(vID, vParam[0], vParam[1], vParam[2], vParam[3], vParam[4], vParam[5], vParam[6]);
10575 SetVehicleParamsEx(vID, vParam[0], vParam[1], vParam[2], V_DATA[vID][vLock], vParam[4], vParam[5], vParam[6]);
10576 SCM(playerid, -1, (!V_DATA[vID][vLock]) ? (""B"(Server)"W": You just unlocked your vehicle.") : (""B"(Server)"W": You just locked your vehicle."));
10577 return 1;
10578}
10579
10580CMD:changeplate(playerid, params[])
10581{
10582 new
10583 szPlate[32], vID = GetPlayerVehicleID(playerid);
10584
10585 if(vID == INVALID_VEHICLE_ID)
10586 return SCM(playerid, -1, ""R"Error"W": You are not in a vehicle !");
10587
10588 if(!IsAnOwnableVehicle(vID) || V_DATA[vID][vOwner] != P_DATA[playerid][pSQL])
10589 return SCM(playerid, -1, ""R"Error"W": You don't own this vehicle!");
10590
10591 if(sscanf(params, "s[10]", szPlate))
10592 return SCM(playerid, -1, ""B"Usage"W": /changeplate <New Plate>");
10593
10594 if(strlen(szPlate) < 3 || strlen(szPlate) > 10)
10595 return SCM(playerid, -1, ""R"Error"W": Number plate needs to be between 3 and 10 characters !");
10596
10597 format(v_Plate[playerid][V_DATA[vID][vSlot]], 32, szPlate);
10598 SetVehicleNumberPlate(vID, v_Plate[playerid][V_DATA[vID][vSlot]]);
10599 SavePlayerVehicle(playerid, V_DATA[vID][vSlot]);
10600 return 1;
10601}
10602
10603
10604SCMF(playerid, color, const fstring[], va_args<>)
10605{
10606 new str[145];
10607 va_format(str, sizeof (str), fstring, va_start<3>);
10608 return SendClientMessage(playerid, color, str);
10609}
10610
10611Function:: ShowPlayerVehicleMenu(const playerid, const action_id)
10612{
10613 new szString[512], slot = 0, szEmpty[71];
10614 vMAction[playerid] = action_id;
10615 strcat(szString, (action_id == 1) ? ("Vehicle Name\tStatus\n[+] Extra vehicle slot 25PP\n") : ("Vehicle Name\tStatus\n"), sizeof(szString));
10616 for(new x = 0; x < P_DATA[playerid][v_Slots]; x++)
10617 {
10618 dSelectedSlot[playerid][x] = -1;
10619 if(P_DATA[playerid][v_SQL][x] != 0)
10620 {
10621 format(szString, sizeof(szString), "%s%s%s\t%s\n", szString, VehicleNames[P_DATA[playerid][v_Model][x] - 400], (P_DATA[playerid][v_VIP][x]) ? (" - [VIP]") : ("{FFFFFF}"), (P_DATA[playerid][v_Spawned][x] > 0) ? (""G"Spawned"W"") : (""R"Despawned"W""));
10622 dSelectedSlot[playerid][slot++] = x;
10623 } else strcat(szEmpty, "[Empty]\n", sizeof(szEmpty));
10624 }
10625
10626 strcat(szString, szEmpty, sizeof(szString));
10627
10628 if(slot == 0)
10629 return SCM(playerid, -1, ""R"Error"W": You don't own any vehicle.");
10630
10631 ShowPlayerDialog(playerid, D_Veh, DIALOG_STYLE_TABLIST_HEADERS, ""B"Vehicle Menu::"W" Select Vehicle", szString, "Select", "Exit");
10632 return 1;
10633}
10634
10635IsVIPModel(const m) return (m == 411 || m == 541 || m == 560) ? (true) : (false);
10636
10637ChangeVipTextState(const playerid, const x, bool:iState = false)
10638{
10639 if(P_DATA[playerid][v_VIP][x] && IsVIPModel(P_DATA[playerid][v_Model][x]))
10640 {
10641 new vID = P_DATA[playerid][pVeh][x],
10642 szString[64];
10643
10644 if(IsValidObject(V_DATA[vID][vText]))
10645 DestroyObject(V_DATA[vID][vText]);
10646
10647 if(iState == true)
10648 {
10649 format(szString, sizeof(szString), "{%06x}%s", v_vTextColor[playerid][x] >>> 8, v_vText[playerid][x]);
10650 V_DATA[vID][vText] = CreateObject(19327,0,0,-1000,0,0,0,100);
10651 SetObjectMaterialText(V_DATA[vID][vText], szString, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 30, 1, 0xFFFFFFFF, 0, 1);
10652 switch(P_DATA[playerid][v_Model][x])
10653 {
10654 case 411: AttachObjectToVehicle(V_DATA[vID][vText], vID, -0.029999, -1.974998, 0.233999, -84.824964, 0.000000, 0.000000);
10655 case 541: AttachObjectToVehicle(V_DATA[vID][vText], vID, 0.000000, -1.649998, 0.390999, -76.379989, 0.000000, 0.000000);
10656 case 560: AttachObjectToVehicle(V_DATA[vID][vText], vID, 0.000000, -0.614999, 0.799999, -88.439956, 0.000000, 0.000000);
10657 }
10658 }
10659 }
10660 return 1;
10661}
10662
10663Function:: IsAnOwnableVehicle(const vID) return (V_DATA[vID][vSQL] != 0 && V_DATA[vID][vType] == 1) ? (true) : (false);
10664Function:: loadPlayerVehicles(const playerid)
10665{
10666 new Cache: r, szQuery[128];
10667 format(szQuery, sizeof(szQuery), "SELECT * FROM `vehs` WHERE `Owner` = %d ORDER BY `ID` ASC", P_DATA[playerid][pSQL]);
10668 r = mysql_query(SQL, szQuery, true);
10669 if(cache_get_row_count())
10670 {
10671 new szTemp[256];
10672 for(new x = 0; x < cache_get_row_count(); x++)
10673 {
10674 if(x >= MAX_VEHICLE_SLOTS)
10675 continue;
10676
10677 P_DATA[playerid][v_SQL][x] = cache_get_field_content_int(x, "ID");
10678 P_DATA[playerid][v_Model][x] = cache_get_field_content_int(x, "Model");
10679 P_DATA[playerid][v_Col1][x] = cache_get_field_content_int(x, "Color1");
10680 P_DATA[playerid][v_Col2][x] = cache_get_field_content_int(x, "Color2");
10681 P_DATA[playerid][v_KM][x] = cache_get_field_content_float(x, "KM");
10682 P_DATA[playerid][v_Age][x] = cache_get_field_content_int(x, "Age");
10683 P_DATA[playerid][v_PosX][x] = cache_get_field_content_float(x, "X");
10684 P_DATA[playerid][v_PosY][x] = cache_get_field_content_float(x, "Y");
10685 P_DATA[playerid][v_PosZ][x] = cache_get_field_content_float(x, "Z");
10686 P_DATA[playerid][v_PosA][x] = cache_get_field_content_float(x, "A");
10687 P_DATA[playerid][v_VIP][x] = cache_get_field_content_int(x, "VIP");
10688 P_DATA[playerid][v_Price][x] = cache_get_field_content_int(x, "Price");
10689 P_DATA[playerid][v_InsurancePoints][x] = cache_get_field_content_int(x, "InsurancePoints");
10690 cache_get_field_content(x, "VIPText", v_vText[playerid][x], 11);
10691 cache_get_field_content(x, "Plate", v_Plate[playerid][x], 32);
10692 v_vTextColor[playerid][x] = cache_get_field_content_int(x, "VipTextColor");
10693 P_DATA[playerid][v_vTextStatus][x] = cache_get_field_content_int(x, "VipTextState") == 1 ? true : false;
10694 P_DATA[playerid][v_Spawned][x] = 0;
10695 cache_get_field_content(x, "Mods", szTemp, SQL, 256);
10696 sscanf(szTemp, "p<|>dddddddddddddd", v_Mod[playerid][x][0], v_Mod[playerid][x][1], v_Mod[playerid][x][2], v_Mod[playerid][x][3], v_Mod[playerid][x][4], v_Mod[playerid][x][5], v_Mod[playerid][x][6], v_Mod[playerid][x][7], v_Mod[playerid][x][8], v_Mod[playerid][x][9],
10697 v_Mod[playerid][x][10], v_Mod[playerid][x][11], v_Mod[playerid][x][12], v_Mod[playerid][x][13]);
10698 cache_get_field_content(x, "Damage", szTemp, SQL, sizeof(szTemp));
10699 sscanf(szTemp, "p<|>dddd", v_Dmg[playerid][x][0], v_Dmg[playerid][x][1], v_Dmg[playerid][x][2], v_Dmg[playerid][x][3]);
10700
10701 printf("Vehicle SQL: %d | Vehicle Colors: %d, %d | Vehicle Model: %d", P_DATA[playerid][v_SQL][x], P_DATA[playerid][v_Col1][x], P_DATA[playerid][v_Col2][x], P_DATA[playerid][v_Model][x]);
10702 }
10703 }
10704 cache_delete(r);
10705 return 1;
10706}
10707
10708Function:: InsertPlayerVehicle(const playerid, const model, const color1, const color2, const price, const Float: vX, const Float: vY, const Float: vZ, const Float: vA)
10709{
10710 new x = GetFreeVehicleSlot(playerid);
10711 if(x == -1)
10712 return SCM(playerid, -1, ""R"Error"W": You don't have free vehicle slots !");
10713
10714 if(GetPlayerCash(playerid) < price)
10715 return SCM(playerid, -1, ""R"Error"W": You don't have enough money to buy this vehicle !");
10716
10717 GivePlayerMoney(playerid, -price);
10718
10719 new Cache: r, szQuery[128];
10720 format(szQuery, sizeof(szQuery), "INSERT INTO `vehs` (`Model`, `Owner`) VALUES (%d, %d)", model, P_DATA[playerid][pSQL]);
10721 r = mysql_query(SQL, szQuery, true);
10722 if(cache_insert_id())
10723 {
10724 P_DATA[playerid][v_SQL][x] = cache_insert_id();
10725 P_DATA[playerid][v_Model][x] = model;
10726 P_DATA[playerid][v_Col1][x] = color1;
10727 P_DATA[playerid][v_Col2][x] = color2;
10728 P_DATA[playerid][v_Paint][x] = 0;
10729 P_DATA[playerid][v_Age][x] = gettime();
10730 format(v_Plate[playerid][x], 32, "%s", GetName(playerid));
10731 P_DATA[playerid][v_KM][x] = 0;
10732 P_DATA[playerid][v_PosX][x] = vX;
10733 P_DATA[playerid][v_PosY][x] = vY;
10734 P_DATA[playerid][v_PosZ][x] = vZ;
10735 P_DATA[playerid][v_PosA][x] = vA;
10736 SpawnVehicle(playerid, x);
10737 SavePlayerVehicle(playerid, x);
10738 }
10739 cache_delete(r);
10740 return 1;
10741}
10742
10743GetFreeVehicleSlot(const playerid)
10744{
10745 new i = -1;
10746 for(new x = 0; x < P_DATA[playerid][v_Slots]; x++)
10747 if(P_DATA[playerid][pVeh][x] == 0)
10748 i = x;
10749
10750 return i;
10751}
10752
10753TowVehicle(const playerid, const x)
10754{
10755 new vID = P_DATA[playerid][pVeh][x];
10756 RepairVehicle(vID);
10757 SetVehicleHealth(vID, 1000.0);
10758 SetVehiclePos(vID, P_DATA[playerid][v_PosX][x], P_DATA[playerid][v_PosY][x], P_DATA[playerid][v_PosZ][x]);
10759 SetVehicleZAngle(vID, P_DATA[playerid][v_PosA][x]);
10760 SetVehicleParamsEx(vID, 0, 0, 0, V_DATA[vID][vLock], 0, 0, 0);
10761 LinkVehicleToInterior(vID, 0);
10762 return 1;
10763}
10764
10765SpawnVehicle(const playerid, const x)
10766{
10767 if(x == -1)
10768 return 1;
10769
10770 new vID, vParam[7];
10771 P_DATA[playerid][pVeh][x] = vID = CreateVehicle(P_DATA[playerid][v_Model][x], P_DATA[playerid][v_PosX][x], P_DATA[playerid][v_PosY][x], P_DATA[playerid][v_PosZ][x], P_DATA[playerid][v_PosA][x], P_DATA[playerid][v_Col1][x], P_DATA[playerid][v_Col2][x], -1);
10772
10773 V_DATA[vID][vModel] = P_DATA[playerid][v_Model][x];
10774 V_DATA[vID][vType] = 1;
10775 V_DATA[vID][vOwnerID] = playerid;
10776 V_DATA[vID][vOwner] = P_DATA[playerid][pSQL];
10777 V_DATA[vID][vCol][0] = P_DATA[playerid][v_Col1][x];
10778 V_DATA[vID][vCol][1] = P_DATA[playerid][v_Col2][x];
10779 V_DATA[vID][vKM] = P_DATA[playerid][v_KM][x];
10780 V_DATA[vID][vAge] = P_DATA[playerid][v_Age][x];
10781 V_DATA[vID][vSQL] = P_DATA[playerid][v_SQL][x];
10782 V_DATA[vID][vInsurancePoints] = P_DATA[playerid][v_InsurancePoints][x];
10783 V_DATA[vID][vSlot] = x;
10784 V_DATA[vID][vLock] = true;
10785 GetVehicleParamsEx(vID, vParam[0], vParam[1], vParam[2], vParam[3], vParam[4], vParam[5], vParam[6]);
10786 SetVehicleParamsEx(vID, vParam[0], vParam[1], vParam[2], V_DATA[vID][vLock], vParam[4], vParam[5], vParam[6]);
10787 UpdateVehicleDamageStatus(vID, v_Dmg[playerid][x][0], v_Dmg[playerid][x][1], v_Dmg[playerid][x][2], v_Dmg[playerid][x][3]);
10788 ChangeVipTextState(playerid, x, P_DATA[playerid][v_vTextStatus][x]);
10789 ChangeVehiclePaintjob(P_DATA[playerid][pVeh][x], P_DATA[playerid][v_Paint][x]);
10790 format(V_DATA[vID][szvOwner], MAX_PLAYER_NAME, GetName(playerid));
10791 P_DATA[playerid][v_Spawned][x] = gettime() + MAX_SPAWNED_TIME;
10792 Iter_Add(pVehs, vID);
10793
10794 SavePlayerVehicle(playerid, x);
10795
10796 for(new i = 0; i < 14; i++)
10797 if(v_Mod[playerid][x][i] != 0)
10798 AddVehicleComponent(P_DATA[playerid][pVeh][x], v_Mod[playerid][x][i]);
10799
10800 return 1;
10801}
10802
10803DespawnVehicle(const playerid, const x)
10804{
10805 if(x == -1)
10806 return 1;
10807
10808 new vID = P_DATA[playerid][pVeh][x];
10809 Iter_Remove(pVehs, vID);
10810 GetVehicleDamageStatus(vID, v_Dmg[playerid][x][0], v_Dmg[playerid][x][1], v_Dmg[playerid][x][2], v_Dmg[playerid][x][3]);
10811 P_DATA[playerid][v_KM][x] = V_DATA[vID][vKM];
10812 P_DATA[playerid][v_InsurancePoints] = V_DATA[vID][vInsurancePoints];
10813 DestroyObject(V_DATA[vID][vText]);
10814 SavePlayerVehicle(playerid, x);
10815 P_DATA[playerid][pVeh][x] = 0;
10816 P_DATA[playerid][v_Spawned][x] = 0;
10817 V_DATA[vID][vType] = 1;
10818 V_DATA[vID][vOwner] = 0;
10819 V_DATA[vID][vCol][0] = 0;
10820 V_DATA[vID][vCol][1] = 0;
10821 V_DATA[vID][vKM] = 0;
10822 V_DATA[vID][vAge] = 0;
10823 V_DATA[vID][vSQL] = 0;
10824 V_DATA[vID][vSlot] = 0;
10825 V_DATA[vID][vModel] = 0;
10826 V_DATA[vID][vType] = 0;
10827 V_DATA[vID][vOwnerID] = -1;
10828 DestroyVehicle(vID);
10829 return 1;
10830}
10831
10832SavePlayerVehicle(const playerid, const x)
10833{
10834 new szQuery[512];
10835 mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `vehs` SET `Owner` = %d, `Color1` = %d, `Color2` = %d, `KM` = %f, `X` = %f, `Y` = %f, `Z` = %f, `A` = %f, `Age` = %d, `VIP` = %d, `Price` = %d WHERE `ID` = %d", P_DATA[playerid][pSQL], P_DATA[playerid][v_Col1][x], P_DATA[playerid][v_Col2][x], P_DATA[playerid][v_KM][x],
10836 P_DATA[playerid][v_PosX][x], P_DATA[playerid][v_PosY][x], P_DATA[playerid][v_PosZ][x], P_DATA[playerid][v_PosA][x], P_DATA[playerid][v_Age][x], P_DATA[playerid][v_VIP][x], P_DATA[playerid][v_Price][x], P_DATA[playerid][v_SQL][x]);
10837 mysql_tquery(SQL, szQuery);
10838
10839 format(szQuery, sizeof(szQuery), "UPDATE `vehs` SET `Mods` = '%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d', `Damage` = '%d|%d|%d|%d' WHERE `ID` = %d", v_Mod[playerid][x][0], v_Mod[playerid][x][1], v_Mod[playerid][x][2], v_Mod[playerid][x][3], v_Mod[playerid][x][4], v_Mod[playerid][x][5], v_Mod[playerid][x][6], v_Mod[playerid][x][7], v_Mod[playerid][x][8], v_Mod[playerid][x][9],
10840 v_Mod[playerid][x][10], v_Mod[playerid][x][11], v_Mod[playerid][x][12], v_Mod[playerid][x][13], v_Dmg[playerid][x][0], v_Dmg[playerid][x][1], v_Dmg[playerid][x][2], v_Dmg[playerid][x][3], P_DATA[playerid][v_SQL][x]);
10841 mysql_tquery(SQL, szQuery);
10842
10843 mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `vehs` SET `VIPText` = '%e', `VipTextState` = %d, `VipTextColor` = %d, `InsurancePoints` = %d, `Plate` = '%e', `Paintjob` = %d WHERE `ID` = %d", v_vText[playerid][x], (P_DATA[playerid][v_vTextStatus] == true) ? (1) : (0), v_vTextColor[playerid][x], P_DATA[playerid][v_InsurancePoints], v_Plate[playerid][x], P_DATA[playerid][v_Paint][x], P_DATA[playerid][v_SQL][x]);
10844 mysql_tquery(SQL, szQuery);
10845 return 1;
10846}
10847
10848IsVehicleOccupied(const vID)
10849{
10850 new bool: i = false;
10851 foreach(new p : Player)
10852 {
10853 if(GetPlayerVehicleID(p) == vID)
10854 {
10855 i = true;
10856 break;
10857 }
10858 }
10859 return i;
10860}