- // Credits Mionee
- #include <a_samp>
- #include <YSI\y_ini>
- #include <sscanf2>
- #include <zcmd>
- #define MAX_HOUSES 100
- #define MAX_BUSINESSES 100
- #define MAX_FACTIONS 40
- #define MAX_CARS 100
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_GENDER 3
- #define DIALOG_CARBUY 4
- #define DIALOG_BIKEBUY 5
- #define DIALOG_BUY 6
- #define DIALOG_SHOP 7
- #define DIALOG_LIGHT 8
- #define DIALOG_HEAVY 9
- #define HOLDING(%0) ((newkeys & (%0)) == (%0))
- #define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
- #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- enum PlayerInfo
- {
- Pass,
- Registered,
- Admin,
- Level,
- Skin,
- Exp,
- CurExp,
- Gender,
- Float: Health,
- Float: Armour,
- HandMoney,
- BankMoney,
- Mask,
- MaskID,
- PhoneNumber,
- HouseOwner,
- BizOwner,
- VehicleOwner,
- Faction,
- FactionTier,
- FactionRank[30],
- lvDay,
- lvMonth,
- lvYear,
- lvHour,
- lvMinute,
- lvSecond,
- Weapon1,
- Wep1Ammo,
- Weapon2,
- Wep2Ammo,
- Weapon3,
- Wep3Ammo,
- Weapon4,
- Wep4Ammo,
- Weapon5,
- Wep5Ammo,
- LastPos,
- LastInt,
- LastVW,
- Float: LastX,
- Float: LastY,
- Float: LastZ,
- }
- enum vIDinfo { vID, };
- enum VehicleInfo
- {
- ModelID,
- Owner[30],
- Fuel,
- Float: posX,
- Float: posY,
- Float: posZ,
- Float: posA,
- ColorA,
- ColorB,
- Locked,
- Faction,
- NrPlate[8],
- }
- enum hIDinfo { hID, };
- enum HouseInfo
- {
- Owner[25],
- Price,
- Bought,
- Float: extX,
- Float: extY,
- Float: extZ,
- Float: intX,
- Float: intY,
- Float: intZ,
- intVW,
- intW,
- Locked,
- };
- enum bIDinfo { bID, };
- enum BizInfo
- {
- Name[45],
- Owner[25],
- Price,
- Bought,
- Locked,
- Fee,
- Till,
- IntSet,
- Float: extX,
- Float: extY,
- Float: extZ,
- Float: intX,
- Float: intY,
- Float: intZ,
- intVW,
- intW,
- Text3D: Label
- };
- new hIDInfo[hIDinfo];
- new vIDInfo[vIDinfo];
- new bIDInfo[bIDinfo];
- new hInfo[MAX_HOUSES][HouseInfo];
- new pInfo[MAX_PLAYERS][PlayerInfo];
- new vInfo[MAX_CARS][VehicleInfo];
- new bInfo[MAX_BUSINESSES][BizInfo];
- new Text:SpeedoMeter[MAX_PLAYERS];
- new Text:FuelMeter[MAX_PLAYERS];
- new Text:EngineInfo[MAX_PLAYERS];
- new Text:wMark0; // blueberry
- new Text:wMark1; // roleplay
- new GunName[47][20] =
- {
- "Fist", "Brass Knuckles", "Golf Club", "Nightstick", "Knife", "Basebal Bat", "Shovel", "Pool Cue", "Katana", "Chainsaw", "Double-ended Dildo", "Dildo", "Vibrator",
- "Silver Vibrator", "Flowers", "Cane", "Grenade", "Tear Gas", "Molotv Cocktail", "?", "?", "?", "9mm", "Silenced 9mm", "Desert Eagle", "Shotgun", "Sawnoff-Shotgun",
- "Combat Shotgun", "Micro-SMG", "MP5", "Ak-47", "M4", "Tec9", "Country Rifle", "Sniper Rifle", "RPG", "HS-RPG", "Flame-Thrower", "Minigun", "Satchel Charge", "Detonator",
- "Spray Can", "Fire Extinguisher", "Camera", "Night Goggles", "Thermal Goggles", "Parachute"
- };
- new bool: Logged[MAX_PLAYERS];
- new pAdminDuty[MAX_PLAYERS];
- new pInsideHouse[MAX_PLAYERS];
- new pInsideBiz[MAX_PLAYERS];
- new FactionChat[MAX_FACTIONS];
- new pOldBalance[MAX_PLAYERS];
- new pDeathModeTimer[MAX_PLAYERS];
- new pDeathModeWait[MAX_PLAYERS];
- new pDeathMode[MAX_PLAYERS];
- new pMedikit[MAX_PLAYERS];
- new pMask[MAX_PLAYERS];
- new LEOveh[6];
- new EMSveh[6];
- new SANAveh[5];
- new Float: pDeathPosX[MAX_PLAYERS];
- new Float: pDeathPosY[MAX_PLAYERS];
- new Float: pDeathPosZ[MAX_PLAYERS];
- new vEngine[MAX_CARS] = 0;
- new EngineStartTimer[MAX_PLAYERS];
- new vLights[MAX_CARS];
- new vBonnet[MAX_CARS];
- new vTrunk[MAX_CARS];
- new fishtimer[MAX_PLAYERS];
- new fishtimervalue[MAX_PLAYERS];
- new pCarryingFish[MAX_PLAYERS] = 0; // max = 40
- new pRentedFishRod[MAX_PLAYERS] = 0; // anti bugging
- main() print("\n The mothership has been launched! \n");
- public OnGameModeInit()
- {
- SetGameModeText("Country RolePlay");
- SetWorldTime(16), SetWeather(0);
- DisableInteriorEnterExits();
- ShowPlayerMarkers(PLAYER_MARKERS_MODE_OFF);
- UsePlayerPedAnims();
- ReloadLabels(); //
- LoadVehicles();
- LEOveh[0] = CreateVehicle(598, -1719.3958, 1028.3994, 17.3334, 89.0714, 0, 1, 300);
- LEOveh[1] = CreateVehicle(598, -1719.4200, 1024.3278, 17.3302, 88.7190, 0, 1, 300);
- LEOveh[2] = CreateVehicle(598, -1719.7917, 1012.0662, 17.3287, 89.2342, 0, 1, 300);
- LEOveh[3] = CreateVehicle(598, -1719.4130, 1007.8895, 17.3327, 89.4170, 0, 1, 300);
- LEOveh[4] = CreateVehicle(598, -1736.9916, 1016.0107, 17.3337, 89.4326, 0, 1, 300);
- LEOveh[5] = CreateVehicle(598, -1737.6256, 1024.4232, 17.3343, 269.3191, 0, 1, 300);
- EMSveh[0] = CreateVehicle(416, 300.4477, -1490.9862, 24.7431, 235.5056, 1, 3, 300);
- EMSveh[1] = CreateVehicle(416, 303.5881, -1486.2542, 24.7432, 235.8304, 1, 3, 300);
- EMSveh[2] = CreateVehicle(416, 306.9335, -1481.8215, 24.7427, 235.8304, 1, 3, 300);
- EMSveh[3] = CreateVehicle(416, 295.1798, -1513.8097, 24.7431, 235.8304, 1, 3, 300);
- EMSveh[4] = CreateVehicle(490, 26.8192, -196.1748, 1.7874, 176.1357, 3, 1, 300); // rancher
- EMSveh[5] = CreateVehicle(490, 31.4523, -196.3257, 1.7869, 176.6352, 3, 1, 300); // rancher
- for(new i = 0; i <= GetMaxPlayers(); i++)
- {
- EngineInfo[i] = TextDrawCreate(550.000000, 370.000000, "_");
- TextDrawBackgroundColor(EngineInfo[i], 255);
- TextDrawFont(EngineInfo[i], 2);
- TextDrawLetterSize(EngineInfo[i], 0.40000, 2.299998);
- TextDrawColor(EngineInfo[i], -1);
- TextDrawSetOutline(EngineInfo[i], 0);
- TextDrawSetProportional(EngineInfo[i], 1);
- TextDrawSetShadow(EngineInfo[i], 1);
- SpeedoMeter[i] = TextDrawCreate(550.000000, 390.000000, "_");
- TextDrawBackgroundColor(SpeedoMeter[i], 255);
- TextDrawFont(SpeedoMeter[i], 2);
- TextDrawLetterSize(SpeedoMeter[i], 0.40000, 2.299998);
- TextDrawColor(SpeedoMeter[i], -1);
- TextDrawSetOutline(SpeedoMeter[i], 0);
- TextDrawSetProportional(SpeedoMeter[i], 1);
- TextDrawSetShadow(SpeedoMeter[i], 1);
- FuelMeter[i] = TextDrawCreate(550.000000, 410.000000, "_");
- TextDrawBackgroundColor(FuelMeter[i], 255);
- TextDrawFont(FuelMeter[i], 2);
- TextDrawLetterSize(FuelMeter[i], 0.40000, 2.299998);
- TextDrawColor(FuelMeter[i], -1);
- TextDrawSetOutline(FuelMeter[i], 0);
- TextDrawSetProportional(FuelMeter[i], 1);
- TextDrawSetShadow(FuelMeter[i], 1);
- SetVehicleParamsForPlayer(i, i, 1, 1);
- }
- wMark0 = TextDrawCreate(505.000000, 101.000000, "NewCountry");
- TextDrawBackgroundColor(wMark0, 255);
- TextDrawFont(wMark0, 1);
- TextDrawLetterSize(wMark0, 0.310000, 1.200000);
- TextDrawColor(wMark0, -690563329);
- TextDrawSetOutline(wMark0, 0);
- TextDrawSetProportional(wMark0, 1);
- TextDrawSetShadow(wMark0, 1);
- wMark1 = TextDrawCreate(558.000000, 101.000000, "Roleplay");
- TextDrawBackgroundColor(wMark1, 255);
- TextDrawFont(wMark1, 1);
- TextDrawLetterSize(wMark1, 0.310000, 1.200000);
- TextDrawColor(wMark1, -1260593409);
- TextDrawSetOutline(wMark1, 0);
- TextDrawSetProportional(wMark1, 1);
- TextDrawSetShadow(wMark1, 1);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- InterpolateCameraPos(playerid, 380.2796, -340.6636, 49.3404, -162.2861, 157.5699, 53.6954, 150000);
- InterpolateCameraLookAt(playerid, 381.0202, -341.3334, 49.4304, -162.9535, 158.3127, 53.8754, 100000);
- SetPlayerMapIcon(playerid, 1, 373.4215, -275.4926, 1.0578, 9, 0, MAPICON_LOCAL);
- SetTimer("LevelTimer", 1800000, true);
- TogglePlayerSpectating(playerid, 1); // remove "Spawn" button
- SetPlayerPos(playerid, -162.9535, 158.3127, 53.8754);
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Vnesete go vasiot password.", "Login", "Kick");
- }
- else ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Napisete password za da registrirate nov akaunt.", "Register", "Quit");
- PreloadAnimLib(playerid, "KNIFE");
- PreloadAnimLib(playerid, "MEDIC");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(Logged[playerid] == true)
- {
- new year, month, day, hour, minute, second, Float: X, Float: Y, Float: Z, Float: hp, Float: armor;
- GetPlayerArmour(playerid, armor), GetPlayerHealth(playerid, hp);
- getdate(year, month, day), gettime(hour, minute, second), GetPlayerPos(playerid, X, Y, Z);
- GetPlayerWeaponData(playerid, 2, pInfo[playerid][Weapon1], pInfo[playerid][Wep1Ammo]);
- GetPlayerWeaponData(playerid, 3, pInfo[playerid][Weapon2], pInfo[playerid][Wep2Ammo]);
- GetPlayerWeaponData(playerid, 4, pInfo[playerid][Weapon3], pInfo[playerid][Wep3Ammo]);
- GetPlayerWeaponData(playerid, 5, pInfo[playerid][Weapon4], pInfo[playerid][Wep4Ammo]);
- GetPlayerWeaponData(playerid, 6, pInfo[playerid][Weapon5], pInfo[playerid][Wep5Ammo]);
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "Player Data");
- // account related
- INI_WriteInt(File, "Admin", pInfo[playerid][Admin]);
- INI_WriteInt(File, "Level", pInfo[playerid][Level]);
- INI_WriteInt(File, "Skin", GetPlayerSkin(playerid));
- INI_WriteInt(File, "Exp", pInfo[playerid][Exp]);
- INI_WriteInt(File, "CurExp", pInfo[playerid][CurExp]);
- INI_WriteInt(File, "Gender", pInfo[playerid][Gender]);
- INI_WriteInt(File, "Registered", pInfo[playerid][Registered]);
- INI_WriteInt(File, "HandMoney", GetPlayerMoney(playerid));
- INI_WriteInt(File, "BankMoney", pInfo[playerid][BankMoney]);
- INI_WriteFloat(File, "Armour", armor);
- INI_WriteFloat(File, "Health", hp);
- // faction
- INI_WriteInt(File, "Faction", pInfo[playerid][Faction]);
- INI_WriteInt(File, "FactionTier", pInfo[playerid][FactionTier]);
- INI_WriteString(File, "FactionRank", pInfo[playerid][FactionRank]);
- INI_WriteInt(File, "Weapon1", pInfo[playerid][Weapon1]);
- INI_WriteInt(File, "Wep1Ammo", pInfo[playerid][Wep1Ammo]);
- INI_WriteInt(File, "Weapon2", pInfo[playerid][Weapon2]);
- INI_WriteInt(File, "Wep2Ammo", pInfo[playerid][Wep2Ammo]);
- INI_WriteInt(File, "Weapon3", pInfo[playerid][Weapon3]);
- INI_WriteInt(File, "Wep3Ammo", pInfo[playerid][Wep3Ammo]);
- INI_WriteInt(File, "Weapon4", pInfo[playerid][Weapon4]);
- INI_WriteInt(File, "Wep4Ammo", pInfo[playerid][Wep4Ammo]);
- INI_WriteInt(File, "Weapon5", pInfo[playerid][Weapon5]);
- INI_WriteInt(File, "Wep5Ammo", pInfo[playerid][Wep5Ammo]);
- // server-side
- INI_WriteInt(File, "LastPos", 1);
- INI_WriteInt(File, "LastInt", GetPlayerInterior(playerid));
- INI_WriteInt(File, "LastVW", GetPlayerVirtualWorld(playerid));
- INI_WriteFloat(File, "LastX", X);
- INI_WriteFloat(File, "LastY", Y);
- INI_WriteFloat(File, "LastZ", Z);
- INI_WriteInt(File, "Mask", pInfo[playerid][Mask]);
- INI_WriteInt(File, "MaskID", pInfo[playerid][MaskID]);
- INI_WriteInt(File, "PhoneNumber", pInfo[playerid][PhoneNumber]);
- INI_WriteInt(File, "HouseOwner", pInfo[playerid][HouseOwner]);
- INI_WriteInt(File, "BizOwner", pInfo[playerid][BizOwner]);
- INI_WriteInt(File, "VehicleOwner", pInfo[playerid][VehicleOwner]);
- // informational
- INI_WriteInt(File, "lvDay", day);
- INI_WriteInt(File, "lvMonth", month);
- INI_WriteInt(File, "lvYear", year);
- INI_WriteInt(File, "lvHour", hour);
- INI_WriteInt(File, "lvMinute", minute);
- INI_WriteInt(File, "lvSecond", second);
- INI_Close(File);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TogglePlayerSpectating(playerid, 0);
- SetPlayerColor(playerid, 1);
- SetCameraBehindPlayer(playerid);
- if(pInfo[playerid][LastPos] == 0) SetPlayerPos(playerid, 250.7732, -193.0894, 2.0562);
- else if(pInfo[playerid][LastPos] == 1)
- {
- SetPlayerPos(playerid, pInfo[playerid][LastX], pInfo[playerid][LastY], pInfo[playerid][LastZ]);
- SetPlayerInterior(playerid, pInfo[playerid][LastInt]);
- SetPlayerVirtualWorld(playerid, pInfo[playerid][LastVW]);
- }
- if(pDeathMode[playerid] == 2)
- {
- SetPlayerColor(playerid, -1);
- pDeathMode[playerid] = 0;
- SetPlayerPos(playerid, 43.6618, -188.0078, 2.2442);
- SetPlayerHealth(playerid, 70);
- }
- else if(pDeathMode[playerid] == 1)
- {
- SetPlayerPos(playerid, pDeathPosX[playerid], pDeathPosY[playerid], pDeathPosZ[playerid]);
- SetPlayerHealth(playerid, 100);
- TogglePlayerControllable(playerid, false);
- SendClientMessage(playerid, -1, "You've lost consciousness!");
- SetTimerEx("PlayerDeathMode", 1500, false, "i", playerid);
- }
- ResetPlayerMoney(playerid); // doing this avoids HandMoney to duplicate (aka get 2x the amount u had earlier)
- GivePlayerMoney(playerid, pInfo[playerid][HandMoney]);
- SetPlayerSkin(playerid, pInfo[playerid][Skin]);
- GivePlayerWeapon(playerid, 38, 99999);
- GivePlayerWeapon(playerid, 26, 99999);
- GivePlayerWeapon(playerid, 24, 99999);
- GivePlayerWeapon(playerid, 3, 99999);
- // ---- System rewrites (bug fixed) ---- //
- if(pInfo[playerid][Registered] == 0) RegisterFix(playerid);
- SetPlayerHealth(playerid, pInfo[playerid][Health]);
- SetPlayerArmour(playerid, pInfo[playerid][Armour]);
- TextDrawShowForPlayer(playerid, wMark0);
- TextDrawShowForPlayer(playerid, wMark1);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new string[128], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof (name));
- if(pMask[playerid] == 0) format(string, sizeof (string), "%s zboruva: %s", name, text);
- else if(pMask[playerid] == 1) format(string, sizeof (string), "Tuginec %d zboruva: %s", pInfo[playerid][MaskID], text);
- SendNearbyMessage(playerid, 0xDBDBDBFF, string, 5.0);
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[128], pname[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, pname, sizeof(pname));
- switch(dialogid)
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Napisete password za da se registrirate.", "Register", "Quit");
- new INI:File = INI_Open(UserPath(playerid));
- new rand1 = random(99999), rand2 = random(99999);
- INI_SetTag(File, "Player Data");
- INI_WriteInt(File, "Password", udb_hash(inputtext));
- INI_WriteInt(File, "Admin", 0);
- INI_WriteInt(File, "Level", 1);
- INI_WriteInt(File, "Skin", 0);
- INI_WriteInt(File, "Exp", 0);
- INI_WriteInt(File, "Gender", 0);
- INI_WriteInt(File, "Registered", 0);
- INI_WriteFloat(File, "Armour", 0);
- INI_WriteFloat(File, "Health", 100);
- INI_WriteInt(File, "Faction", 0);
- INI_WriteInt(File, "FactionTier", 0);
- INI_WriteString(File, "FactionRank", "None");
- INI_WriteInt(File, "HandMoney", 0);
- INI_WriteInt(File, "BankMoney", 0);
- INI_WriteInt(File, "Mask", 0);
- INI_WriteInt(File, "MaskID", rand1);
- INI_WriteInt(File, "PhoneNumber", rand2);
- INI_WriteInt(File, "HouseOwner", 9999);
- INI_WriteInt(File, "VehicleOwner", 9999);
- INI_WriteInt(File, "BizOwner", 9999);
- INI_WriteInt(File, "Weapon1", 0);
- INI_WriteInt(File, "Wep1Ammo", 0);
- INI_WriteInt(File, "Weapon2", 0);
- INI_WriteInt(File, "Wep2Ammo", 0);
- INI_WriteInt(File, "Weapon3", 0);
- INI_WriteInt(File, "Wep3Ammo", 0);
- INI_WriteInt(File, "Weapon4", 0);
- INI_WriteInt(File, "Wep4Ammo", 0);
- INI_WriteInt(File, "Weapon5", 0);
- INI_WriteInt(File, "Wep5Ammo", 0);
- INI_WriteInt(File, "lvDay", 0);
- INI_WriteInt(File, "lvMonth", 0);
- INI_WriteInt(File, "lvYear", 0);
- INI_WriteInt(File, "lvHour", 0);
- INI_WriteInt(File, "lvMinute", 0);
- INI_WriteInt(File, "lvSecond", 0);
- INI_WriteInt(File, "LastPos", 0);
- INI_WriteInt(File, "LastVW", 0);
- INI_WriteInt(File, "LastInt", 0);
- INI_WriteFloat(File, "LastX", 0);
- INI_WriteFloat(File, "LastY", 0);
- INI_WriteFloat(File, "LastZ", 0);
- INI_Close(File);
- format(string, sizeof(string), "SERVER:{FFFFFF} Dobredojdovte na serverot.., %s!", pname);
- SendClientMessage(playerid, 0x46E850FF, string);
- SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- }
- }
- case DIALOG_LOGIN:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(udb_hash(inputtext) == pInfo[playerid][Pass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- format(string, sizeof(string), "SERVER:{FFFFFF} Dobredojdovte nazad, %s! Posleden pat se najavivte %d/%d/%d %d:%d:%d.", pname, pInfo[playerid][lvDay], pInfo[playerid][lvMonth], pInfo[playerid][lvYear], pInfo[playerid][lvHour], pInfo[playerid][lvMinute], pInfo[playerid][lvSecond]);
- SendClientMessage(playerid, 0x46E850FF, string);
- Logged[playerid] = true;
- SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- }
- else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "{FFFFFF}You have entered an {C44B4B}incorrect{FFFFFF} password.\nType your password below to login.", "Login", "Quit");
- return 1;
- }
- }
- case DIALOG_GENDER:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- pInfo[playerid][Gender] = 1;
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have defined your gender to be male.");
- SetPlayerSkin(playerid, 291);
- }
- case 1:
- {
- pInfo[playerid][Gender] = 2;
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have defined your gender to be female.");
- SetPlayerSkin(playerid, 233);
- }
- }
- }
- }
- case DIALOG_CARBUY:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: // sabre
- {
- if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -30000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Sabre! Make sure to register it!");
- CreatePlayerVehicle(playerid, 542);
- }
- case 1: // Clover
- {
- if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -30000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Clover! Make sure to register it!");
- CreatePlayerVehicle(playerid, 575);
- }
- case 2: // Broadway
- {
- if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -30000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Broadway! Make sure to register it!");
- CreatePlayerVehicle(playerid, 518);
- }
- case 3: // Buccaneer
- {
- if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -30000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Buccaneer! Make sure to register it!");
- CreatePlayerVehicle(playerid, 475);
- }
- case 4: // Slamvan
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Buccaneer! Make sure to register it!");
- CreatePlayerVehicle(playerid, 475);
- }
- case 5: // Blade
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Blader! Make sure to register it!");
- CreatePlayerVehicle(playerid, 436);
- }
- case 6: // Vincent
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Vincent! Make sure to register it!");
- CreatePlayerVehicle(playerid, 540);
- }
- case 7: // Elegant
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Elegant! Make sure to register it!");
- CreatePlayerVehicle(playerid, 507);
- }
- case 8: // Intruder
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Intruder! Make sure to register it!");
- CreatePlayerVehicle(playerid, 546);
- }
- case 9: // Primo
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Primo! Make sure to register it!");
- CreatePlayerVehicle(playerid, 547);
- }
- case 10: // Merit
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Merit! Make sure to register it!");
- CreatePlayerVehicle(playerid, 551);
- }
- case 11: // Emperor
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Emperor! Make sure to register it!");
- CreatePlayerVehicle(playerid, 585);
- }
- case 12: // Sentinel
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Kupivte Sentinel!");
- CreatePlayerVehicle(playerid, 405);
- }
- case 13: // Voodoo
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Voodoo!");
- CreatePlayerVehicle(playerid, 412);
- }
- case 14: // Blistac
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Blistac!");
- CreatePlayerVehicle(playerid, 496);
- }
- case 15: // Solair
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Solair!");
- CreatePlayerVehicle(playerid, 458);
- }
- case 16: // Perenail
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Perenail!");
- CreatePlayerVehicle(playerid, 404);
- }
- case 17: // Club
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Club!");
- CreatePlayerVehicle(playerid, 589);
- }
- case 18: // Washington
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Washington!");
- CreatePlayerVehicle(playerid, 421);
- }
- case 19: // Premier
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Premier!");
- CreatePlayerVehicle(playerid, 426);
- }
- case 20: // Stafford
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Stafford!");
- CreatePlayerVehicle(playerid, 580);
- }
- case 21: // Feltzer
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Feltzer!");
- CreatePlayerVehicle(playerid, 533);
- }
- case 22: // Savanna
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Savanna!");
- CreatePlayerVehicle(playerid, 567);
- }
- case 23: // Tornado
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Tornado!");
- CreatePlayerVehicle(playerid, 576);
- }
- case 24: // Tahoma
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Tahoma!");
- CreatePlayerVehicle(playerid, 566);
- }
- case 25: // Majestic
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} YKupivte Majestic!");
- CreatePlayerVehicle(playerid, 517);
- }
- case 26: // Picador
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Picador !");
- CreatePlayerVehicle(playerid, 600);
- }
- case 27: // Rancher
- {
- if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -50000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Rancher!");
- CreatePlayerVehicle(playerid, 489);
- }
- case 28: // Regina
- {
- if(GetPlayerMoney(playerid) < 60000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -60000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Regina!");
- CreatePlayerVehicle(playerid, 479);
- }
- case 29: // Landstalker
- {
- if(GetPlayerMoney(playerid) < 60000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -60000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte LandStalker!");
- CreatePlayerVehicle(playerid, 400);
- }
- case 30: // Huntley
- {
- if(GetPlayerMoney(playerid) < 60000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -60000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Huntley!");
- CreatePlayerVehicle(playerid, 579);
- }
- case 31: // Buffalo
- {
- if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -75000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Buffalo!");
- CreatePlayerVehicle(playerid, 402);
- }
- case 32: // Elegy
- {
- if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -75000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Elegy!");
- CreatePlayerVehicle(playerid, 562);
- }
- case 33: // Flash
- {
- if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -75000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Flash!");
- CreatePlayerVehicle(playerid, 565);
- }
- case 34: // Sultan
- {
- if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -75000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Sultan!");
- CreatePlayerVehicle(playerid, 560);
- }
- case 35: // Jester
- {
- if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -75000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Jester !!");
- CreatePlayerVehicle(playerid, 559);
- }
- }
- }
- }
- case DIALOG_BIKEBUY:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: // faggio
- {
- if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -15000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Kupivte Faggio!");
- CreatePlayerVehicle(playerid, 462);
- }
- case 1: // pcj-600
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte PSJ 600!");
- CreatePlayerVehicle(playerid, 461);
- }
- case 2: // bf-400
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte BF 400!");
- CreatePlayerVehicle(playerid, 581);
- }
- case 3: // fcr-900
- {
- if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -45000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte FCR 900!");
- CreatePlayerVehicle(playerid, 521);
- }
- case 4: // sanchez
- {
- if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -30000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Sanchez!");
- CreatePlayerVehicle(playerid, 486);
- }
- case 5: // freeway
- {
- if(GetPlayerMoney(playerid) < 25000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
- GivePlayerMoney(playerid, -75000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Freeway!");
- CreatePlayerVehicle(playerid, 463);
- }
- case 6: // wayfarer
- {
- if(GetPlayerMoney(playerid) < 25000) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF}Nemate dovolno pari!");
- GivePlayerMoney(playerid, -75000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Wayfarer!");
- CreatePlayerVehicle(playerid, 586);
- }
- }
- }
- }
- case DIALOG_BUY:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: // Mask: 1250
- {
- if(GetPlayerMoney(playerid) < 1250) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Nemate dovolno pari za da go kupite ovaj produkt!");
- GivePlayerMoney(playerid, -1250);
- pInfo[playerid][Mask] = 1; // add one integer
- SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} Kupivte maska!");
- }
- case 1: // Medikit: 750
- {
- if(GetPlayerMoney(playerid) < 750) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Nemate dovolno pari za da go kupite ovaj produkt!");
- GivePlayerMoney(playerid, -750);
- pMedikit[playerid] += 1; // add one integer
- SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} Kupivte brza pomos!");
- }
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- switch(newstate)
- {
- case PLAYER_STATE_DRIVER:
- {
- if(vehicleid == LEOveh[0] || LEOveh[1] || LEOveh[2] || LEOveh[3] || LEOveh[4] || LEOveh[5])
- {
- if(pInfo[playerid][Faction] != 1)
- {
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be a police officer in order to operate this vehicle!");
- RemovePlayerFromVehicle(playerid);
- }
- }
- else if(vehicleid == EMSveh[0] || EMSveh[1] || EMSveh[2] || EMSveh[3] || EMSveh[4] || EMSveh[5])
- {
- if(pInfo[playerid][Faction] != 2)
- {
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be a medic in order to operate this vehicle!");
- RemovePlayerFromVehicle(playerid);
- }
- }
- TextDrawShowForPlayer(playerid, EngineInfo[playerid]);
- TextDrawShowForPlayer(playerid, SpeedoMeter[playerid]);
- TextDrawShowForPlayer(playerid, FuelMeter[playerid]);
- }
- case PLAYER_STATE_ONFOOT:
- {
- TextDrawHideForPlayer(playerid, EngineInfo[playerid]);
- TextDrawHideForPlayer(playerid, SpeedoMeter[playerid]);
- TextDrawHideForPlayer(playerid, FuelMeter[playerid]);
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(HOLDING(KEY_YES))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(vEngine[vehicleid] == 0)
- {
- vEngine[vehicleid] = 2;
- EngineStartTimer[playerid] = SetTimer("StartEngine", 2500, false);
- }
- }
- }
- if(RELEASED(KEY_YES))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(vEngine[vehicleid] == 0)
- {
- KillTimer(EngineStartTimer[playerid]);
- vEngine[vehicleid] = 0;
- }
- }
- }
- if(PRESSED(KEY_YES))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(vEngine[vehicleid] == 1)
- {
- StartEngine(playerid, vehicleid);
- }
- }
- }
- if(newkeys & KEY_SECONDARY_ATTACK)
- {
- cmd_enterhouse(playerid);
- cmd_enterbusiness(playerid);
- cmd_pass(playerid);
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new string[16];
- format(string, sizeof(string), "~w~KM/H: ~p~%0.0f", GetVehicleSpeed(GetPlayerVehicleID(playerid)));
- TextDrawSetString(SpeedoMeter[playerid], string);
- format(string, sizeof(string), "~w~FUEL: ~p~100");
- TextDrawSetString(FuelMeter[playerid], string);
- format(string, sizeof(string), "~w~ENGI: %s", GetVehicleEngine(GetPlayerVehicleID(playerid)));
- TextDrawSetString(EngineInfo[playerid], string);
- }
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- if(vInfo[vehicleid][Locked] == 1)
- {
- SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
- }
- else if(vInfo[vehicleid][Locked] == 0)
- {
- SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 0);
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- if(vEngine[vehicleid] == 0)
- {
- SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Hold ~k~~CONVERSATION_YES~ to start vehicle engine!");
- }
- else if(vEngine[vehicleid] == 1) SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- new string[128];
- if(!success)
- {
- format(string, sizeof(string), "GRESKA:{FFFFFF} Komandata {46E850}%s{FFFFFF} nepostoi! Pisete {46E850}/help{FFFFFF} da gi vidte site komandi.", cmdtext);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new pname[MAX_PLAYER_NAME], kname[MAX_PLAYER_NAME], string[128], Float: X, Float: Y, Float: Z;
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(killerid, kname, sizeof(kname));
- GetPlayerPos(playerid, X, Y, Z);
- pDeathPosX[playerid] = X;
- pDeathPosY[playerid] = Y;
- pDeathPosZ[playerid] = Z;
- pInfo[playerid][Mask] = 0;
- pDeathMode[playerid] = 1;
- if(killerid != INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "(%d) %s has just killed (%d) %s using a %s (%d)", killerid, kname, playerid, pname, GunName[reason], reason);
- SendClientMessageToAll(-1, string);
- }
- return 1;
- }
- // =-=-=-=-=-=-=-=-= PLAYER COMMANDS =-=-=-=-=-=-=-=-= //
- // General
- CMD:mask(playerid, params[])
- {
- if(pInfo[playerid][Mask] == 0) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF}Nemate maska!");
- if(pMask[playerid] == 0)
- {
- pMask[playerid] = 1;
- SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} Stavivte maska!");
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(playerid)) continue;
- ShowPlayerNameTagForPlayer(i, playerid, false);
- }
- }
- else if(pMask[playerid] == 1)
- {
- pMask[playerid] = 0;
- SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF}Ja trgnavte maskata!");
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(playerid)) continue;
- ShowPlayerNameTagForPlayer(i, playerid, true);
- }
- }
- return 1;
- }
- CMD:buy(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 252.0834,-56.3722,1.5703))
- {
- ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, "24/7", "Maska {$1250}\nLek {$750}\n", "Kupi", "Cancel");
- }
- else SendClientMessage(playerid, 0x46E850FF, "Ne ste na mestoto kade sto se kupuva.!");
- return 1;
- }
- CMD:help(playerid, params[])
- {
- SendClientMessage(playerid, 0x46E850FF, "Komandi koi mozete da gi koristite");
- SendClientMessage(playerid, 0x46E850FF, "[GENERAL]:{FFFFFF} /id, /admins, /help, /report, /stats, /withdraw, /deposit, nocp");
- SendClientMessage(playerid, 0x46E850FF, "[GENERAL]:{FFFFFF} /fish, /rentrod, /returnrod, /checkfish, /sellfish, /pay, /revive");
- SendClientMessage(playerid, 0x46E850FF, "[GENERAL]:{FFFFFF} /transfer, /me, /mes, /do, /low, /b, /o, /s, /p(riv)m(sg), /mask");
- SendClientMessage(playerid, 0x46E850FF, "[VEHICLE]:{FFFFFF} /carbuy, /bikebuy, /carregister, /carlock, /cartow, /cargive");
- SendClientMessage(playerid, 0x46E850FF, "[VEHICLE]:{FFFFFF} /carpark, /carhood, /carlights, /cartrunk, /carlocate");
- SendClientMessage(playerid, 0x46E850FF, "[PROPRTY]:{FFFFFF} /housebuy, /housesell, /housenear, /houselock, /houselocate");
- SendClientMessage(playerid, 0x46E850FF, "[PROPRTY]:{FFFFFF} /bizbuy, /bizsell, /bizlock, /biznear, /bizfee, /bizname");
- SendClientMessage(playerid, 0x46E850FF, "[PROPRTY]:{FFFFFF} /bizlocate, /biztillinfo, /biztwithdraw, /biztdeposit, /buy");
- SendClientMessage(playerid, 0x46E850FF, "[FACTION]:{FFFFFF} /f, /fnochat, /ftowcars, /fset(rank/tier), /f(un/in)vite");
- return 1;
- }
- CMD:enterhouse(playerid)
- {
- // PARAMS ARE REMOVED FOR A REASON, SEE ONPLAYERSTATEKEYCHANGE
- new pNearHouse[MAX_PLAYERS], s[128], vw = GetPlayerVirtualWorld(playerid), w = GetPlayerInterior(playerid);
- // Houses
- if(pInsideHouse[playerid] == 0)
- {
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
- {
- pNearHouse[playerid] = i;
- }
- }
- if(pNearHouse[playerid] == 0) return 1;
- new nearhouse = pNearHouse[playerid];
- if(hInfo[nearhouse][Locked] == 0)
- {
- SetPlayerPos(playerid, hInfo[nearhouse][intX], hInfo[nearhouse][intY], hInfo[nearhouse][intZ]);
- SetPlayerVirtualWorld(playerid, hInfo[nearhouse][intVW]);
- SetPlayerInterior(playerid, hInfo[nearhouse][intW]);
- pInsideHouse[playerid] = 1;
- }
- else if(hInfo[nearhouse][Locked] == 1) SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Kukjata e zaklucena i nemozete da vlezete!");
- if(pInfo[playerid][Admin] > 1)
- {
- format(s, 128, "INFO:{FFFFFF} Vlegovte vo kukja so ID: %d, VW: %d, W: %d", nearhouse, hInfo[nearhouse][intVW], hInfo[nearhouse][intW]);
- SendClientMessage(playerid, 0x46E850FF, s);
- }
- return 1;
- }
- else if(pInsideHouse[playerid] == 1)
- {
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][intX], hInfo[i][intY], hInfo[i][intZ]))
- {
- if(vw == hInfo[i][intVW] && w == hInfo[i][intW])
- {
- pNearHouse[playerid] = i;
- }
- }
- }
- if(pNearHouse[playerid] == 0) return 1;
- new nearhouse = pNearHouse[playerid];
- pInsideHouse[playerid] = 0;
- SetPlayerPos(playerid, hInfo[nearhouse][extX], hInfo[nearhouse][extY], hInfo[nearhouse][extZ]);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- return 1;
- }
- CMD:enterbusiness(playerid)
- {
- // PARAMS ARE REMOVED FOR A REASON, SEE ONPLAYERSTATEKEYCHANGE
- new pNearBiz[MAX_PLAYERS], s[128], vw = GetPlayerVirtualWorld(playerid), w = GetPlayerInterior(playerid);
- // Businesses
- if(pInsideBiz[playerid] == 0)
- {
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
- {
- pNearBiz[playerid] = i;
- }
- }
- if(pNearBiz[playerid] == 0) return 1;
- new nearbiz = pNearBiz[playerid], money = bInfo[nearbiz][Fee];
- if(bInfo[nearbiz][Locked] == 0)
- {
- pInsideBiz[playerid] = 1;
- if(bInfo[nearbiz][IntSet] == 0) SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF}Seuste nemate interrior namesteno , kontaktirajte admin!");
- GivePlayerMoney(playerid, -bInfo[nearbiz][Fee]);
- bInfo[nearbiz][Till] += money;
- SaveBizzes();
- SetPlayerPos(playerid, bInfo[nearbiz][intX], bInfo[nearbiz][intY], bInfo[nearbiz][intZ]);
- SetPlayerVirtualWorld(playerid, bInfo[nearbiz][intVW]);
- SetPlayerInterior(playerid, bInfo[nearbiz][intW]);
- if(pInfo[playerid][Admin] > 1)
- {
- format(s, 128, "INFO:{FFFFFF} Vlegovte vo biznis so ID: %d, VW: %d, W: %d", nearbiz, bInfo[nearbiz][intVW], bInfo[nearbiz][intW]);
- SendClientMessage(playerid, 0x46E850FF, s);
- }
- }
- else if(bInfo[nearbiz][Locked] == 1) SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Biznisot e zaklucen!");
- }
- else if(pInsideBiz[playerid] == 1)
- {
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][intX], bInfo[i][intY], bInfo[i][intZ]))
- {
- if(vw == bInfo[i][intVW] && w == bInfo[i][intW])
- {
- pNearBiz[playerid] = i;
- }
- }
- }
- if(pNearBiz[playerid] == 0) return 1;
- new nearbiz = pNearBiz[playerid];
- pInsideBiz[playerid] = 0;
- SetPlayerPos(playerid, bInfo[nearbiz][extX], bInfo[nearbiz][extY], bInfo[nearbiz][extZ]);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- return 1;
- }
- CMD:admins(playerid, params[])
- {
- SendClientMessage(playerid, 0x46E850FF, "Online Administrators");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(pInfo[i][Admin] > 0)
- {
- new string[128], sendername[MAX_PLAYER_NAME];
- GetPlayerName(i, sendername, sizeof(sendername));
- if(pAdminDuty[i] == 1)
- {
- format(string, sizeof(string), "{389C35}ON DUTY{A3A3A3}: [%d] %s (%d)", pInfo[i][Admin], sendername, i);
- SendClientMessage(playerid, 0xABABABFF, string);
- }
- else if(pAdminDuty[i] == 0)
- {
- format(string, sizeof(string), "OFF DUTY: [%d] %s (%d)", pInfo[i][Admin], sendername, i);
- SendClientMessage(playerid, 0xABABABFF, string);
- }
- }
- }
- }
- return 1;
- }
- CMD:id(playerid, params[])
- {
- new id, targetname[MAX_PLAYER_NAME+1], string[128];
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} /id [id/ime]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(id == i) GetPlayerName(i, targetname, sizeof(targetname));
- }
- format(string, sizeof(string), "INFO:{FFFFFF} ID %d e %s", id, targetname);
- SendClientMessage(playerid, 0x46E850FF, string);
- return 1;
- }
- CMD:report(playerid, params[])
- {
- new reason[128], string[128], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "s[128]", reason)) return SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} /report [text]");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "[REPORT] %s (%d) reported: %s", pname, playerid, reason);
- SendAdminMessage(0xFFFF00FF, string);
- return 1;
- }
- CMD:pay(playerid, params[])
- {
- new string[128], targetid, input, Float: pos[3], name[MAX_PLAYER_NAME+1], tname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /pay [player] [pari]");
- if(GetPlayerMoney(playerid) < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money!");
- GetPlayerPos(targetid, pos[0], pos[1], pos[2]), GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(targetid, tname, sizeof(tname));
- if(IsPlayerInRangeOfPoint(playerid, 3.0, pos[0], pos[1], pos[2]))
- {
- GivePlayerMoney(targetid, input);
- GivePlayerMoney(playerid, -input);
- format(string, 128, "(%d) %s has just given you %d.", playerid, name, input);
- SendClientMessage(targetid, -1, string);
- format(string, 128, "You have just given (%d) %s %d.", targetid, tname, input);
- SendClientMessage(playerid, -1, string);
- format(string, 128, "%s takes out some money and gives it to %s.", name, tname);
- SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
- }
- return 1;
- }
- CMD:deposit(playerid, params[])
- {
- new string[128], input;
- if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /deposit [amount]");
- if(GetPlayerMoney(playerid) < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money!");
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 2316.5581, -11.3381, 26.7422))
- {
- pOldBalance[playerid] = pInfo[playerid][BankMoney]; // save old var
- pInfo[playerid][BankMoney] += input, GivePlayerMoney(playerid, -input);
- format(string, sizeof(string), "SERVER:{FFFFFF} You have deposited $%d into your bank account.", input);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} Old balance: $%d | New balance: $%d", pOldBalance[playerid], pInfo[playerid][BankMoney]);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the bank!");
- return 1;
- }
- CMD:withdraw(playerid, params[])
- {
- new string[128], input;
- if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /withdraw [amount]");
- if(pInfo[playerid][BankMoney] < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Your bank account doesn't hold that much money!");
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 2316.5581, -11.3381, 26.7422))
- {
- pOldBalance[playerid] = pInfo[playerid][BankMoney]; // save old var
- pInfo[playerid][BankMoney] -= input, GivePlayerMoney(playerid, input);
- format(string, sizeof(string), "SERVER:{FFFFFF} You have withdrawn $%d from your bank account.", input);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} Old balance: $%d | New balance: $%d", pOldBalance[playerid], pInfo[playerid][BankMoney]);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the bank!");
- return 1;
- }
- CMD:transfer(playerid, params[])
- {
- new string[128], targetid, input;
- if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /transfer [player] [amount]");
- if(pInfo[playerid][BankMoney] < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Your bank account doesn't hold that much money!");
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 2316.5581, -11.3381, 26.7422))
- {
- pOldBalance[playerid] = pInfo[playerid][BankMoney]; // save old var
- pInfo[playerid][BankMoney] -= input, pInfo[targetid][BankMoney] += input;
- format(string, sizeof(string), "SERVER:{FFFFFF} You have withdrawn $%d from your bank account.", input);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} Old balance: $%d | New balance: $%d", pOldBalance[playerid], pInfo[playerid][BankMoney]);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} $%d has been deposited into your account.", input);
- SendClientMessage(targetid, 0x46E850FF, string);
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the bank!");
- return 1;
- }
- CMD:revive(playerid, params[])
- {
- new targetid, targetname[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME], string[128], Float: X, Float: Y, Float: Z;
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/revive [target]");
- if(pMedikit[playerid] == 0) return SendClientMessage(playerid, -1, "You need a medikit in order to revive someone!");
- GetPlayerName(playerid, playername, sizeof(playername)), GetPlayerName(targetid, targetname, sizeof(targetname));
- GetPlayerPos(targetid, X, Y, Z);
- if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
- {
- if(pDeathMode[targetid] == 1)
- {
- KillTimer(pDeathModeTimer[targetid]);
- TogglePlayerControllable(targetid, true);
- SetPlayerColor(targetid, -1);
- pDeathMode[targetid] = 0;
- ApplyAnimation(playerid, "MEDIC", "CPR", 4.1, 0, 0, 0, 1, 0, 1);
- ApplyAnimation(targetid, "ped", "CAR_crawloutRHS", 4.1, 0, 0, 0, 1, 0, 1);
- format(string, sizeof(string), "%s has just revived you!", playername);
- SendClientMessage(targetid, -1, string);
- format(string, sizeof(string), "You have just revived %s!", targetname);
- SendClientMessage(playerid, -1, string);
- }
- else SendClientMessage(playerid, -1, "You can't revive that player because they're not in death mode!");
- }
- else SendClientMessage(playerid, -1, "You're not near the player you want to revive!");
- return 1;
- }
- CMD:stats(playerid, params[])
- {
- new string[128], maskholder[5], genderholder[8], weaponholder[32], pname[MAX_PLAYER_NAME +1], Float: health, Float: kev;
- GetWeaponName(playerid, weaponholder, sizeof(weaponholder)), GetPlayerName(playerid, pname, sizeof(pname));
- GetPlayerHealth(playerid, health), GetPlayerArmour(playerid, kev);
- if(GetPlayerWeapon(playerid) == 0) weaponholder = "Fists"; // fix
- else if(GetPlayerWeapon(playerid) > 0) weaponholder = GunName[GetPlayerWeapon(playerid)];
- if(pInfo[playerid][Mask] == 0) maskholder = "No";
- else if(pInfo[playerid][Mask] == 1) maskholder = "Yes";
- if(pInfo[playerid][Gender] == 1) genderholder = "Male";
- else if(pInfo[playerid][Gender] == 2) genderholder = "Female";
- format(string, sizeof(string), "|_______________________| Ingame statistics of %s |_______________________|", pname);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "[Gender: %s] [Level: %d] [Experience: %d/8] [Money: %d] [Bank: %d] [Phone Number: %d]", genderholder, pInfo[playerid][Level], pInfo[playerid][Exp], GetPlayerMoney(playerid), pInfo[playerid][BankMoney], pInfo[playerid][PhoneNumber]);
- SendClientMessage(playerid, 0xCCCCCCFF, string);
- format(string, sizeof(string), "[Mask: %s] [Mask ID: %d] [Primary Weapon: %s] [Ammo: %d] [Health: %d] [Armour: %d]", maskholder, pInfo[playerid][MaskID], weaponholder, GetPlayerAmmo(playerid), floatround(health), floatround(kev));
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), "[Faction: %s] [Faction Tier: %d] [Faction Rank: %s] [Medikits: %d]", GetFactionName(playerid), pInfo[playerid][FactionTier], pInfo[playerid][FactionRank], pMedikit[playerid]);
- SendClientMessage(playerid, 0xCCCCCCFF, string);
- format(string, sizeof(string), "[House Owner: %d] [Vehicle Owner: %d] [Business Owner: %d]", pInfo[playerid][HouseOwner], pInfo[playerid][VehicleOwner], pInfo[playerid][BizOwner]);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- return 1;
- }
- CMD:pass(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, -1716.2312, 1018.1048, 17.5859))
- {
- SetPlayerPos(playerid, 322.1928, 317.6448, 999.1484);
- SetPlayerInterior(playerid, 5);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 207.8708, -61.6880, 1.9766))
- {
- SetPlayerPos(playerid, 322.197998, 302.497985, 999.148437);
- SetPlayerInterior(playerid, 5);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 322.197998, 302.497985, 999.148437))
- {
- SetPlayerPos(playerid, 207.8708, -61.6880, 1.9766);
- SetPlayerInterior(playerid, 0);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 322.3381, 317.8130, 999.1484))
- {
- SetPlayerPos(playerid, -1716.2312, 1018.1048, 17.5859);
- SetPlayerInterior(playerid, 0);
- }
- // hospital
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 43.6618, -188.0078, 2.2442)) // hospital entrance
- {
- SetPlayerPos(playerid,-204.5060, -1736.0486, 675.7687);
- SetPlayerInterior(playerid, 3);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, -204.5060, -1736.0486, 675.7687)) // hospital entrance
- {
- SetPlayerPos(playerid, 43.6618, -188.0078, 2.2442);
- SetPlayerInterior(playerid, 0);
- }
- // Garage pass
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 326.4513, -1492.8029, 24.9219)) // hospital entrance
- {
- SetPlayerPos(playerid, 54.2550, -190.9127, 1.6579);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 54.2550, -190.9127, 1.6579)) // hospital entrance
- {
- SetPlayerPos(playerid, 326.4513, -1492.8029, 24.9219);
- SetPlayerInterior(playerid, 0);
- }
- // Police
- else if(IsPlayerInRangeOfPoint(playerid, 6.0, 211.0195, -35.2429, 0.7898))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- SetVehiclePos(vehicleid, -1775.2841, 985.0253, 23.2914);
- SetVehicleZAngle(vehicleid, 269.8678);
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a vehicle in order to pass through this!");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, -1777.8029, 996.6982, 24.3305) || IsPlayerInRangeOfPoint(playerid, 3.0, -1777.5427, 967.4189, 24.3657))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- SetVehiclePos(vehicleid, 211.3989, -28.5980, 1.5781);
- SetVehicleZAngle(vehicleid, 2.4807);
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a vehicle in order to pass through this!");
- }
- // Hospital
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 58.8201, -195.7375, 1.6446))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- SetVehiclePos(vehicleid, 318.6588, -1491.4716, 24.5918);
- SetVehicleZAngle(vehicleid, 147.7229);
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a vehicle in order to pass through this!");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 318.6588, -1491.4716, 24.5918))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- SetVehiclePos(vehicleid, 58.8245, -192.3390, 1.7719);
- SetVehicleZAngle(vehicleid, 211.9615);
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a vehicle in order to pass through this!");
- }
- // Bank
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2305.1602, -16.2648, 26.2677))
- {
- SetPlayerPos(playerid, 273.0509, -195.4212, 1.1390);
- SetPlayerInterior(playerid, 0);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, 273.0509, -195.4212, 1.1390))
- {
- SetPlayerPos(playerid, 2305.1602, -16.2648, 26.2677);
- SetPlayerInterior(playerid, 0);
- }
- return 1;
- }
- // Jobs
- CMD:fish(playerid, params[])
- {
- new str[80], pname[MAX_PLAYER_NAME +1];
- GetPlayerName(playerid, pname, sizeof(pname));
- if(IsPlayerInRangeOfPoint(playerid, 6.0, 373.4215, -275.4926, 1.0578) || IsPlayerInRangeOfPoint(playerid, 6.0, 386.2177, -267.5155, 1.0633) || IsPlayerInRangeOfPoint(playerid, 6.0, 356.2553, -286.0096, 1.4032))
- {
- if(pCarryingFish[playerid] < 40)
- {
- if(pRentedFishRod[playerid] == 1)
- {
- format(str, sizeof(str), "%s has just cast out their rod!", pname);
- SendNearbyMessage(playerid, 0xC2A2DAAA, str, 6.0);
- fishtimer[playerid] = SetTimer("FishingCooldown", 1000, true);
- fishtimervalue[playerid] = 15;
- TogglePlayerControllable(playerid, false);
- ApplyAnimation(playerid, "SWORD", "sword_4", 4.1, false, 0, 0, 1, 1, 1);
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need a fishing rod in order to fish! Hire one at the fishing booth!");
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You are already carrying too many fish! Type {FFBB00}/sellfish{FFFFFF} at the fishing booth!");
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} There's no fish around here! Please proceed to the fishing docks and try again!");
- return 1;
- }
- CMD:nocp(playerid, params[])
- {
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have disabled all active checkpoints!");
- return 1;
- }
- CMD:rentrod(playerid, params[])
- {
- if(GetPlayerMoney(playerid) < 150) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need atleast {FFBB00}$150{FFFFFF} to rent a fishing rod!");
- if(pRentedFishRod[playerid] == 1) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're already renting a fishing rod! Return it using {FFBB00}/returnrod{FFFFFF}!");
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 382.7930, -260.5501, 1.6535))
- {
- SetPlayerAttachedObject(playerid, 8,18632, 6, 0.059999, 0.012000, 0.000000, -154.700012, 33.999992, -4.600000, 1.000000, 1.000000, 1.000000);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You've hired a fishing rod for {FFBB00}$150{FFFFFF}! Make sure to return it later using {FFBB00}/returnrod{FFFFFF}!");
- GivePlayerMoney(playerid, -150);
- pRentedFishRod[playerid] = 1;
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the fishing booth! Please proceed to the fishing docks and try again!");
- return 1;
- }
- CMD:returnrod(playerid, params[])
- {
- if(pRentedFishRod[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You haven't rented a fishing rod yet! Hire one using {FFBB00}/rentrod{FFFFFF}!");
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 382.7930, -260.5501, 1.6535))
- {
- RemovePlayerAttachedObject(playerid, 8);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You've returned your fishing rod! Your {FFBB00}$150{FFFFFF} has been returned!");
- GivePlayerMoney(playerid, 150);
- pRentedFishRod[playerid] = 0;
- }
- else SendClientMessage(playerid ,0x46E850FF, "SERVER:{FFFFFF} You're not near the fishing booth! Please proceed to the fishing docks and try again!");
- return 1;
- }
- CMD:sellfish(playerid, params[])
- {
- new reward, str[80];
- if(pRentedFishRod[playerid] == 1) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Return your fishing rod first using {FFBB00}/returnrod{FFFFFF}!");
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 382.7930, -260.5501, 1.6535))
- {
- reward += pCarryingFish[playerid] *3;
- format(str, sizeof(str), "SERVER:{FFFFFF} You've sold your current fish (%d lbs) for {FFBB00}$%d{FFFFFF}!", pCarryingFish[playerid], reward);
- SendClientMessage(playerid, 0x46E850FF, str);
- GivePlayerMoney(playerid, reward);
- pCarryingFish[playerid] = 0;
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the fishing booth! Please proceed to the fishing docks and try again!");
- return 1;
- }
- CMD:checkfish(playerid, params[])
- {
- new str[80];
- if(pCarryingFish[playerid] > 150) pCarryingFish[playerid] = 150; // bug fix
- format(str, sizeof(str), "SERVER:{FFFFFF} Carrying {3FA152}%d{FFFFFF}/{C42D2D}150{FFFFFF} lbs of fish!", pCarryingFish[playerid]);
- SendClientMessage(playerid, 0x46E850FF, str);
- return 1;
- }
- // Businesses
- CMD:biztillinfo(playerid, params[])
- {
- new string[128], bizid = pInfo[playerid][BizOwner];
- if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
- format(string, sizeof(string), "SERVER:{FFFFFF} Business ID: %d Till", bizid);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} Current Amount: %d", bInfo[bizid][Till]);
- SendClientMessage(playerid, 0x46E850FF, string);
- return 1;
- }
- CMD:biztwithdraw(playerid, params[])
- {
- new string[128], amount, bizid = pInfo[playerid][BizOwner], oldamount;
- if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
- if(sscanf(params, "i", amount)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /biztwithdraw [amount]");
- if(amount > bInfo[bizid][Till]) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Your business till doesn't hold that much money!");
- oldamount = bInfo[bizid][Till];
- bInfo[bizid][Till] -= amount;
- GivePlayerMoney(playerid, amount);
- SaveBizzes();
- format(string, sizeof(string), "SERVER:{FFFFFF} Business ID: %d Till Information", bizid);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} Current Amount: %d || Old Amount: %d", bInfo[bizid][Till], oldamount);
- SendClientMessage(playerid, 0x46E850FF, string);
- return 1;
- }
- CMD:biztdeposit(playerid, params[])
- {
- new string[128], amount, bizid = pInfo[playerid][BizOwner], oldamount;
- if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
- if(sscanf(params, "i", amount)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /biztdeposit [amount]");
- if(amount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money!");
- oldamount = bInfo[bizid][Till];
- GivePlayerMoney(playerid, -amount);
- bInfo[bizid][Till] += amount;
- SaveBizzes();
- format(string, sizeof(string), "SERVER:{FFFFFF} Business ID: %d Till Information", bizid);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} Current Amount: %d || Old Amount: %d", bInfo[bizid][Till], oldamount);
- SendClientMessage(playerid, 0x46E850FF, string);
- return 1;
- }
- CMD:bizlocate(playerid, params[])
- {
- new bid;
- if(sscanf(params, "i", bid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizlocate [business id]");
- SetPlayerCheckpoint(playerid, bInfo[bid][extX], bInfo[bid][extY], bInfo[bid][extZ], 3.0);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} The location of the business has been {DE3535}marked{FFFFFF} on your map! Use /nocp to hide the checkpoint!");
- return 1;
- }
- CMD:bizsell(playerid, params[])
- {
- new name[25], str1[128], pNearBiz[MAX_PLAYERS] = 0, newname[25], fee = 0;
- GetPlayerName(playerid, name, 25);
- if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
- {
- if(pInfo[playerid][BizOwner] == i)
- {
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You sold business ID: %d for %d!", i, bInfo[i][Price]);
- pNearBiz[playerid] = 1;
- pInfo[playerid][BizOwner] = 9999;
- format(newname, 25, "None");
- bInfo[i][Owner] = newname;
- bInfo[i][Bought] = 0;
- fee = bInfo[i][Price];
- }
- else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this business!");
- }
- }
- if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your business!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- GivePlayerMoney(playerid, fee);
- ReloadLabels();
- return 1;
- }
- CMD:bizname(playerid, params[])
- {
- new str1[128], pNearBiz[MAX_PLAYERS] = 0, name[45];
- if(sscanf(params, "s[45]", name)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizname [name]");
- if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
- {
- if(pInfo[playerid][BizOwner] == i)
- {
- bInfo[i][Name] = name;
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You have set your business name to %s.", name);
- pNearBiz[playerid] = 1;
- }
- else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this business!");
- }
- }
- if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your business!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- ReloadLabels();
- return 1;
- }
- CMD:bizbuy(playerid, params[])
- {
- new str1[128], name[MAX_PLAYER_NAME+1], pNearBiz[MAX_PLAYERS] = 0, fee, str2[128];
- GetPlayerName(playerid, name, sizeof(name));
- if(pInfo[playerid][BizOwner] < 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You already own a business!");
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
- {
- if(bInfo[i][Bought] == 1) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This business is already bought!");
- if(GetPlayerMoney(playerid) < bInfo[i][Price]) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this business!");
- else if(bInfo[i][Bought] == 0)
- {
- pNearBiz[playerid] = 1;
- pInfo[playerid][BizOwner] = i;
- bInfo[i][Owner] = name;
- bInfo[i][Bought] = 1;
- format(str2, 128, "[BUSINESS]\n{46E850}[Owner]{FFFFFF}: %s\n{46E850}[Entry]{FFFFFF}: %d", bInfo[i][Owner], bInfo[i][Fee]);
- Update3DTextLabelText(Text3D: i, 0x46E850FF, str2);
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You bought business ID %d for %d! Alter it using /bizlock, /bizfee and /bizname!", i, bInfo[i][Price], pInfo[playerid][BizOwner]);
- fee = bInfo[i][Price];
- }
- }
- }
- if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near any business!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- GivePlayerMoney(playerid, -fee);
- ReloadLabels();
- return 1;
- }
- CMD:biznear(playerid, params[])
- {
- new str1[128], pNearBiz[MAX_PLAYERS] = 0;
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
- {
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You're near business ID: %d. Price: %d Owner: %s.", i, bInfo[i][Price], bInfo[i][Owner]);
- pNearBiz[playerid] = 1;
- }
- }
- if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near any business!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- return 1;
- }
- CMD:bizfee(playerid, params[])
- {
- new str1[128], pNearBiz[MAX_PLAYERS] = 0, fee;
- if(sscanf(params, "i", fee)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizfee [fee]");
- if(fee > 2500) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} The entrance fee can't be higher than $2500!");
- if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
- {
- if(pInfo[playerid][BizOwner] == i)
- {
- bInfo[i][Fee] = fee;
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You have set your entry fee to %d.", fee);
- pNearBiz[playerid] = 1;
- }
- else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this business!");
- }
- }
- if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your business!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- ReloadLabels();
- return 1;
- }
- CMD:bizlock(playerid, params[])
- {
- new str1[128], pNearBiz[MAX_PLAYERS] = 0;
- if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
- for(new i = 0; i < MAX_BUSINESSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
- {
- if(pInfo[playerid][BizOwner] == i)
- {
- if(bInfo[i][Locked] == 0)
- {
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You've locked your business!");
- pNearBiz[playerid] = 1;
- bInfo[i][Locked] = 1;
- }
- else if(bInfo[i][Locked] == 1)
- {
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You've unlocked your business!");
- pNearBiz[playerid] = 1;
- bInfo[i][Locked] = 0;
- }
- }
- else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this business!");
- }
- }
- if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your business!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- ReloadLabels();
- return 1;
- }
- // Vehicle
- CMD:carlocate(playerid, params[])
- {
- new v = pInfo[playerid][VehicleOwner], string[128], Float: X, Float: Y, Float: Z;
- GetVehiclePos(v, X, Y, Z);
- if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
- format(string, sizeof(string), "SERVER:{FFFFFF} Your vehicle has been {DE3535}marked{FFFFFF} on your minimap (ID: %d)! To hide the checkpoint, use /nocp!", v);
- SendClientMessage(playerid, 0x46E850FF, string);
- SetPlayerCheckpoint(playerid, X, Y, Z, 3.0);
- return 1;
- }
- CMD:cartow(playerid, params[])
- {
- new v = pInfo[playerid][VehicleOwner], string[128];
- if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
- format(string, sizeof(string), "SERVER:{FFFFFF} You have respawned your vehicle. (ID: %d)", v);
- SendClientMessage(playerid, 0x46E850FF, string);
- SetVehicleToRespawn(v);
- return 1;
- }
- CMD:cargive(playerid, params[])
- {
- new targetid, Float: X, Float: Y, Float: Z, string[128], pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], v = pInfo[playerid][VehicleOwner], fix[30];
- if(sscanf(params, "u", targetid))return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /cargive [player]");
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a car in order to do this command!");
- if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
- GetPlayerPos(targetid, X, Y, Z), GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(fix, sizeof(fix), "%s", tname);
- if(GetPlayerVehicleID(playerid) == v)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
- {
- format(string, sizeof(string), "SERVER:{FFFFFF} (%d) %s has just given you their vehicle! ID: %d", playerid, pname, v);
- SendClientMessage(targetid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} You've just given (%d) %s your vehicle! ID: %d", targetid, tname, v);
- SendClientMessage(playerid, 0x46E850FF, string);
- pInfo[playerid][VehicleOwner] = 0;
- pInfo[targetid][VehicleOwner] = v;
- vInfo[v][Owner] = fix;
- SaveVehicles();
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You've not near the player!");
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This isn't your vehicle!");
- return 1;
- }
- CMD:carregister(playerid, params[])
- {
- new v = GetPlayerVehicleID(playerid), randnr = random(400), string[128], plate[8];
- randnr += 4600;
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a car in order to do this command!");
- if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
- if(GetPlayerVehicleID(playerid) == v)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 168.6218, -49.5795, 1.5781))
- {
- if(pInfo[playerid][VehicleOwner] == v)
- {
- format(plate, sizeof(plate), "BB %d", randnr);
- vInfo[v][NrPlate] = plate;
- format(string, sizeof(string), "SERVER:{FFFFFF} You've registered your vehicle plate as {638A91}%s{FFFFFF}!", plate);
- SendClientMessage(playerid, 0x46E850FF, string);
- SetVehicleNumberPlate(v, plate);
- SetVehicleToRespawn(v);
- PutPlayerInVehicle(playerid, v, 0);
- SaveVehicles();
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own this car!");
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the dealership!");
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This isn't your vehicle!");
- return 1;
- }
- CMD:carlights(playerid, params[])
- {
- new v = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective, string[128], pname[MAX_PLAYER_NAME+1];
- GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
- GetPlayerName(playerid, pname, sizeof(pname));
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(vLights[v] == 0)
- {
- SetVehicleParamsEx(v, engine, 1, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
- format(string, sizeof(string), "%s has just turned their vehicles' lights on.", pname);
- vLights[v] = 1;
- }
- else if(vLights[v] == 1)
- {
- SetVehicleParamsEx(v, engine, 0, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
- format(string, sizeof(string), "%s has just turned their vehicles' lights off.", pname);
- vLights[v] = 0;
- }
- SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
- }
- else SendClientMessage(playerid, -1, "You must be in a vehicle in order to do this command!");
- return 1;
- }
- CMD:carhood(playerid, params[])
- {
- new v = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective, string[128], pname[MAX_PLAYER_NAME+1];
- GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
- GetPlayerName(playerid, pname, sizeof(pname));
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(vBonnet[v] == 0)
- {
- SetVehicleParamsEx(v, engine, lights, alarm, doors, 1, boot, objective); // ONLY the engine param was changed (to 1)
- format(string, sizeof(string), "%s has just opened their vehicles' bonnet.", pname);
- vBonnet[v] = 1;
- }
- else if(vBonnet[v] == 1)
- {
- SetVehicleParamsEx(v, engine, lights, alarm, doors, 0, boot, objective); // ONLY the engine param was changed (to 1)
- format(string, sizeof(string), "%s has just closed their vehicles' bonnet.", pname);
- vBonnet[v] = 0;
- }
- SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
- }
- else SendClientMessage(playerid, -1, "You must be in a vehicle in order to do this command!");
- return 1;
- }
- CMD:cartrunk(playerid, params[])
- {
- new v = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective, string[128], pname[MAX_PLAYER_NAME+1];
- GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
- GetPlayerName(playerid, pname, sizeof(pname));
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(vTrunk[v] == 0)
- {
- SetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, 1, objective); // ONLY the engine param was changed (to 1)
- format(string, sizeof(string), "%s has just opened their vehicles' trunk.", pname);
- vTrunk[v] = 1;
- }
- else if(vTrunk[v] == 1)
- {
- SetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, 0, objective); // ONLY the engine param was changed (to 1)
- format(string, sizeof(string), "%s has just closed their vehicles' trunk.", pname);
- vTrunk[v] = 0;
- }
- SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
- }
- else SendClientMessage(playerid, -1, "You must be in a vehicle in order to do this command!");
- return 1;
- }
- CMD:carlock(playerid, params[])
- {
- new string[128], v = pInfo[playerid][VehicleOwner], Float: X, Float: Y, Float: Z, pname[MAX_PLAYER_NAME+1];
- GetVehiclePos(v, X, Y, Z), GetPlayerName(playerid, pname, sizeof(pname));
- if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
- if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
- {
- if(vInfo[v][Locked] == 0)
- {
- format(string, sizeof(string), "SERVER:{FFFFFF} You've locked your vehicle! (ID: %d)", v);
- SetVehicleParamsForPlayer(v, playerid, 0, 1);
- format(string, sizeof(string), "%s has just locked their vehicle.", pname);
- vInfo[v][Locked] = 1;
- }
- else if(vInfo[v][Locked] == 1)
- {
- format(string, sizeof(string), "SERVER:{FFFFFF} You've unlocked your vehicle! (ID: %d)", v);
- SetVehicleParamsForPlayer(v, playerid, 0, 0);
- format(string, sizeof(string), "%s has just unlocked their vehicle.", pname);
- vInfo[v][Locked] = 0;
- }
- SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
- }
- else if(!IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) format(string, sizeof(string), "SERVER:{FFFFFF} You're not near your car!");
- SendClientMessage(playerid, 0x46E850FF, string);
- return 1;
- }
- CMD:carpark(playerid, params[])
- {
- new v = GetPlayerVehicleID(playerid), Float: X, Float: Y, Float: Z, Float: A;
- GetPlayerPos(playerid, X, Y, Z), GetPlayerFacingAngle(playerid, A);
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a car in order to do this command!");
- if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
- if(GetPlayerVehicleID(playerid) == v)
- {
- if(pInfo[playerid][VehicleOwner] == v)
- {
- vInfo[v][posX] = X;
- vInfo[v][posY] = Y;
- vInfo[v][posZ] = Z;
- vInfo[v][posA] = A;
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You've parked your vehicle!");
- SaveVehicles();
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own this car!");
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This isn't your vehicle!");
- return 1;
- }
- CMD:carbuy(playerid, params[])
- {
- new string[690];
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 168.6218, -49.5795, 1.5781))
- {
- format(string, 230, "Sabre (30,000)\nClover (30,000)\nBroadway (30,000)\nBuccaneer (30,000)\nSlamvan (45,000)\nBlade (45,000)\nVincent (45,000)\nElegant (45,000)\nIntruder (45,000)\nPrimo (45,000)\nMerit (45,000)\nEmperor (45,000)\n");
- format(string, 460, "%s Sentinel (45,000)\nVoodoo (45,000)\nBlista Compact (45,000)\nSolair ( 45,000)\nPerenail (45,000)\nClub (45,000)\nWasington (50,000)\nPremier ( 50,000)\nStafford (50,000)\nFeltzer (50,000)\nSavanna (50,000)\nTornado (50,000)\n", string);
- format(string, 690, "%s Tahoma (50,000)\nMajestic (50,000)\nPicador (50,000)\nRancher (60,000)\nRegina (60,000)\nLandstalker (60,000)\nHuntley (60,000)\nBuffalo (75,000)\nElegy (75,000)\nFlash (75,000)\nSultan (75,000)\nJester (75,000)\n", string);
- ShowPlayerDialog(playerid, DIALOG_CARBUY, DIALOG_STYLE_LIST, "Car Dealership", string, "Purchase", "Cancel");
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the dealership!");
- return 1;
- }
- CMD:bikebuy(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 168.6218, -49.5795, 1.5781))
- {
- ShowPlayerDialog(playerid, DIALOG_CARBUY, DIALOG_STYLE_LIST, "Bike Dealership", "Faggio (15,000)\nPCJ 600 (45,000)\nBF 400 (45,000)\nFCR 900 (45,000)\nSanchez (30,000)\nFreeway (25,000)\nWayfarer (25,000)\n", "Purchase", "Cancel");
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the dealership!");
- return 1;
- }
- // House
- CMD:housesell(playerid, params[])
- {
- new name[25], str1[128], pNearHouse[MAX_PLAYERS] = 0, newname[25], fee = 0;
- GetPlayerName(playerid, name, 25);
- if(pInfo[playerid][HouseOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a house!");
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
- {
- if(pInfo[playerid][HouseOwner] == i)
- {
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You sold house ID: %d for %d!", i, hInfo[i][Price]);
- pNearHouse[playerid] = 1;
- pInfo[playerid][HouseOwner] = 9999;
- format(newname, 25, "None");
- hInfo[i][Owner] = newname;
- hInfo[i][Bought] = 0;
- fee = hInfo[i][Price];
- }
- else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this house!");
- }
- }
- if(pNearHouse[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your house!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- GivePlayerMoney(playerid, fee);
- ReloadLabels();
- return 1;
- }
- CMD:houselock(playerid, params[])
- {
- new str1[128], pNearHouse[MAX_PLAYERS] = 0;
- if(pInfo[playerid][HouseOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a house!");
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
- {
- if(pInfo[playerid][HouseOwner] == i)
- {
- if(hInfo[i][Locked] == 0)
- {
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You've locked your door!");
- pNearHouse[playerid] = 1;
- hInfo[i][Locked] = 1;
- }
- else if(hInfo[i][Locked] == 1)
- {
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You've unlocked your door!");
- pNearHouse[playerid] = 1;
- hInfo[i][Locked] = 0;
- }
- }
- else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this house!");
- }
- }
- if(pNearHouse[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your house!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- ReloadLabels();
- return 1;
- }
- CMD:housebuy(playerid, params[])
- {
- new str1[128], name[MAX_PLAYER_NAME+1], pNearHouse[MAX_PLAYERS] = 0, fee, str2[128];
- GetPlayerName(playerid, name, sizeof(name));
- if(pInfo[playerid][HouseOwner] < 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You already own a house!");
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
- {
- if(hInfo[i][Bought] == 1) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This house is already bought!");
- if(GetPlayerMoney(playerid) < hInfo[i][Price]) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this house!");
- else if(hInfo[i][Bought] == 0)
- {
- pNearHouse[playerid] = 1;
- pInfo[playerid][HouseOwner] = i;
- hInfo[i][Owner] = name;
- hInfo[i][Bought] = 1;
- format(str2, 128, "[HOUSE]\n{46E850}[Owner]{FFFFFF}: %s\n{46E850}[Price]{FFFFFF}: %d", hInfo[i][Owner], hInfo[i][Price]);
- Update3DTextLabelText(Text3D: i, 0x46E850FF, str2);
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You bought house ID %d for %d! (DEBUG: %d)", i, hInfo[i][Price], pInfo[playerid][HouseOwner]);
- fee = hInfo[i][Price];
- }
- }
- }
- if(pNearHouse[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near any house!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- GivePlayerMoney(playerid, -fee);
- ReloadLabels();
- return 1;
- }
- CMD:housenear(playerid, params[])
- {
- new str1[128], pNearHouse[MAX_PLAYERS] = 0;
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
- {
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You're near house ID: %d. Price: %d Owner: %s.", i, hInfo[i][Price], hInfo[i][Owner]);
- pNearHouse[playerid] = 1;
- }
- }
- if(pNearHouse[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near any house!");
- SendClientMessage(playerid, 0x46E850FF, str1);
- return 1;
- }
- CMD:houselocate(playerid, params[])
- {
- new hid;
- if(sscanf(params, "i", hid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /houselocate [house id]");
- SetPlayerCheckpoint(playerid, hInfo[hid][extX], hInfo[hid][extY], hInfo[hid][extZ], 3.0);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} The location of the house has been {DE3535}marked{FFFFFF} on your map! Use /nocp to hide the checkpoint!");
- return 1;
- }
- // =-=-=-=-=-=-=-=-= COMMUNICATION COMMANDS =-=-=-=-=-=-=-=-= //
- CMD:pm(playerid, params[])
- {
- new str[128], text[128], targetid, pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME];
- if(sscanf(params, "us[128]", targetid, text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /pm [player] [text]");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Player isn't connected!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(str, sizeof(str), "PM To %s (%d): %s", tname, targetid, text);
- SendClientMessage(playerid, 0xE0E800FF, str);
- format(str, sizeof(str), "PM From %s (%d): %s", pname, playerid, text);
- SendClientMessage(targetid, 0xE8C900FF, str);
- return 1;
- }
- CMD:privmsg(playerid, params[]) return cmd_pm(playerid, params);
- CMD:o(playerid, params[])
- {
- new text[128], string[128], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /o [text]");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "(( [%d] %s: %s ))", playerid, pname, text);
- SendClientMessageToAll(-1, string);
- return 1;
- }
- CMD:b(playerid, params[])
- {
- new text[128], string[128], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /b [text]");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "(( [%d] %s: %s ))", playerid, pname, text);
- SendNearbyMessage(playerid, 0xB3B3B3FF, string, 5.0);
- return 1;
- }
- CMD:low(playerid, params[])
- {
- new text[128], string[128], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /low [text]");
- GetPlayerName(playerid, pname, sizeof(pname));
- if(pMask[playerid] == 0) format(string, sizeof(string), "%s says [low]: %s", pname, text);
- else if(pMask[playerid] == 1) format(string, sizeof(string), "Stranger %d says [low]: %s", pInfo[playerid][MaskID], text);
- SendNearbyMessage(playerid, 0xA3A3A3FF, string, 2.0);
- return 1;
- }
- CMD:shout(playerid, params[])
- {
- new text[128], string[128], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /s(hout) [text]");
- GetPlayerName(playerid, pname, sizeof(pname));
- if(pMask[playerid] == 0) format(string, sizeof(string), "%s se dere: %s", pname, text);
- else if(pMask[playerid] == 1) format(string, sizeof(string), "Tuginec %d se dere: %s", pInfo[playerid][MaskID], text);
- SendNearbyMessage(playerid, -1, string, 9.0);
- return 1;
- }
- CMD:s(playerid, params[]) return cmd_shout(playerid, params);
- CMD:me(playerid, params[])
- {
- new text[128], string[128], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} /me [akcija]");
- GetPlayerName(playerid, pname, sizeof(pname));
- if(pMask[playerid] == 0) format(string, sizeof(string), "%s %s", pname, text);
- else if(pMask[playerid] == 1) format(string, sizeof(string), "Tuginec %d %s", pInfo[playerid][MaskID], text);
- SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
- return 1;
- }
- CMD:mes(playerid, params[])
- {
- new text[128], string[128], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /mes [action]");
- GetPlayerName(playerid, pname, sizeof(pname));
- if(pMask[playerid] == 0) format(string, sizeof(string), "%s's %s", pname, text);
- else if(pMask[playerid] == 1) format(string, sizeof(string), "Stranger %d's %s", pInfo[playerid][MaskID], text);
- SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
- return 1;
- }
- CMD:do(playerid, params[])
- {
- new text[128], string[128], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /do [action]");
- GetPlayerName(playerid, pname, sizeof(pname));
- if(pMask[playerid] == 0) format(string, sizeof(string), "%s (( %s ))", text, pname);
- else if(pMask[playerid] == 1) format(string, sizeof(string), "%s ((Tuginec %d ))", text, pInfo[playerid][MaskID]);
- SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
- return 1;
- }
- // =-=-=-=-=-=-=-=-= FACTION COMMANDS =-=-=-=-=-=-=-=-= //
- CMD:finvite(playerid, params[])
- {
- new pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], targetid, string[128], factionid = pInfo[playerid][Faction];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /finvite [player]");
- if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- pInfo[targetid][Faction] = factionid;
- format(string, sizeof(string), "{ [%d] %s has just invited [%d] %s }", playerid, pname, targetid, tname);
- SendFactionMessage(factionid, string);
- return 1;
- }
- CMD:funinvite(playerid, params[])
- {
- new pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], targetid, string[128], factionid = pInfo[playerid][Faction];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /funinvite [player]");
- if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- pInfo[targetid][Faction] = 0;
- format(string, sizeof(string), "{ [%d] %s has just uninvited [%d] %s }", playerid, pname, targetid, tname);
- SendFactionMessage(factionid, string);
- return 1;
- }
- CMD:fsettier(playerid, params[])
- {
- new pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], targetid, tier, string[128], factionid = pInfo[playerid][Faction];
- if(sscanf(params, "ui", targetid, tier)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /factionsettier [player] [tier]");
- if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- pInfo[targetid][FactionTier] = tier;
- format(string, sizeof(string), "{ [%d] %s has just set [%d] %s to tier %d }", playerid, pname, targetid, tname, tier);
- SendFactionMessage(factionid, string);
- return 1;
- }
- CMD:fsetrank(playerid, params[])
- {
- new pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], targetid, rank[30], string[128], factionid = pInfo[playerid][Faction];
- if(sscanf(params, "us[30]", targetid, rank)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /factionsetrank [player] [rank]");
- if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- pInfo[targetid][FactionRank] = rank;
- format(string, sizeof(string), "{ [%d] %s has just set [%d] %s's rank to %s }", playerid, pname, targetid, tname, rank);
- SendFactionMessage(factionid, string);
- return 1;
- }
- CMD:ftowcars(playerid, params[])
- {
- new factionid = pInfo[playerid][Faction], string[128], pname[MAX_PLAYER_NAME+1];
- if(pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not in a faction!");
- if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][FactionTier] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Only tier 1 or 2 can do this command!");
- GetPlayerName(playerid, pname, sizeof(pname));
- if(pInfo[playerid][Faction] <= 3 && pInfo[playerid][FactionTier] < 3)
- {
- format(string, sizeof(string), "(%d) %s has just towed all the faction vehicles!", playerid, pname);
- SendFactionMessage(factionid, string);
- TowFactionVehicles(factionid);
- printf(string);
- }
- return 1;
- }
- CMD:faction(playerid, params[])
- {
- new string[128], text[120], pname[MAX_PLAYER_NAME+1], factionid = pInfo[playerid][Faction];
- if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /f(action) [text]");
- if(pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not in a faction!");
- if(FactionChat[factionid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Faction chat is disabled!");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "{ [%d] %s %s: %s }", playerid, pInfo[playerid][FactionRank], pname, text);
- SendFactionMessage(factionid, string);
- return 1;
- }
- CMD:f(playerid, params[]) return cmd_faction(playerid, params);
- CMD:fnochat(playerid, params[])
- {
- new string[128], pname[MAX_PLAYER_NAME+1], factionid = pInfo[playerid][Faction];
- if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
- GetPlayerName(playerid, pname, sizeof(pname));
- if(FactionChat[factionid] == 0)
- {
- format(string, sizeof(string), "{ [%d] %s has just turned the faction chat on. }", playerid, pname);
- FactionChat[factionid] = 1;
- }
- else if(FactionChat[factionid] == 1)
- {
- format(string, sizeof(string), "{ [%d] %s has just turned the faction chat off. }", playerid, pname);
- FactionChat[factionid] = 0;
- }
- SendFactionMessage(factionid, string);
- return 1;
- }
- // =-=-=-=-=-=-=-=-= ADMIN COMMANDS =-=-=-=-=-=-=-=-= //
- CMD:makeadmin(playerid, params[])
- {
- new targetid, input, pname[MAX_PLAYER_NAME +1], tname[MAX_PLAYER_NAME +1], string[128];
- if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /makeadmin [player] [level]");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- if(IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 3)
- {
- format(string, sizeof(string), "ADMCMD: (%d) %s has set (%d) %s to a level %d admin.", playerid, pname, targetid, tname, input);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "You have been made a level %d administrator by (%d) %s.", input, playerid, pname);
- SendClientMessage(targetid, -1, string);
- pInfo[targetid][Admin] = input;
- }
- else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Your admin level isn't high enough!");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- return 1;
- }
- CMD:ahelp(playerid, params[])
- {
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- SendClientMessage(playerid, 0x46E850FF, "Administrator Commands");
- if(pInfo[playerid][Admin] > 0)
- SendClientMessage(playerid, 0x46E850FF, "[LEVEL 1]:{FFFFFF} /a(chat), /aduty, /ann(ounce), /kick, /ban, /slap, /gethere, /goto, /gotopos, gotoveh, /getveh, /networkinfo");
- SendClientMessage(playerid, 0x46E850FF, "[LEVEL 1]:{FFFFFF} /arevive");
- if(pInfo[playerid][Admin] > 1)
- SendClientMessage(playerid, 0x46E850FF, "[LEVEL 2]:{FFFFFF} /setskin, /sethealth, /setarmor, /fillhealth, /fillarmor, /giveweapon, /setmaskid, /setphonenr, /changegender");
- SendClientMessage(playerid, 0x46E850FF, "[LEVEL 2]:{FFFFFF} /setfaction, /givemoney, /setmoney, /takemoney, /bizgoto, /housegoto, /setinterior, /setvirtualworld");
- if(pInfo[playerid][Admin] > 2)
- SendClientMessage(playerid, 0x46E850FF, "[LEVEL 3]:{FFFFFF} /housecreate, /housedelete, /housesellall, /houseedit, /bizcreate, /bizdelete, /bizaname");
- return 1;
- }
- CMD:aduty(playerid, params[])
- {
- new string[128], pname[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, pname, sizeof(pname));
- if(pAdminDuty[playerid] == 0)
- {
- pAdminDuty[playerid] = 1;
- SetPlayerColor(playerid, 0x46E850FF);
- format(string, sizeof(string), "(%d) %s has just gone on admin duty!", playerid, pname);
- SendAdminMessage(0x46E850FF, string);
- }
- else if(pAdminDuty[playerid] == 1)
- {
- pAdminDuty[playerid] = 0;
- SetPlayerColor(playerid, 0x46E850FF);
- format(string, sizeof(string), "(%d) %s has just gone off admin duty!", playerid, pname);
- SendAdminMessage(0x46E850FF, string);
- }
- return 1;
- }
- CMD:achat(playerid, params[])
- {
- new string[128], text[128], pname[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, pname, sizeof(pname));
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /a(chat) [text]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- format(string, sizeof(string), "[LVL: %d]{FFFFFF} (%d) %s: %s", pInfo[playerid][Admin], playerid, pname, text);
- SendAdminMessage(0x46E850FF, string);
- return 1;
- }
- CMD:a(playerid, params[]) return cmd_achat(playerid, params);
- CMD:arevive(playerid, params[])
- {
- new targetid, targetname[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME], string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/revive [target]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- GetPlayerName(playerid, playername, sizeof(playername)), GetPlayerName(targetid, targetname, sizeof(targetname));
- if(pDeathMode[targetid] == 1)
- {
- KillTimer(pDeathModeTimer[targetid]);
- TogglePlayerControllable(targetid, true);
- SetPlayerColor(targetid, -1);
- pDeathMode[targetid] = 0;
- format(string, sizeof(string), "%s has just revived you!", playername);
- SendClientMessage(targetid, -1, string);
- format(string, sizeof(string), "You have just revived %s!", targetname);
- SendClientMessage(playerid, -1, string);
- }
- else SendClientMessage(playerid, -1, "You can't revive that player because they're not in death mode!");
- return 1;
- }
- CMD:announce(playerid, params[])
- {
- new string[128], text[128], pname[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, pname, sizeof(pname));
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /ann(ounce) [text]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- format(string, sizeof(string), "[ADM]{FFFFFF} (%d) %s: %s", playerid, pname, text);
- SendClientMessageToAll(0x46E850FF, string);
- return 1;
- }
- CMD:ann(playerid, params[]) return cmd_announce(playerid, params);
- CMD:kick(playerid, params[])
- {
- new targetid, reason[128], string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /kick [player] [reason]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMWRN: (%d) %s has just kicked (%d) %s for %s", playerid, pname, targetid, tname, reason);
- SendClientMessageToAll(0x46E850FF, string);
- Kick(targetid);
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- new targetid, reason[128], string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /ban [player] [reason]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMWRN: (%d) %s has just banned (%d) %s for %s", playerid, pname, targetid, tname, reason);
- SendClientMessageToAll(0x46E850FF, string);
- Ban(targetid);
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /slap [player]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just slapped (%d) %s.", playerid, pname, targetid, tname);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "You have been slapped by administrator (%d) %s.", playerid, pname);
- SendClientMessage(targetid, -1, string);
- GetPlayerPos(targetid, X, Y, Z);
- SetPlayerPos(targetid, X, Y, Z +10);
- return 1;
- }
- CMD:networkinfo(playerid, params[])
- {
- new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], vers[40], ipport[24];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /networkinfo [player]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- GetPlayerVersion(targetid, vers, sizeof(vers)), GetPlayerIp(targetid, ipport, sizeof(ipport));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just checked (%d) %s's network information.", playerid, pname, targetid, tname);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "{FFBB00}INFO:{FFFFFF} (%d) %s {FFBB00}MESSAGES SENT:{FFFFFF} %i", playerid, pname, (targetid));
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "{FFBB00}CLIENT VERSION:{FFFFFF} %s {FFBB00}CONNECTED FOR:{FFFFFF} %i ms.", vers, (targetid));
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "{FFBB00}IP ADDRESS:{FFFFFF} %s {FFBB00}PACKET LOSS:{FFFFFF} %0.2f", ipport, (targetid));
- SendClientMessage(playerid, -1, string);
- format(string, sizeof(string), "{FFBB00}CURRENT PING:{FFFFFF} %d {FFBB00}BYTES RECIEVED:{FFFFFF} %i", GetPlayerPing(targetid), (targetid));
- SendClientMessage(playerid, -1, string);
- return 1;
- }
- CMD:gethere(playerid, params[])
- {
- new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /gethere [player]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported (%d) %s to themself.", playerid, pname, targetid, tname);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "You have been teleported to administrator (%d) %s.", playerid, pname);
- SendClientMessage(targetid, -1, string);
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(targetid, X, Y, Z);
- return 1;
- }
- CMD:goto(playerid, params[])
- {
- new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /goto [player]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported to (%d) %s.", playerid, pname, targetid, tname);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just teleported to you.", playerid, pname);
- SendClientMessage(targetid, -1, string);
- GetPlayerPos(targetid, X, Y, Z);
- SetPlayerPos(playerid, X, Y, Z);
- return 1;
- }
- CMD:gotopos(playerid, params[])
- {
- new string[128], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
- if(sscanf(params, "fff", X, Y, Z)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /gotopos [x] [y] [z]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported to coordinates: %f %f %f.", playerid, pname, X, Y, Z);
- SendAdminMessage(0x46E850FF, string);
- SetPlayerPos(playerid, X, Y, Z);
- return 1;
- }
- CMD:gotoveh(playerid, params[])
- {
- new vehicle, string[128], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
- if(sscanf(params, "i", vehicle)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /gotoveh [vehicle]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported to vehicle ID %d.", playerid, pname, vehicle);
- SendAdminMessage(0x46E850FF, string);
- GetVehiclePos(vehicle, X, Y, Z);
- SetPlayerPos(playerid, X, Y, Z);
- return 1;
- }
- CMD:getveh(playerid, params[])
- {
- new vehicle, string[128], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
- if(sscanf(params, "i", vehicle)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /getveh [vehicle]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported vehicle ID %d to themself.", playerid, pname, vehicle);
- SendAdminMessage(0x46E850FF, string);
- GetPlayerPos(playerid, X, Y, Z);
- SetVehiclePos(vehicle, X, Y, Z);
- return 1;
- }
- // Level two administrator commands
- CMD:setint(playerid, params[])
- {
- new targetid, interior, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, interior)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setint [player] [interior]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's interior to %d.", playerid, pname, targetid, tname, interior);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your interior to %d.", playerid, pname, interior);
- SendClientMessage(targetid, -1, string);
- SetPlayerInterior(playerid, interior);
- }
- return 1;
- }
- CMD:setvirtualworld(playerid, params[])
- {
- new targetid, interior, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, interior)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setvirtualworld [player] [virtualworld]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's virtual world to %d.", playerid, pname, targetid, tname, interior);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your virtual world to %d.", playerid, pname, interior);
- SendClientMessage(targetid, -1, string);
- SetPlayerVirtualWorld(playerid, interior);
- }
- return 1;
- }
- CMD:setskin(playerid, params[])
- {
- new targetid, skin, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, skin)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setskin [player] [skin]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's skin to ID %d.", playerid, pname, targetid, tname, skin);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your skin to ID %d.", playerid, pname, skin);
- SendClientMessage(targetid, -1, string);
- SetPlayerSkin(targetid, skin);
- }
- return 1;
- }
- CMD:sethealth(playerid, params[])
- {
- new targetid, amount, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /sethealth [player] [amount]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's health to %d.", playerid, pname, targetid, tname, amount);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your health to %d.", playerid, pname, amount);
- SendClientMessage(targetid, -1, string);
- SetPlayerHealth(targetid, amount);
- }
- return 1;
- }
- CMD:setarmor(playerid, params[])
- {
- new targetid, amount, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setarmor [player] [amount]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's armor to %d.", playerid, pname, targetid, tname, amount);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your armor to %d.", playerid, pname, amount);
- SendClientMessage(targetid, -1, string);
- SetPlayerArmour(targetid, amount);
- }
- return 1;
- }
- CMD:fillhealth(playerid, params[])
- {
- new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /fillhealth [player]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's armor to 100.", playerid, pname, targetid, tname);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your armor to 100.", playerid, pname);
- SendClientMessage(targetid, -1, string);
- SetPlayerHealth(targetid, 100);
- }
- return 1;
- }
- CMD:fillarmor(playerid, params[])
- {
- new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /fillarmor [player]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's armor to 100.", playerid, pname, targetid, tname);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your armor to 100.", playerid, pname);
- SendClientMessage(targetid, -1, string);
- SetPlayerArmour(targetid, 100);
- }
- return 1;
- }
- CMD:giveweapon(playerid, params[])
- {
- new targetid, weapon, ammo, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "uii", targetid, weapon, ammo)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /giveweapon [player] [weapon] [ammo]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- GivePlayerWeapon(targetid, weapon, ammo);
- format(string, sizeof(string), "ADMCMD: (%d) %s has just given (%d) %s a %s with %d ammo.", playerid, pname, targetid, tname, GunName[weapon], ammo);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just given you a %s with %d ammo.", playerid, pname, GunName[weapon], ammo);
- SendClientMessage(targetid, -1, string);
- }
- return 1;
- }
- CMD:givemask(playerid, params[])
- {
- new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /givemask [player]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just given (%d) %s a mask.", playerid, pname, targetid, tname);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just given you a mask.", playerid, pname);
- SendClientMessage(targetid, -1, string);
- pInfo[playerid][Mask] = 1;
- }
- return 1;
- }
- CMD:takemask(playerid, params[])
- {
- new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /takemask [player]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just taken (%d) %s's mask.", playerid, pname, targetid, tname);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just taken your mask.", playerid, pname);
- SendClientMessage(targetid, -1, string);
- pInfo[playerid][Mask] = 0;
- }
- return 1;
- }
- CMD:setmaskid(playerid, params[])
- {
- new targetid, input, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setmaskid [player] [mask ID]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's mask ID to %d.", playerid, pname, targetid, tname, input);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your mask ID to %d.", playerid, pname, input);
- SendClientMessage(targetid, -1, string);
- pInfo[playerid][MaskID] = input;
- }
- return 1;
- }
- CMD:setphonenr(playerid, params[])
- {
- new targetid, input, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setphonenr [player] [number]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's phone number to %d.", playerid, pname, targetid, tname, input);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your phone number to %d.", playerid, pname, input);
- SendClientMessage(targetid, -1, string);
- pInfo[playerid][PhoneNumber] = input;
- }
- return 1;
- }
- CMD:changegender(playerid, params[])
- {
- new targetid, input, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], holder[30];
- if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /changegender [player] [gender: 1 = male, 2 = female]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- if(input == 1) holder = "male";
- else if(input == 2) holder = "female";
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's gender to %s (I: %d).", playerid, pname, targetid, tname, holder, input);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your gender to %s (I: %d).", playerid, pname, holder, input);
- SendClientMessage(targetid, -1, string);
- pInfo[playerid][Gender] = input;
- }
- return 1;
- }
- CMD:setfaction(playerid, params[])
- {
- new targetid, input, tier, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "uii", targetid, input, tier)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setfaction [player] [faction] [tier]");
- if(input > 5) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} There are only five factions. Value can't be higher than five.");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- pInfo[playerid][Faction] = input; // before messages because GetFactionName
- pInfo[targetid][FactionTier] = tier;
- format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's faction to (I: %d) %s with tier %d.", playerid, pname, targetid, tname, input, GetFactionName(targetid), tier);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just set your faction to (I: %d) %s with tier %d.", playerid, pname, input, GetFactionName(targetid), tier);
- SendClientMessage(targetid, -1, string);
- }
- return 1;
- }
- CMD:givemoney(playerid, params[])
- {
- new targetid, money, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, money)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /givemoney [player] [money]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- GivePlayerMoney(playerid, money);
- format(string, sizeof(string), "ADMCMD: (%d) %s has just given (%d) %s $%d.", playerid, pname, targetid, tname, money);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just given you $%d.", playerid, pname, money);
- SendClientMessage(targetid, -1, string);
- }
- return 1;
- }
- CMD:takemoney(playerid, params[])
- {
- new targetid, money, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, money)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /takemoney [player] [money]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- GivePlayerMoney(playerid, -money);
- format(string, sizeof(string), "ADMCMD: (%d) %s has just fined (%d) %s $%d.", playerid, pname, targetid, tname, money);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s has just fined you $%d.", playerid, pname, money);
- SendClientMessage(targetid, -1, string);
- }
- return 1;
- }
- CMD:setmoney(playerid, params[])
- {
- new targetid, money, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
- if(sscanf(params, "ui", targetid, money)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setmoney [id/ime] [pari]");
- if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Ne ste administrator!");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Mora da bidete admin da dolznost za da ja koristite ovaa komanda!");
- if(pInfo[playerid][Admin] > 1)
- {
- GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, money);
- format(string, sizeof(string), "ADMCMD: (%d) %s gi namesti parite na (%d) %s $%d.", playerid, pname, targetid, tname, money);
- SendAdminMessage(0x46E850FF, string);
- format(string, sizeof(string), "Administrator (%d) %s samo sto vi gi namesti parite na $%d.", playerid, pname, money);
- SendClientMessage(targetid, -1, string);
- }
- return 1;
- }
- CMD:housegoto(playerid, params[])
- {
- new id;
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /housegoto [id]");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] > 1)
- {
- SetPlayerPos(playerid, hInfo[id][extX], hInfo[id][extY], hInfo[id][extZ]);
- }
- return 1;
- }
- CMD:bizgoto(playerid, params[])
- {
- new id;
- if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizgoto [id]");
- if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- if(pInfo[playerid][Admin] > 1)
- {
- SetPlayerPos(playerid, bInfo[id][extX], bInfo[id][extY], bInfo[id][extZ]);
- }
- return 1;
- }
- // Level three admin commands
- // admin
- // house
- CMD:housecreate(playerid, params[])
- {
- new Float: X, Float: Y, Float: Z, hlabel[128], h;
- GetPlayerPos(playerid, X, Y, Z);
- if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Ne ste administrator!");
- new INI:File = INI_Open(HousePath(h));
- INI_SetTag(File, "House Data");
- INI_WriteString(File, "Owner", "None");
- INI_WriteInt(File, "Price", 25000);
- INI_WriteInt(File, "Bought", 0);
- INI_WriteFloat(File, "extX", X);
- INI_WriteFloat(File, "extY", Y);
- INI_WriteFloat(File, "extZ", Z);
- INI_WriteFloat(File, "intX", 244.411987);
- INI_WriteFloat(File, "intY", 305.032989);
- INI_WriteFloat(File, "intZ", 999.148437);
- INI_WriteInt(File, "intVW", random(999));
- INI_WriteInt(File, "intW", 1);
- INI_Close(File);
- format(hlabel, 128, "[Kukja na prodazba]\n{46E850}[Owner]{FFFFFF}: None\n{46E850}[Price]{FFFFFF}: $25000");
- Create3DTextLabel(hlabel, 0xFFFFFFFF, X, Y, Z, 15.0, 0, 1);
- return 1;
- }
- CMD:housedelete(playerid, params[])
- {
- new hid, loc[30], string[128];
- if(sscanf(params, "i", hid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /housedelete [hid]");
- if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Ne ste administrator!");
- format(loc, 30, "Houses/%d.ini", hid);
- if(!fexist(loc)) SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nepostoi ID'ot od kukjata.");
- else if(fexist(loc))
- {
- format(string, sizeof(string), "SERVER:{FFFFFF} Ja izbrisavte kukjata so ID: %d", hid);
- SendClientMessage(playerid, 0x46E850FF, string);
- fremove(loc);
- }
- return 1;
- }
- CMD:housesellall(playerid, params[])
- {
- new string[25];
- format(string, 25, "None");
- if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Ne ste administrator!");
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- hInfo[i][Owner] = string;
- hInfo[i][Bought] = 0;
- pInfo[i][HouseOwner] = 9999;
- }
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You sold all houses!");
- ReloadLabels();
- return 1;
- }
- CMD:houseedit(playerid, params[])
- {
- new hid, interior, price, string[128];
- if(sscanf(params, "iii", hid, interior, price)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /houseedit [hid] [interior] [price]");
- if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- hInfo[hid][Price] = price;
- if(interior == 1) // Small
- {
- hInfo[hid][intX] = 244.411987;
- hInfo[hid][intY] = 305.032989;
- hInfo[hid][intZ] = 999.148437;
- hInfo[hid][intW] = 1;
- format(string, sizeof(string), "SERVER:{FFFFFF} ID: %d's interior changed to ID: 1 {46E850}(small){FFFFFF}.", hid);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- else if(interior == 2) // Average
- {
- hInfo[hid][intX] = 223.1329;
- hInfo[hid][intY] = 1287.0760;
- hInfo[hid][intZ] = 1082.1406;
- hInfo[hid][intW] = 1;
- format(string, sizeof(string), "SERVER:{FFFFFF} ID: %d's interior changed to ID: 2 {46E850}(average){FFFFFF}.", hid);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- else if(interior == 3) // Above Average
- {
- hInfo[hid][intX] = 327.97980;
- hInfo[hid][intY] = 1478.0880;
- hInfo[hid][intZ] = 1084.4375;
- hInfo[hid][intW] = 15;
- format(string, sizeof(string), "SERVER:{FFFFFF} ID: %d's interior changed to ID: 3 {46E850}(above average){FFFFFF}.", hid);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- else if(interior == 4) // Luxury
- {
- hInfo[hid][intX] = 446.9538;
- hInfo[hid][intY] = 1397.5261;
- hInfo[hid][intZ] = 1084.3047;
- hInfo[hid][intW] = 2;
- format(string, sizeof(string), "SERVER:{FFFFFF} ID: %d's interior changed to ID: 4 {46E850}(luxury){FFFFFF}.", hid);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- ReloadLabels();
- return 1;
- }
- //biz
- CMD:bizaname(playerid, params[])
- {
- new str1[128], bid, name[45];
- if(sscanf(params, "is[45]", bid, name)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizaname [name]");
- bInfo[bid][Name] = name;
- format(str1, sizeof(str1), "SERVER:{FFFFFF} You have set business ID: %d's name to %s.", bid, name);
- SendClientMessage(playerid, 0x46E850FF, str1);
- ReloadLabels();
- return 1;
- }
- CMD:bizcreate(playerid, params[])
- {
- new Float: X, Float: Y, Float: Z, blabel[128], b;
- GetPlayerPos(playerid, X, Y, Z);
- if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- new INI:File = INI_Open(BizPath(b));
- INI_SetTag(File, "Business Data");
- INI_WriteString(File, "Name", "None");
- INI_WriteString(File, "Owner", "None");
- INI_WriteInt(File, "Price", 150000);
- INI_WriteInt(File, "Bought", 0);
- INI_WriteInt(File, "Locked", 0);
- INI_WriteInt(File, "Fee", 0);
- INI_WriteInt(File, "Till", 0);
- INI_WriteInt(File, "IntSet", 0);
- INI_WriteFloat(File, "extX", X);
- INI_WriteFloat(File, "extY", Y);
- INI_WriteFloat(File, "extZ", Z);
- INI_WriteFloat(File, "intX", 2131.507812);
- INI_WriteFloat(File, "intY", 1600.818481);
- INI_WriteFloat(File, "intZ", 1008.359375);
- INI_WriteInt(File, "intVW", random(999));
- INI_WriteInt(File, "intW", 1);
- INI_Close(File);
- format(blabel, 128, "[BUSINESS: FOR SALE]\n{46E850}[Owner]{FFFFFF}: None\n{46E850}[Price]{FFFFFF}: $25000");
- Create3DTextLabel(blabel, 0xFFFFFF, X, Y, Z, 15.0, 0, 1);
- return 1;
- }
- CMD:bizdelete(playerid, params[])
- {
- new bid, loc[30], string[128];
- if(sscanf(params, "i", bid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizdelete [bid]");
- if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- format(loc, 30, "Businesses/%d.ini", bid);
- if(!fexist(loc)) SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} The business ID you entered doesn't exist.");
- else if(fexist(loc))
- {
- format(string, sizeof(string), "SERVER:{FFFFFF} You have deleted business ID: %d", bid);
- SendClientMessage(playerid, 0x46E850FF, string);
- fremove(loc);
- }
- return 1;
- }
- CMD:reloadbizzes(playerid, params[])
- {
- new string[128], pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
- ReloadLabels();
- format(string, sizeof(string), "SERVER:{FFFFFF} All businesses have been reloaded by administrator %s (%d)!", pname, playerid);
- SendClientMessageToAll(0x46E850FF, string);
- return 1;
- }
- forward LoadUser_data(playerid, name[], value[]);
- public LoadUser_data(playerid, name[], value[])
- {
- INI_Int("Password", pInfo[playerid][Pass]);
- INI_Int("Admin", pInfo[playerid][Admin]);
- INI_Int("Level", pInfo[playerid][Level]);
- INI_Int("Skin", pInfo[playerid][Skin]);
- INI_Int("Exp", pInfo[playerid][Exp]);
- INI_Int("CurExp", pInfo[playerid][CurExp]);
- INI_Int("Gender", pInfo[playerid][Gender]);
- INI_Int("Registered", pInfo[playerid][Registered]);
- INI_Float("Armour", pInfo[playerid][Armour]);
- INI_Float("Health", pInfo[playerid][Health]);
- INI_Int("HandMoney", pInfo[playerid][HandMoney]);
- INI_Int("BankMoney", pInfo[playerid][BankMoney]);
- INI_Int("Faction", pInfo[playerid][Faction]);
- INI_Int("FactionTier", pInfo[playerid][FactionTier]);
- INI_String("FactionRank", pInfo[playerid][FactionRank], 128);
- INI_Int("Weapon1", pInfo[playerid][Weapon1]);
- INI_Int("Wep1Ammo", pInfo[playerid][Wep1Ammo]);
- INI_Int("Weapon2", pInfo[playerid][Weapon2]);
- INI_Int("Wep2Ammo", pInfo[playerid][Wep2Ammo]);
- INI_Int("Weapon3", pInfo[playerid][Weapon3]);
- INI_Int("Wep3Ammo", pInfo[playerid][Wep3Ammo]);
- INI_Int("Weapon4", pInfo[playerid][Weapon4]);
- INI_Int("Wep4Ammo", pInfo[playerid][Wep4Ammo]);
- INI_Int("Weapon5", pInfo[playerid][Weapon5]);
- INI_Int("Wep5Ammo", pInfo[playerid][Wep5Ammo]);
- INI_Int("Mask", pInfo[playerid][Mask]);
- INI_Int("MaskID", pInfo[playerid][MaskID]);
- INI_Int("PhoneNumber", pInfo[playerid][PhoneNumber]);
- INI_Int("HouseOwner", pInfo[playerid][HouseOwner]);
- INI_Int("VehicleOwner", pInfo[playerid][VehicleOwner]);
- INI_Int("BizOwner", pInfo[playerid][BizOwner]);
- INI_Int("lvDay", pInfo[playerid][lvDay]);
- INI_Int("lvMonth", pInfo[playerid][lvMonth]);
- INI_Int("lvYear", pInfo[playerid][lvYear]);
- INI_Int("lvHour", pInfo[playerid][lvHour]);
- INI_Int("lvMinute", pInfo[playerid][lvMinute]);
- INI_Int("lvSecond", pInfo[playerid][lvSecond]);
- INI_Int("LastPos", pInfo[playerid][LastPos]);
- INI_Int("LastInt", pInfo[playerid][LastInt]);
- INI_Int("LastVW", pInfo[playerid][LastVW]);
- INI_Float("LastX", pInfo[playerid][LastX]);
- INI_Float("LastY", pInfo[playerid][LastY]);
- INI_Float("LastZ", pInfo[playerid][LastZ]);
- return 1;
- }
- stock SendNearbyMessage(playerid, color, string[], Float: range)
- { // Mione
- new Float: X, Float: Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(IsPlayerInRangeOfPoint(i, range, X, Y, Z))
- {
- SendClientMessage(i, color, string);
- }
- }
- return 1;
- }
- stock SendAdminMessage(col, string[])
- {
- // Mione
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(pInfo[i][Admin] > 0)
- SendClientMessage(i, col, string);
- }
- return 1;
- }
- stock GetFactionChat(playerid, factionid)
- {
- new value;
- factionid = pInfo[playerid][Faction];
- if(factionid == 1)
- {
- if(FactionChat[factionid] == 0) value = 0;
- else if(FactionChat[factionid] == 1) value = 2;
- }
- return value;
- }
- stock SendFactionMessage(factionid, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(pInfo[i][Faction] == factionid)
- {
- SendClientMessage(i, 0xFFFFFAA, string);
- printf(string); // logging purposes
- }
- }
- return 1;
- }
- stock TowFactionVehicles(factionid)
- {
- if(factionid == 1)
- {
- for(new i = 0; i < 6; i++)
- {
- SetVehicleToRespawn(LEOveh[i]);
- }
- }
- else if(factionid == 2)
- {
- for(new i = 0; i < 5; i++)
- {
- SetVehicleToRespawn(EMSveh[i]);
- }
- }
- else if(factionid == 3)
- {
- for(new i = 0; i < 5; i++)
- {
- SetVehicleToRespawn(SANAveh[i]);
- }
- }
- return 1;
- }
- stock GetFactionName(playerid)
- {
- new name[30];
- if(pInfo[playerid][Faction] == 0)
- name = "Civilian";
- else if(pInfo[playerid][Faction] == 1)
- name = "Law Enforcement Officials";
- else if(pInfo[playerid][Faction] == 2)
- name = "Emergency Medical Services";
- else if(pInfo[playerid][Faction] == 3)
- name = "Empty Faction";
- else if(pInfo[playerid][Faction] == 4)
- name = "Empty Faction";
- else if(pInfo[playerid][Faction] == 5)
- name = "Empty Faction";
- return name;
- }
- stock UserPath(playerid)
- {
- new string[128], playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(string, sizeof(string), "/Players/%s.ini", playername);
- return string;
- }
- stock udb_hash(buf[])
- { // Dracoblue
- new length = strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n= 0; n < length; n ++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- stock SaveHouses()
- {
- new file[64];
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- format(file, 64, "Houses/%d.ini", h);
- if(fexist(file))
- {
- new INI:File = INI_Open(file);
- INI_SetTag(File, "House Data");
- INI_WriteString(File, "Owner", hInfo[h][Owner]);
- INI_WriteInt(File, "Price", hInfo[h][Price]);
- INI_WriteInt(File, "Bought", hInfo[h][Bought]);
- INI_WriteFloat(File, "extX", hInfo[h][extX]);
- INI_WriteFloat(File, "extY", hInfo[h][extY]);
- INI_WriteFloat(File, "extZ", hInfo[h][extZ]);
- INI_WriteFloat(File, "intX", hInfo[h][intX]);
- INI_WriteFloat(File, "intY", hInfo[h][intY]);
- INI_WriteFloat(File, "intZ", hInfo[h][intZ]);
- INI_WriteInt(File, "intVW", hInfo[h][intVW]);
- INI_WriteInt(File, "intW", hInfo[h][intW]);
- INI_WriteInt(File, "Locked", hInfo[h][Locked]);
- INI_Close(File);
- }
- }
- return 1;
- }
- stock LoadHouses()
- {
- new hlabel[128], file[64], s[64], count;
- print("\n Loading Houses: \n");
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- format(file, 64, "Houses/%d.ini", h);
- if(fexist(file))
- {
- INI_ParseFile(HousePath(h), "LoadHouseData", false, true, h, true, false );
- format(hlabel, 128, "[HOUSE]\n{46E850}[Owner]{FFFFFF}: %s\n{46E850}[Price]{FFFFFF}: %d", hInfo[h][Owner], hInfo[h][Price]);
- Create3DTextLabel(hlabel, 0xFFFFFF, hInfo[h][extX], hInfo[h][extY], hInfo[h][extZ], 15.0, 0, 1);
- format(s, 64, " [!!] Loaded house ID: %d at %f %f %f", h, hInfo[h][extX], hInfo[h][extY], hInfo[h][extZ]);
- printf(s);
- count++;
- }
- }
- printf("\n %d houses loaded!", count);
- return 1;
- }
- stock ReloadLabels()
- {
- for(new i = 0; i < 100; i++)
- {
- Delete3DTextLabel(Text3D: i);
- }
- Create3DTextLabel("Vehicle Dealership\n/carbuy, /bikebuy, /carregister", 0xADDBDBFF, 168.6218, -49.5795, 1.5781, 25.0, 0, 1);
- Create3DTextLabel("24/7 MARKET \n/buy", 0xADDBDBFF, 254.4757,-63.5021,1.5781, 25.0, 0, 1);
- Create3DTextLabel("/buy", 0xADDBDBFF, 252.0834,-56.3722,1.5703, 25.0, 0, 1);
- Create3DTextLabel("Fishing Point\n{FFFFFF}/rentrod\n/returnrod\n/sellfish", 0xADDBDBFF, 382.7930, -260.5501, 1.6535, 25.0, 0, 1);
- Create3DTextLabel("Fishing Point\n{FFFFFF}/fish", 0xADDBDBFF, 373.4215, -275.4926, 1.0578, 25.0, 0, 1);
- Create3DTextLabel("Fishing Point\n{FFFFFF}/fish", 0xADDBDBFF, 386.2177, -267.5155, 1.0633, 25.0, 0, 1);
- Create3DTextLabel("Fishing Point\n{FFFFFF}/fish", 0xADDBDBFF, 356.2553, -286.0096, 1.4032, 25.0, 0, 1);
- Create3DTextLabel("Police Station", 0xADDBDBFF, -1716.2312, 1018.1048, 17.5859, 25.0, 0, 1);
- Create3DTextLabel("Police Station", 0xADDBDBFF, 322.1928, 317.6448, 999.1484, 25.0, 0, 1);
- Create3DTextLabel("Police Station", 0xADDBDBFF, 207.8708, -61.6880, 1.9766, 25.0, 0, 1);
- Create3DTextLabel("Police Station", 0xADDBDBFF, 322.197998, 302.497985, 999.148437, 25.0, 0, 1);
- Create3DTextLabel("Health Station", 0xADDBDBFF, 43.6618, -188.0078, 2.2442, 25.0, 0, 1);
- Create3DTextLabel("Health Station", 0xADDBDBFF, 54.2550, -190.9127, 1.6579, 25.0, 0, 1);
- Create3DTextLabel("Health Station", 0xADDBDBFF, -204.4846, -1735.8840, 675.7687, 25.0, 0, 1);
- Create3DTextLabel("Health Station", 0xADDBDBFF, 326.4513, -1492.8029, 24.9219, 25.0, 0, 1);
- Create3DTextLabel("Local Bank", 0xADDBDBFF, 273.1700, -195.5689, 1.5705, 25.0, 0, 1);
- Create3DTextLabel("Local Bank", 0xADDBDBFF, 2305.1003, -16.2768, 26.7422, 25.0, 0, 1);
- Create3DTextLabel("Local Bank\n{FFFFFF}/deposit | /withdraw", 0xADDBDBFF, 2316.5581, -11.3381, 26.7422, 25.0, 0, 1);
- Create3DTextLabel("Barrier\n{FFFFFF}If the barrier doesn't open, please exit your car and press ~k~~CONVERSATION_YES~ here.", 0xADDBDBFF, -1739.5716, 985.0, 17.8529, 25.0, 0, 1);
- Create3DTextLabel("Enter Garage\n{FFFFFF}/pass", 0xADDBDBFF, 210.8901, -33.2288, 1.5781, 25.0, 0, 1);
- Create3DTextLabel("Exit Garage\n{FFFFFF}/pass", 0xADDBDBFF, -1777.1486, 968.5923, 24.7344, 25.0, 0, 1);
- Create3DTextLabel("Exit Garage\n{FFFFFF}/pass", 0xADDBDBFF, -1777.6991, 997.2271, 24.7344, 25.0, 0, 1);
- Create3DTextLabel("Enter Garage\n{FFFFFF}/pass", 0xADDBDBFF, 58.8201, -195.7375, 1.6446, 25.0, 0, 1);
- Create3DTextLabel("Enter Garage\n{FFFFFF}/pass", 0xADDBDBFF, 318.6588, -1491.4716, 24.5918, 25.0, 0, 1);
- LoadHouses();
- LoadBizzes();
- return 1;
- }
- forward LoadHouseData(h, name[], value[]);
- public LoadHouseData(h, name[], value[])
- {
- INI_String("Owner", hInfo[h][Owner], 32);
- INI_Int("Price", hInfo[h][Price]);
- INI_Int("Bought", hInfo[h][Bought]);
- INI_Float("extX", hInfo[h][extX]);
- INI_Float("extY", hInfo[h][extY]);
- INI_Float("extZ", hInfo[h][extZ]);
- INI_Float("intX", hInfo[h][intX]);
- INI_Float("intY", hInfo[h][intY]);
- INI_Float("intZ", hInfo[h][intZ]);
- INI_Int("intVW", hInfo[h][intVW]);
- INI_Int("intW", hInfo[h][intW]);
- INI_Int("Locked", hInfo[h][Locked]);
- return 1;
- }
- stock HousePath(h)
- {
- new house[64], hid = h;
- hid = hIDInfo[hID] +1;
- format(house, 30, "Houses/%d.ini", hid);
- hIDInfo[hID] ++; // multiplying
- return house;
- }
- stock RegisterFix(playerid)
- {
- new string[30];
- if(pInfo[playerid][Gender] == 0) ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Gender", "Male\nFemale", "Select", "Select");
- if(pInfo[playerid][MaskID] == 0) pInfo[playerid][MaskID] = random(99999);
- if(pInfo[playerid][PhoneNumber] == 0) pInfo[playerid][PhoneNumber] = random(99999);
- if(pInfo[playerid][Level] == 0) pInfo[playerid][Level] = 1;
- if(pInfo[playerid][FactionTier] == 0) pInfo[playerid][FactionTier] = 3;
- if(pInfo[playerid][HouseOwner] == 0) pInfo[playerid][HouseOwner] = 9999;
- if(pInfo[playerid][VehicleOwner] == 0) pInfo[playerid][VehicleOwner] = 9999;
- if(pInfo[playerid][BizOwner] == 0) pInfo[playerid][BizOwner] = 9999;
- if(pInfo[playerid][HandMoney] == 0) GivePlayerMoney(playerid, 250);
- if(pInfo[playerid][BankMoney] == 0) pInfo[playerid][BankMoney] = 5000;
- if(pInfo[playerid][Health] == 0) pInfo[playerid][Health] = 100;
- if(pInfo[playerid][Exp] == 0) pInfo[playerid][Exp] = 8;
- format(string, 128, "None");
- pInfo[playerid][FactionRank] = string;
- pInfo[playerid][Registered] = 1;
- return 1;
- }
- stock CreatePlayerVehicle(playerid, model)
- {
- new pname[30], file[64], playercar, v;
- GetPlayerName(playerid, pname, sizeof(pname));
- playercar = CreateVehicle(model, 170.8668, -16.1531, 1.5781, 220.7102, random(5), random(5), -1);
- PutPlayerInVehicle(playerid, playercar, 0);
- new INI:File = INI_Open(VehiclePath(v));
- vInfo[playercar][ModelID] = model;
- vInfo[playercar][NrPlate] = "BB-0000";
- vInfo[playercar][Owner] = pname;
- vInfo[playercar][posX] = 170.8668;
- vInfo[playercar][posY] = -16.1531;
- vInfo[playercar][posZ] = 1.5781;
- vInfo[playercar][posA] = 220.7102;
- vInfo[playercar][ColorA] = random(5);
- vInfo[playercar][ColorB] = random(5);
- vInfo[playercar][Locked] = 1;
- vInfo[playercar][Faction] = 0;
- INI_Close(File);
- format(file, 64, "Vehicles/%d.ini", v);
- if(fexist(file))
- {
- INI_ParseFile(VehiclePath(v), "LoadVehicleData", false, true, v, true, false );
- }
- SaveVehicles();
- pInfo[playerid][VehicleOwner] = playercar;
- vEngine[playercar] = 1;
- return 1;
- }
- stock SaveVehicles()
- {
- new file[64];
- for(new v = 0; v < MAX_CARS; v ++)
- {
- format(file, 64, "Vehicles/%d.ini", v);
- if(fexist(file))
- {
- new INI:File = INI_Open(file);
- INI_SetTag(File, "Vehicle Data");
- INI_WriteInt(File, "ModelID", vInfo[v][ModelID]);
- INI_WriteString(File, "Owner", vInfo[v][Owner]);
- INI_WriteString(File, "NrPlate", vInfo[v][NrPlate]);
- INI_WriteFloat(File, "posX", vInfo[v][posX]);
- INI_WriteFloat(File, "posY", vInfo[v][posY]);
- INI_WriteFloat(File, "posZ", vInfo[v][posZ]);
- INI_WriteFloat(File, "posA", vInfo[v][posA]);
- INI_WriteInt(File, "ColorA", vInfo[v][ColorA]);
- INI_WriteInt(File, "ColorB", vInfo[v][ColorB]);
- INI_WriteInt(File, "Locked", vInfo[v][Locked]);
- INI_WriteInt(File, "Faction", vInfo[v][Faction]);
- INI_Close(File);
- }
- }
- return 1;
- }
- stock LoadVehicles()
- {
- new file[64], s[64], count;
- print("\n Loading vehicles: \n");
- for(new v = 0; v < MAX_CARS; v ++)
- {
- format(file, 64, "Vehicles/%d.ini", v);
- if(fexist(file))
- {
- INI_ParseFile(VehiclePath(v), "LoadVehicleData", false, true, v, true, false );
- CreateVehicle(vInfo[v][ModelID], vInfo[v][posX], vInfo[v][posY], vInfo[v][posZ], vInfo[v][posA], vInfo[v][ColorA], vInfo[v][ColorB], -1);
- SetVehicleNumberPlate(v, vInfo[v][NrPlate]);
- SetVehicleParamsForPlayer(v, v, 0, 1);
- SetVehicleToRespawn(v); // numberplate
- format(s, 64, " [!!] Loaded Vehicle ID: %d at %f %f %f", v, vInfo[v][posX], vInfo[v][posY], vInfo[v][posZ]);
- printf(s);
- count++;
- }
- }
- printf("\n %d vehicles loaded!", count);
- return 1;
- }
- forward LoadVehicleData(v, name[], value[]);
- public LoadVehicleData(v, name[], value[])
- {
- INI_String("Owner", vInfo[v][Owner], 31);
- INI_Int("ModelID", vInfo[v][ModelID]);
- INI_String("NrPlate", vInfo[v][NrPlate], 8);
- INI_Float("posX", vInfo[v][posX]);
- INI_Float("posY", vInfo[v][posY]);
- INI_Float("posZ", vInfo[v][posZ]);
- INI_Float("posA", vInfo[v][posA]);
- INI_Int("ColorA", vInfo[v][ColorA]);
- INI_Int("ColorB", vInfo[v][ColorB]);
- INI_Int("Locked", vInfo[v][Locked]);
- INI_Int("Faction", vInfo[v][Faction]);
- return 1;
- }
- stock VehiclePath(v)
- {
- new vehicle[64], vid = v;
- vid = vIDInfo[vID] +1;
- format(vehicle, 30, "Vehicles/%d.ini", vid);
- vIDInfo[vID] ++; // multiplying
- return vehicle;
- }
- stock SaveBizzes()
- {
- new file[64];
- for(new b = 0; b < MAX_BUSINESSES; b++)
- {
- format(file, 64, "Businesses/%d.ini", b);
- if(fexist(file))
- {
- new INI:File = INI_Open(file);
- INI_SetTag(File, "Business Data");
- INI_WriteString(File, "Name", bInfo[b][Name]);
- INI_WriteString(File, "Owner", bInfo[b][Owner]);
- INI_WriteInt(File, "Price", bInfo[b][Price]);
- INI_WriteInt(File, "Bought", bInfo[b][Bought]);
- INI_WriteInt(File, "Locked", bInfo[b][Bought]);
- INI_WriteInt(File, "Fee", bInfo[b][Fee]);
- INI_WriteInt(File, "Till", bInfo[b][Till]);
- INI_WriteInt(File, "IntSet", bInfo[b][IntSet]);
- INI_WriteFloat(File, "extX", bInfo[b][extX]);
- INI_WriteFloat(File, "extY", bInfo[b][extY]);
- INI_WriteFloat(File, "extZ", bInfo[b][extZ]);
- INI_WriteFloat(File, "intX", bInfo[b][intX]);
- INI_WriteFloat(File, "intY", bInfo[b][intY]);
- INI_WriteFloat(File, "intZ", bInfo[b][intZ]);
- INI_WriteInt(File, "intVW", bInfo[b][intVW]);
- INI_WriteInt(File, "intW", bInfo[b][intW]);
- INI_Close(File);
- }
- }
- return 1;
- }
- stock LoadBizzes()
- {
- new blabel[256], file[64], s[64], count;
- print("\n Loading Businesses: \n");
- for(new b = 0; b < MAX_BUSINESSES; b++)
- {
- format(file, 64, "Businesses/%d.ini", b);
- if(fexist(file))
- {
- INI_ParseFile(BizPath(b), "LoadBizData", false, true, b, true, false );
- format(blabel, 256, "[BUSINESS]\n{46E850}[Name]{FFFFFF}: %s\n{46E850}[Owner]{FFFFFF}: %s\n{46E850}[Entry]{FFFFFF}: $%d\n{46E850}[Price]{FFFFFF}: $%d", bInfo[b][Name], bInfo[b][Owner], bInfo[b][Fee], bInfo[b][Price]);
- Create3DTextLabel(blabel, 0xFFFFFF, bInfo[b][extX], bInfo[b][extY], bInfo[b][extZ], 15.0, 0, 1);
- format(s, 64, " [!!] Loaded business ID: %d at %f %f %f", b, bInfo[b][extX], bInfo[b][extY], bInfo[b][extZ]);
- printf(s);
- count++;
- }
- }
- printf("\n %d businesses loaded!", count);
- return 1;
- }
- forward LoadBizData(b, name[], value[]);
- public LoadBizData(b, name[], value[])
- {
- INI_String("Name", bInfo[b][Name], 45);
- INI_String("Owner", bInfo[b][Owner], 32);
- INI_Int("Price", bInfo[b][Price]);
- INI_Int("Bought", bInfo[b][Bought]);
- INI_Int("Fee", bInfo[b][Fee]);
- INI_Int("Till", bInfo[b][Till]);
- INI_Int("IntSet", bInfo[b][IntSet]);
- INI_Float("extX", bInfo[b][extX]);
- INI_Float("extY", bInfo[b][extY]);
- INI_Float("extZ", bInfo[b][extZ]);
- INI_Float("intX", bInfo[b][intX]);
- INI_Float("intY", bInfo[b][intY]);
- INI_Float("intZ", bInfo[b][intZ]);
- INI_Int("intVW", bInfo[b][intVW]);
- INI_Int("intW", bInfo[b][intW]);
- return 1;
- }
- stock BizPath(b)
- {
- new biz[64], bid = b;
- bid = bIDInfo[bID] +1;
- format(biz, 30, "Businesses/%d.ini", bid);
- bIDInfo[bID] ++; // multiplying
- return biz;
- }
- forward Float: GetVehicleSpeed(vehicleid);
- public Float: GetVehicleSpeed(vehicleid)
- {
- new Float:Vel[3];
- GetVehicleVelocity(vehicleid, Vel[0], Vel[1], Vel[2]);
- Vel[0] *= 175;
- Vel[1] *= 175;
- Vel[2] *= 175;
- return Float: VectorSize(Vel[0], Vel[1], Vel[2]);
- }
- forward StartEngine(playerid, vehicleid);
- public StartEngine(playerid, vehicleid)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(vEngine[vehicleid] == 2)
- {
- SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have turned the vehicle's engine on!");
- vEngine[vehicleid] = 1;
- }
- else if(vEngine[vehicleid] == 1)
- {
- SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have turned the vehicle's engine off!");
- vEngine[vehicleid] = 0;
- }
- }
- return 1;
- }
- stock GetVehicleEngine(vehicleid)
- {
- new engine[10];
- if(vEngine[vehicleid] == 1) engine = "~g~On";
- else if(vEngine[vehicleid] == 0) engine = "~r~Off";
- else if(vEngine[vehicleid] == 2) engine = "~y~Srt";
- return engine;
- }
- forward FishingCooldown(playerid);
- public FishingCooldown(playerid)
- {
- new str[80];
- if(fishtimervalue[playerid] > 0)
- {
- fishtimervalue[playerid] -= 1;
- format(str, sizeof(str), "~w~Time left: ~r~%d", fishtimervalue);
- GameTextForPlayer(playerid, str, 1000, 3);
- }
- else if(fishtimervalue[playerid] == 0)
- {
- KillTimer(fishtimer[playerid]);
- FishRandomCatch(playerid);
- TogglePlayerControllable(playerid, true);
- }
- return 1;
- }
- stock FishRandomCatch(playerid)
- {
- new randlbs = random(15), str[128];
- if(randlbs == 0) randlbs = random(5); // bug fix
- switch(random(5))
- {
- case 0: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught some {FFBB00}trout{FFFFFF}! (lbs: %d - {FFBB00}/checkfish{FFFFFF})", randlbs);
- case 1: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught some {FFBB00}tuna{FFFFFF}! (lbs: %d - {FFBB00}/checkfish{FFFFFF})", randlbs);
- case 2: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught some {FFBB00}shrimp{FFFFFF}! (lbs: %d - {FFBB00}/checkfish{FFFFFF})", randlbs);
- case 3: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught some {FFBB00}salmon{FFFFFF}! (lbs: %d - {FFBB00}/checkfish{FFFFFF})", randlbs);
- case 4: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught nothing!"), randlbs = 0; // format for bug fix, lbs = 0 to avoid lbs being added
- }
- pCarryingFish[playerid] += randlbs;
- SendClientMessage(playerid, 0x46E850FF, str);
- return 1;
- }
- forward PlayerDeathMode(playerid);
- public PlayerDeathMode(playerid)
- {
- ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 0, 0, 1, 0, 1);
- SetPlayerColor(playerid, 0xE83A46FF);
- pDeathModeTimer[playerid] = SetTimer("PlayerDeathModeWait", 1250, true);
- pDeathModeWait[playerid] = 320;
- pDeathMode[playerid] = 1;
- return 1;
- }
- forward PlayerDeathModeWait(playerid);
- public PlayerDeathModeWait(playerid)
- {
- new string[128];
- if(pDeathModeWait[playerid] == 0)
- {
- if(pDeathMode[playerid] == 1)
- {
- KillTimer(pDeathModeTimer[playerid]);
- SetPlayerHealth(playerid, 0);
- SendClientMessage(playerid, -1, "You have died.");
- GivePlayerMoney(playerid, -500);
- }
- }
- else if(pDeathModeWait[playerid] > 0)
- {
- pDeathModeWait[playerid] -= 1;
- format(string, sizeof(string), "~w~Time left: ~r~%d", pDeathModeWait[playerid]);
- GameTextForPlayer(playerid, string, 1000, 4);
- }
- return 1;
- }
- forward LevelTimer(playerid);
- public LevelTimer(playerid)
- {
- new string[128], oldmoney = pInfo[playerid][BankMoney];
- if(pInfo[playerid][CurExp] != pInfo[playerid][Exp])
- {
- pInfo[playerid][CurExp] += 1;
- pInfo[playerid][BankMoney] += 450;
- SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Bank Balance Receipt: {60B34B}$450 added{FFFFFF} to bank account!");
- format(string, sizeof(string), "SERVER:{FFFFFF} {D9D9D9}[Old Amount:{FFBB00} %d{D9D9D9}] [New Amount:{60B34B} %d{D9D9D9}]", oldmoney, pInfo[playerid][BankMoney]);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} Level progression: {BF4B4B}%d{FFFFFF}/{60B34B}%d{FFFFFF}. Next payday in 30 minutes.", pInfo[playerid][CurExp], pInfo[playerid][Exp]);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- else if(pInfo[playerid][CurExp] == pInfo[playerid][Exp])
- {
- pInfo[playerid][CurExp] = 0;
- pInfo[playerid][Exp] += 8;
- pInfo[playerid][Level] += 1;
- format(string, sizeof(string), "SERVER:{FFFFFF} You have leveled up! New level: {FFBB00}%d{FFFFFF}!", pInfo[playerid][Level]);
- SendClientMessage(playerid, 0x46E850FF, string);
- format(string, sizeof(string), "SERVER:{FFFFFF} Experience necessities upgraded: {BF4B4B}%d{FFFFFF}/{FFBB00}%d{FFFFFF}.", pInfo[playerid][CurExp], pInfo[playerid][Exp]);
- SendClientMessage(playerid, 0x46E850FF, string);
- }
- return 1;
- }
- PreloadAnimLib(playerid, animlib[]) ApplyAnimation(playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0);
Here :)