Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*//==================================//
- ---------- GAME WARFARE ROLEPLAY --------
- Work started on October 1, 2013 at 9:50 PM Central time
- :::LICENSE
- Copyright 2013 GameWarfare Servers
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */////////////////////////////////////////
- #include <a_samp>
- #include <foreach>
- #include <sscanf2>
- #include <zcmd>
- #include <YSI\y_ini>
- #include <LBYC\LB_TDBox>
- #include <Zones>
- #include <streamer>
- #define MAX_HOUSES 75000
- #define MAX_ZONE 365
- #define MAX_HOUSES_IN_ZONE 500
- #define INFINITE (Float:0x7F800000)
- enum PlayerInfo
- {
- Name,
- Password,
- Money,
- MoneyInBank,
- TimesArrested,
- TimesFined,
- TimesWarned,
- TimesKicked,
- TimesJailed,
- Skin,
- PhoneNumber,
- CarsSold,
- MoneyEarnedFromSoldCars,
- CarNameInSlot1[100],
- CarNameInSlot2[100],
- CarNameInSlot3[100],
- CarNameInSlot4[100],
- CarNameInSlot5[100],
- CarNameInVIPSlot6[100],
- CarNameInVIPSlot7[100],
- CarNameInVIPSlot8[100],
- CarNameInVIPSlot9[100],
- CarNameInVIPSlot10[100],
- HouseIDInSlot1,
- HouseIDInSlot2,
- HouseIDInSlot3,
- HouseIDInVIPSlot4,
- HouseIDInVIPSlot5,
- HouseIDInVIPSlot6,
- HouseIDInVIPSlot7,
- BusinessIDInSlot1,
- BusinessIDInSlot2,
- BusinessIDInVIPSlot3,
- BusinessIDInVIPSlot4,
- BusinessIDInVIPSlot5,
- VIP,
- Admin,
- Kills,
- Deaths,
- InTaxiCompany,
- InSANewsCompany,
- Governor,
- President,
- SecretaryOfState,
- SecretaryOfTheTreasury,
- SecretaryOfDefense,
- AttorneyGeneral,
- SecretaryOfTheInterior,
- SecretaryOfAgriculture,
- SecretaryOfCommerce,
- SecretaryOfLabor,
- SecretaryOfTransportation,
- SecretaryOfEnergy,
- SecretaryOfEducation,
- SecretaryOfVeteransAffairs,
- SecretaryOfHomelandSecurity,
- VicePresident,
- PoliceRank,
- SANGRank,
- SAFMDRank,
- SANewsRank,
- TaxiRank,
- SASDRank,
- SAPDRank,
- GroveRank,
- BallasRank,
- InGrove,
- InBallas,
- PoliceTR,
- InPolice,
- InFBI,
- InSWAT,
- InSANG,
- InSASD,
- InGovernment,
- Helper,
- Float:Slot1CarXPos,
- Float:Slot1CarYPos,
- Float:Slot1CarZPos,
- Float:Slot2CarXPos,
- Float:Slot2CarYPos,
- Float:Slot2CarZPos,
- Float:Slot3CarXPos,
- Float:Slot3CarYPos,
- Float:Slot3CarZPos,
- Float:Slot4CarXPos,
- Float:Slot4CarYPos,
- Float:Slot4CarZPos,
- Float:Slot5CarXPos,
- Float:Slot5CarYPos,
- Float:Slot5CarZPos,
- Float:Slot6CarXPos,
- Float:Slot6CarYPos,
- Float:Slot6CarZPos,
- Float:Slot7CarXPos,
- Float:Slot7CarYPos,
- Float:Slot7CarZPos,
- Float:Slot8CarXPos,
- Float:Slot8CarYPos,
- Float:Slot8CarZPos,
- Float:Slot9CarXPos,
- Float:Slot9CarYPos,
- Float:Slot9CarZPos,
- Float:Slot10CarXPos,
- Float:Slot10CarYPos,
- Float:Slot10CarZPos,
- CarsSoldToDocks,
- SpeakInNewbieChannel,
- Level,
- Points,
- Float:XPos,
- Float:YPos,
- Float:ZPos,
- Float:Health,
- Float:Armor,
- Banned,
- InSAFMD,
- Age,
- Orgin,
- Gender,
- Accent,
- CurrentWarnings,
- IP[16],
- InHouse,
- HousesOwned[2],
- VIPHousesOwned[3],
- CurrentZone[MAX_ZONE_NAME],
- bool:Dead
- }
- enum HouseInfo
- {
- HouseAddress[128],
- Float:HouseX,
- Float:HouseY,
- Float:HouseZ,
- bool:Owned,
- Price,
- HouseOwner[24],
- Interior,
- Float:IntX,
- Float:IntY,
- Float:IntZ,
- bool:Locked,
- bool:HousePickup,
- Text3D:DoorTextID,
- DoorText[128],
- HouseName[75],
- DoorPickup,
- bool:Buyable
- }
- enum ZoneInfo
- {
- HousesInZone
- }
- enum ServerInfo
- {
- Tax,
- MOTD,
- PlayersOnline,
- bool:GangSlot1Used,
- GangSlot1Name[50],
- GangSlot1Members,
- GangSlot1Strikes,
- bool:GangSlot2Used,
- GangSlot2Name[50],
- GangSlot2Members,
- GangSlot2Strikes,
- bool:GangSlot3Used,
- GangSlot3Name[50],
- GangSlot3Members,
- GangSlot3Strikes,
- bool:GangSlot4Used,
- GangSlot4Name[50],
- GangSlot4Members,
- GangSlot4Strikes,
- bool:GangSlot5Used,
- GangSlot5Name[50],
- GangSlot5Members,
- GangSlot5Strikes,
- bool:GangSlot6Used,
- GangSlot6Name[50],
- GangSlot6Members,
- GangSlot6Strikes,
- bool:GangSlot7Used,
- GangSlot7Name[50],
- GangSlot7Members,
- GangSlot7Strikes,
- bool:GangSlot8Used,
- GangSlot8Name[50],
- GangSlot8Members,
- GangSlot8Strikes,
- bool:GangSlot9Used,
- GangSlot9Name[50],
- GangSlot9Members,
- GangSlot9Strikes,
- bool:GangSlot10Used,
- GangSlot10Name[50],
- GangSlot10Members,
- GangSlot10Strikes,
- bool:GangSlot11Used,
- GangSlot11Name[50],
- GangSlot11Members,
- GangSlot11Strikes,
- bool:GangSlot12Used,
- GangSlot12Name[50],
- GangSlot12Members,
- GangSlot12Strikes,
- bool:GangSlot13Used,
- GangSlot13Name[50],
- GangSlot13Members,
- GangSlot13Strikes,
- bool:GangSlot14Used,
- GangSlot14Name[50],
- GangSlot14Members,
- GangSlot14Strikes,
- bool:GangSlot15Used,
- GangSlot15Name[50],
- GangSlot15Members,
- GangSlot15Strikes
- }
- new hInfo[MAX_HOUSES][HouseInfo];
- new pInfo[MAX_PLAYERS][PlayerInfo];
- new zInfo[MAX_ZONE][ZoneInfo];
- new sInfo[ServerInfo];
- new RandomMessages[][] = {
- "Our forums are www.gamewarfare.net/gwrp",
- "The owner of this server is Zakhar_Hunter.",
- "You can buy sports cars at Steve's Sports Cars in Los Santos.",
- "You can buy airplanes and helicopters at Airmen's Supplies at Easter Bay Airport.",
- "You can buy boats at A Boat's Life at the dock in Las Venturas.",
- "You can buy motorbikes and bikes at Trevor's Bikes in the desert.",
- "There is a lot of things you can receive when you donate.",
- "There are a lot of businesses and houses you can buy.",
- "You can join the police by applying on the forums when you reach the requirements.",
- "You can donate for your own family (gang) and your family's cars.",
- "You can donate for your own car for $12.00",
- "Use /n or /newbie for script/server-related questions.",
- "Welcome to GameWarfare Roleplay.",
- "We have other planned servers.",
- "You can donate for all of our servers at www.gamewarfare.net/donate",
- "You can buy luxury cars at LuxCars, Inc. in Los Santos.",
- "You can buy ordinary cars at Automobiles Empire in San Fierro."
- };
- //Factions
- #define FAC_TAXI 0
- #define FAC_NEWS 1
- #define FAC_SAPD 2
- #define FAC_SAFMD 3
- #define FAC_FBI 4
- #define FAC_SANG 5
- #define FAC_
- //Colors
- #define COLOR_BLACK (0x000000FF)
- #define COLOR_GREEN (0x00FF00FF)
- #define COLOR_RED (0xFF0000FF)
- #define COLOR_PINK (0xFF00FFFF)
- #define COLOR_YELLOW (0xFFFF00FF)
- #define COLOR_LIGHTBLUE (0x00B3E3FF)
- #define COLOR_PURPLE (0x9D00FFFF)
- #define COLOR_ADMIN 0xFF6C00FF
- //Dialogs
- #define DIALOG_REGISTER 26121
- #define DIALOG_LOGIN 746
- #define DIALOG_REG-SUCCESS 27331
- #define DIALOG_AGE 31780
- #define DIALOG_GENDER 24819
- #define DIALOG_ORGIN 502
- #define DIALOG_ACCENT 5912
- #define DIALOG_SEL_HOUSE_INT 31967
- //Register System Defines
- #define PATH "GWRP/Users/%s.ini"
- //House Defines
- #define HPATH "GWRP/Houses/%d.ini"
- //Timers
- forward Tut2(playerid);
- forward Tut3(playerid);
- forward Tut4(playerid);
- forward Tut5(playerid);
- forward Tut6(playerid);
- forward FinalTut(playerid);
- forward Spawn(playerid);
- //Textdraws
- new Text:SERVERNAME;
- new Text:SERVERVERSION;
- new Iterator:Houses<MAX_HOUSES>;
- //RANDOM
- new HouseCount = 0;
- main()
- {
- print("\n----------------------------------");
- print(" -| GameWarfare Roleplay -- 1.0.0 |-");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("GameWarfare Roleplay");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- SERVERNAME = TextDrawCreate(166, 358, "GameWarfare Roleplay");
- TextDrawFont(SERVERNAME, 1);
- TextDrawLetterSize(SERVERNAME, 1.0, 1.5);
- TextDrawColor(SERVERNAME, 0xC4D414FF);
- TextDrawSetOutline(SERVERNAME, 1);
- TextDrawSetProportional(SERVERNAME, true);
- TextDrawSetShadow(SERVERNAME, 7);
- SERVERVERSION = TextDrawCreate(230, 425, "Version 1.0.0");
- TextDrawFont(SERVERVERSION, 1);
- TextDrawLetterSize(SERVERVERSION, 1.0, 1.2);
- TextDrawColor(SERVERVERSION, 0xC4D414FF);
- TextDrawSetOutline(SERVERVERSION, 1);
- TextDrawSetProportional(SERVERVERSION, true);
- TextDrawSetShadow(SERVERVERSION, 7);
- UsePlayerPedAnims();
- DisableInteriorEnterExits();
- SetTimer("RandomMsgs", 180000, 1);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerInterior(playerid, 14);
- SetPlayerPos(playerid, -1870.80, 59.81, 1056.25);
- SetPlayerCameraPos(playerid, 2286.8579, 2361.1731, 30.6719);
- SetPlayerCameraLookAt(playerid, 2305.8640, 2420.3040, 10.8203);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawShowForPlayer(playerid, SERVERNAME);
- TextDrawShowForPlayer(playerid, SERVERVERSION);
- new string[128];
- new randcam = random(3);
- TogglePlayerSpectating(playerid, 1);
- if(randcam == 0)
- {
- SetPlayerCameraPos(playerid, 1469.7357,-1691.2969,44.0469);
- SetPlayerCameraLookAt(playerid, 1541.2825,-1667.3604,13.5522);
- }
- if(randcam == 1)
- {
- SetPlayerCameraPos(playerid, -2188.3616,2283.9673,24.9822);
- SetPlayerCameraLookAt(playerid, -2439.0796,2390.2986,11.7469);
- }
- if(randcam == 2)
- {
- SetPlayerCameraPos(playerid, 2286.8579,2361.1731,30.6719);
- SetPlayerCameraLookAt(playerid, 2305.8640, 2420.3040, 10.8203);
- }
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "GW Roleplay - Login", "\t{00FF00}GameWarfare Roleplay\n\t{FF00FF}Please input your password to login.", "Login", "Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "GW Roleplay - Register", "\t{00FF00}GameWarfare Roleplay{00FF00}\n\tPlease input your password to register.", "Register", "Quit");
- }
- format(string, sizeof(string), "Welcome to ~y~GameWarfare Roleplay~w~, %s.~n~Current version is ~r~1.0.0.", GetName(playerid));
- TD_SendMessage(playerid, string, "~y~GameWarfare Roleplay");
- sInfo[PlayersOnline]++;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new pIP[16];
- GetPlayerIp(playerid, pIP, sizeof(pIP));
- pInfo[playerid][IP] = pIP;
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- pInfo[playerid][XPos] = X;
- pInfo[playerid][YPos] = Y;
- pInfo[playerid][ZPos] = Z;
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteString(File, "IP", pInfo[playerid][IP]);
- INI_WriteInt(File, "Banned", pInfo[playerid][Banned]);
- INI_WriteInt(File, "Password", pInfo[playerid][Password]);
- INI_WriteInt(File, "Money", pInfo[playerid][Money]);
- INI_WriteInt(File, "MoneyInBank", pInfo[playerid][MoneyInBank]);
- INI_WriteInt(File, "Level", pInfo[playerid][Level]);
- INI_WriteInt(File, "Points", pInfo[playerid][Points]);
- INI_WriteFloat(File, "Health", pInfo[playerid][Health]);
- INI_WriteFloat(File, "Armor", pInfo[playerid][Armor]);
- INI_WriteInt(File, "Kills", pInfo[playerid][Kills]);
- INI_WriteInt(File, "Deaths", pInfo[playerid][Deaths]);
- INI_WriteInt(File, "TimesArrested", pInfo[playerid][TimesArrested]);
- INI_WriteInt(File, "TimesFined", pInfo[playerid][TimesFined]);
- INI_WriteInt(File, "TimesWarned", pInfo[playerid][TimesWarned]);
- INI_WriteInt(File, "TimesKicked", pInfo[playerid][TimesKicked]);
- INI_WriteInt(File, "TimesJailed", pInfo[playerid][TimesJailed]);
- INI_WriteInt(File, "Skin", pInfo[playerid][Skin]);
- INI_WriteInt(File, "PhoneNumber", pInfo[playerid][PhoneNumber]);
- INI_WriteFloat(File, "XPosition", pInfo[playerid][XPos]);
- INI_WriteFloat(File, "YPosition", pInfo[playerid][YPos]);
- INI_WriteFloat(File, "ZPosition", pInfo[playerid][ZPos]);
- INI_WriteInt(File, "CarsSold", pInfo[playerid][CarsSold]);
- INI_WriteInt(File, "MoneyEarnedFromSoldCars", pInfo[playerid][MoneyEarnedFromSoldCars]);
- INI_WriteString(File, "Slot1Car", pInfo[playerid][CarNameInSlot1]);
- INI_WriteString(File, "Slot2Car", pInfo[playerid][CarNameInSlot2]);
- INI_WriteString(File, "Slot3Car", pInfo[playerid][CarNameInSlot3]);
- INI_WriteString(File, "Slot4Car", pInfo[playerid][CarNameInSlot4]);
- INI_WriteString(File, "Slot5Car", pInfo[playerid][CarNameInSlot5]);
- INI_WriteString(File, "VIPSlot6Car", pInfo[playerid][CarNameInVIPSlot6]);
- INI_WriteString(File, "VIPSlot7Car", pInfo[playerid][CarNameInVIPSlot7]);
- INI_WriteString(File, "VIPSlot8Car", pInfo[playerid][CarNameInVIPSlot8]);
- INI_WriteString(File, "VIPSlot9Car", pInfo[playerid][CarNameInVIPSlot9]);
- INI_WriteString(File, "VIPSlot10Car", pInfo[playerid][CarNameInVIPSlot10]);
- INI_WriteInt(File, "HouseInSlot1", pInfo[playerid][HouseIDInSlot1]);
- INI_WriteInt(File, "HouseInSlot2", pInfo[playerid][HouseIDInSlot2]);
- INI_WriteInt(File, "HouseInSlot3", pInfo[playerid][HouseIDInSlot3]);
- INI_WriteInt(File, "HouseInVIPSlot4", pInfo[playerid][HouseIDInVIPSlot4]);
- INI_WriteInt(File, "HouseInVIPSlot5", pInfo[playerid][HouseIDInVIPSlot5]);
- INI_WriteInt(File, "BusinessInSlot1", pInfo[playerid][BusinessIDInSlot1]);
- INI_WriteInt(File, "BusinessInSlot2", pInfo[playerid][BusinessIDInSlot2]);
- INI_WriteInt(File, "BusinessInVIPSlot3", pInfo[playerid][BusinessIDInVIPSlot3]);
- INI_WriteInt(File, "BusinessInVIPSlot4", pInfo[playerid][BusinessIDInVIPSlot4]);
- INI_WriteInt(File, "BusinessInVIPSlot5", pInfo[playerid][BusinessIDInVIPSlot5]);
- INI_WriteInt(File, "VIP", pInfo[playerid][VIP]);
- INI_WriteInt(File, "Admin", pInfo[playerid][Admin]);
- INI_WriteInt(File, "Helper", pInfo[playerid][Helper]);
- INI_WriteInt(File, "InTaxiCompany", pInfo[playerid][InTaxiCompany]);
- INI_WriteInt(File, "InSANewsCompany", pInfo[playerid][InSANewsCompany]);
- INI_WriteInt(File, "Governor", pInfo[playerid][Governor]);
- INI_WriteInt(File, "InPolice", pInfo[playerid][InPolice]);
- INI_WriteInt(File, "InFBI", pInfo[playerid][InFBI]);
- INI_WriteInt(File, "InSWAT", pInfo[playerid][InSWAT]);
- INI_WriteInt(File, "InSANG", pInfo[playerid][InSANG]);
- INI_WriteInt(File, "InSAFMD", pInfo[playerid][InSAFMD]);
- INI_WriteFloat(File, "Slot1CarXPos", pInfo[playerid][Slot1CarXPos]);
- INI_WriteFloat(File, "Slot1CarYPos", pInfo[playerid][Slot1CarYPos]);
- INI_WriteFloat(File, "Slot1CarZPos", pInfo[playerid][Slot1CarZPos]);
- INI_WriteFloat(File, "Slot2CarXPos", pInfo[playerid][Slot2CarXPos]);
- INI_WriteFloat(File, "Slot2CarYPos", pInfo[playerid][Slot2CarYPos]);
- INI_WriteFloat(File, "Slot2CarZPos", pInfo[playerid][Slot2CarZPos]);
- INI_WriteFloat(File, "Slot3CarXPos", pInfo[playerid][Slot3CarXPos]);
- INI_WriteFloat(File, "Slot3CarYPos", pInfo[playerid][Slot3CarYPos]);
- INI_WriteFloat(File, "Slot3CarZPos", pInfo[playerid][Slot3CarZPos]);
- INI_WriteFloat(File, "Slot4CarXPos", pInfo[playerid][Slot4CarXPos]);
- INI_WriteFloat(File, "Slot4CarYPos", pInfo[playerid][Slot4CarYPos]);
- INI_WriteFloat(File, "Slot4CarZPos", pInfo[playerid][Slot4CarZPos]);
- INI_WriteFloat(File, "Slot5CarXPos", pInfo[playerid][Slot5CarXPos]);
- INI_WriteFloat(File, "Slot5CarYPos", pInfo[playerid][Slot5CarYPos]);
- INI_WriteFloat(File, "Slot5CarZPos", pInfo[playerid][Slot5CarZPos]);
- INI_WriteFloat(File, "Slot6CarXPos", pInfo[playerid][Slot6CarXPos]);
- INI_WriteFloat(File, "Slot6CarYPos", pInfo[playerid][Slot6CarYPos]);
- INI_WriteFloat(File, "Slot6CarZPos", pInfo[playerid][Slot6CarZPos]);
- INI_WriteFloat(File, "Slot7CarXPos", pInfo[playerid][Slot7CarXPos]);
- INI_WriteFloat(File, "Slot7CarYPos", pInfo[playerid][Slot7CarYPos]);
- INI_WriteFloat(File, "Slot7CarZPos", pInfo[playerid][Slot7CarZPos]);
- INI_WriteFloat(File, "Slot8CarXPos", pInfo[playerid][Slot8CarXPos]);
- INI_WriteFloat(File, "Slot8CarYPos", pInfo[playerid][Slot8CarYPos]);
- INI_WriteFloat(File, "Slot8CarZPos", pInfo[playerid][Slot8CarZPos]);
- INI_WriteFloat(File, "Slot9CarXPos", pInfo[playerid][Slot9CarXPos]);
- INI_WriteFloat(File, "Slot9CarYPos", pInfo[playerid][Slot9CarYPos]);
- INI_WriteFloat(File, "Slot9CarZPos", pInfo[playerid][Slot9CarZPos]);
- INI_WriteFloat(File, "Slot10CarXPos", pInfo[playerid][Slot10CarXPos]);
- INI_WriteFloat(File, "Slot10CarYPos", pInfo[playerid][Slot10CarYPos]);
- INI_WriteFloat(File, "Slot10CarZPos", pInfo[playerid][Slot10CarZPos]);
- INI_Close(File);
- sInfo[PlayersOnline]--;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new message[128];
- format(message, sizeof(message), "%s says: [%s Accent] %s", GetName(playerid), pInfo[playerid][Accent], text);
- ProxDetector(30.0, playerid, message, -1);
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new pIP[16];
- GetPlayerIp(playerid, pIP, sizeof(pIP));
- new string[128];
- if(dialogid == DIALOG_REGISTER)
- {
- if(response)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- GivePlayerMoney(playerid, 30000);
- SetPlayerScore(playerid, 1);
- INI_WriteString(File, "IP", pIP);
- INI_WriteInt(File, "Banned", 0);
- INI_WriteInt(File, "Password", udb_hash(inputtext));
- INI_WriteInt(File, "Money", 30000);
- INI_WriteInt(File, "MoneyInBank", 0);
- INI_WriteInt(File,"Level", 1);
- INI_WriteInt(File,"Points", 0);
- INI_WriteFloat(File,"Health", 100.0);
- INI_WriteFloat(File,"Armor", 0.0);
- INI_WriteInt(File,"Kills", 0);
- INI_WriteInt(File,"Deaths", 0);
- INI_WriteInt(File,"TimesArrested", 0);
- INI_WriteInt(File,"TimesFined", 0);
- INI_WriteInt(File,"TimesWarned", 0);
- INI_WriteInt(File,"TimesKicked", 0);
- INI_WriteInt(File,"TimesJailed", 0);
- INI_WriteInt(File,"CarsSold", 0);
- INI_WriteInt(File,"MoneyEarnedFromSoldCars", 0);
- INI_WriteString(File, "Slot1Car", "None");
- INI_WriteString(File, "Slot2Car", "None");
- INI_WriteString(File, "Slot3Car", "None");
- INI_WriteString(File, "Slot4Car", "None");
- INI_WriteString(File, "Slot5Car", "None");
- INI_WriteString(File, "VIPSlot6Car", "None");
- INI_WriteString(File, "VIPSlot7Car", "None");
- INI_WriteString(File, "VIPSlot8Car", "None");
- INI_WriteString(File, "VIPSlot9Car", "None");
- INI_WriteString(File, "VIPSlot10Car", "None");
- INI_WriteInt(File,"VIP", 0);
- INI_WriteInt(File,"Admin", 0);
- INI_WriteInt(File,"Helper", 0);
- INI_WriteInt(File,"InTaxiCompany", 0);
- INI_WriteInt(File,"InSANewsCompany", 0);
- INI_WriteInt(File,"Governor", 0);
- INI_WriteInt(File,"InPolice", 0);
- INI_WriteInt(File,"InFBI", 0);
- INI_WriteInt(File,"InSWAT", 0);
- INI_WriteInt(File,"InSANG", 0);
- INI_WriteInt(File,"InSAFMD", 0);
- INI_Close(File);
- pInfo[playerid][IP] = pIP;
- ShowPlayerDialog(playerid, DIALOG_REG-SUCCESS, DIALOG_STYLE_MSGBOX, "Register - Success!", "{00FF00}Success!\nYou will now head to edit your character's details.", "Proceed", "");
- }
- else
- {
- Kick(playerid);
- }
- }
- if(dialogid == DIALOG_LOGIN)
- {
- if(response)
- {
- pInfo[playerid][IP] = pIP;
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, pInfo[playerid][Money]);
- SetPlayerScore(playerid, pInfo[playerid][Level]);
- format(string, sizeof(string), "Welcome back, %s. Your Player ID is %d.", GetName(playerid), playerid);
- SendClientMessage(playerid, COLOR_GREEN, string);
- TogglePlayerSpectating(playerid, 0);
- SetSpawnInfo(playerid, 0, 295, pInfo[playerid][XPos], pInfo[playerid][YPos], pInfo[playerid][ZPos], 269.15, 0, 0, 0, 0, 0, 0 );
- SpawnPlayer(playerid);
- SetPlayerInterior(playerid, 0);
- }
- else
- {
- Kick(playerid);
- }
- }
- if(dialogid == DIALOG_REG-SUCCESS)
- {
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Enter Age", "What is your age?", "Next", "");
- }
- if(dialogid == DIALOG_AGE)
- {
- if(strlen(inputtext) == 2)
- {
- strcat(pInfo[playerid][Age], inputtext);
- ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Select Gender", "Male\nFemale", "Next >>>", "Back <<<");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: Age cannot be below 10 or above 99");
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Enter Age", "What is your age?", "Next", "");
- }
- }
- if(dialogid == DIALOG_GENDER)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- strcat(pInfo[playerid][Gender], "Male");
- ShowPlayerDialog(playerid, DIALOG_ORGIN, DIALOG_STYLE_INPUT, "Enter Orgin", "Where did you come from, sir?", "Next >>>", "Back <<<");
- }
- case 1:
- {
- strcat(pInfo[playerid][Gender], "Female");
- ShowPlayerDialog(playerid, DIALOG_ORGIN, DIALOG_STYLE_INPUT, "Enter Orgin", "Where did you come from, mam?", "Next >>>", "Back <<<");
- }
- }
- }
- else
- {
- //The player has pressed "Next >>>".
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Enter Age", "What is your age?", "Next", "");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Enter Age", "What is your age?", "Next", "");
- }
- }
- }
- }
- if(dialogid == DIALOG_ORGIN)
- {
- if(response)
- {
- strcat(pInfo[playerid][Age], inputtext);
- ShowPlayerDialog(playerid, DIALOG_ACCENT, DIALOG_STYLE_INPUT, "Enter Accent", "Lastly, what is your accent?", "Tutorial >>>", "Back <<<");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Select Gender", "Male\nFemale", "Next >>>", "Back <<<");
- }
- }
- if(dialogid == DIALOG_ACCENT)
- {
- if(response)
- {
- strcat(pInfo[playerid][Accent], inputtext);
- SetPlayerCameraPos(playerid, 657.0831, 2353.6143, 85.1300);
- SetPlayerCameraLookAt(playerid, 657.5923, 2352.7556, 84.9950);
- TD_SendMessage(playerid, "Welcome to ~y~GameWarfare Roleplay~w~.~n~This roleplay server is set ~g~after~w~you fly~n~into ~y~Los Santos~w~~n~. When you roleplay, you try to act like you would in real life.~n~But that depends, on what type of person you are roleplaying.~n~A civillian would act ~y~normal~w~. Gang Members and people who ~n~break the law, well, break the law.", "~y~GameWarfare Roleplay", 12500, 0x000000AA, 20.0000, 110.000000, 130.000000);
- SetTimerEx("Tut2", 12500, false, "i", playerid);
- }
- else
- {
- if(strcmp(inputtext, "Male", true))
- {
- ShowPlayerDialog(playerid, DIALOG_ORGIN, DIALOG_STYLE_INPUT, "Enter Orgin", "Where did you come from, sir?", "Next >>>", "Back <<<");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_ORGIN, DIALOG_STYLE_INPUT, "Enter Orgin", "Where did you come from, mam?", "Next >>>", "Back <<<");
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- forward RandomMsgs();
- public RandomMsgs()
- {
- SendClientMessageToAll(0xF04008, RandomMessages[random(sizeof(RandomMessages))]);
- }
- stock strreplace(string[], find, replace)
- {
- for(new i=0; string[i]; i++)
- {
- if(string[i] == find)
- {
- string[i] = replace;
- }
- }
- }
- stock GetName(playerid)
- {
- new
- name[24];
- GetPlayerName(playerid, name, sizeof(name));
- strreplace(name, '_', ' ');
- return name;
- }
- stock ProxDetector(Float:radi, playerid, string[],color)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- foreach(Player,i)
- {
- if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
- {
- SendClientMessage(i,color,string);
- }
- }
- }
- ///////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- CMD:me(playerid, params[])
- {
- new
- string[128],
- action[100];
- if(sscanf(params, "s[100]", action))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /me [action]");
- return 1;
- }
- else
- {
- format(string, sizeof(string), "* %s %s", GetName(playerid), action);
- ProxDetector(30, playerid, string, COLOR_PURPLE);
- }
- return 1;
- }
- CMD:shout(playerid, params[])
- {
- new
- string[128],
- shout[100];
- if(sscanf(params, "s[100]", shout))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /(s)hout [message]");
- return 1;
- }
- else
- {
- format(string, sizeof(string), "%s shouts: %s!",GetName(playerid),shout);
- ProxDetector(56.9, playerid, string, -1);
- }
- return 1;
- }
- CMD:newbie(playerid, params[])
- {
- new
- string[128],
- msg[125],
- levelname[75],
- level,
- helper,
- admin;
- level = pInfo[playerid][Level];
- helper = pInfo[playerid][Helper];
- admin = pInfo[playerid][Admin];
- if(level == 1) return levelname = "Newbie";
- if(level > 1 && level < 5) return levelname = "Player";
- if(level >= 5 && level < 10) return levelname = "Advanced Player";
- if(level >= 10 && level < 19) return levelname = "Professional Player";
- if(level >= 20) return levelname = "Expert Player";
- if(helper == 1) return levelname = "Basic Helper";
- if(helper == 2) return levelname = "Helper";
- if(helper == 3) return levelname = "Advanced Helper";
- if(helper == 4) return levelname = "Professional Helper";
- if(helper == 5) return levelname = "Expert Helper";
- if(helper >= 6) return levelname = "Head Helper";
- if(admin == 1) return levelname = "Junior Admin";
- if(admin == 2) return levelname = "General Admin";
- if(admin == 3) return levelname = "Senior Admin";
- if(admin == 4) return levelname = "Senior Admin";
- if(admin == 5) return levelname = "Owner";
- if(sscanf(params, "s[100]", msg))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /(n)ewbie [message]");
- return 1;
- }
- else
- {
- format(string, sizeof(string), "%s %s: %s", levelname, GetName(playerid), msg);
- SendClientMessageToAll(COLOR_LIGHTBLUE, string);
- }
- return 1;
- }
- CMD:n(playerid, params[]) return cmd_newbie(playerid, params);
- CMD:s(playerid, params[]) return cmd_shout(playerid, params);
- ////////////////////////////////////////////////
- /////// ADMIN COMMANDS ///////////
- ////////////////////////////////////////////////
- CMD:makeadmin(playerid, params[])
- {
- new ID;
- new lvl;
- new string[128];
- new lvlname[50];
- if(lvl == 0) lvlname = "Not Admin";
- if(lvl == 1) lvlname = "Junior Administrator";
- if(lvl == 2) lvlname = "General Administrator";
- if(lvl == 3) lvlname = "Senior Administrator";
- if(lvl == 4) lvlname = "Executive Administrator";
- if(lvl == 5) lvlname = "Owner";
- print("First Print");
- if(sscanf(params, "ui", ID, lvl))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /makeadmin [PlayerID/Name] [Level]");
- return 1;
- }
- else
- {
- if(pInfo[playerid][Admin] == 5 || IsPlayerAdmin(playerid))
- {
- print("Made it to admin level check");
- if(IsPlayerConnected(ID))
- {
- print("Made it to connected check");
- if(lvl != pInfo[ID][Admin])
- {
- print("Made it to check if level does not equal level");
- format(string, sizeof(string), "Promoted to~n~~w~Admin Level %d", lvl);
- if(pInfo[ID][Admin] < lvl)
- {
- format(string, sizeof(string), "~g~Promoted to~n~~w~Admin Level %d", lvl);
- GameTextForPlayer(playerid, string, 9000, 0);
- }
- if(pInfo[ID][Admin] > lvl)
- {
- format(string, sizeof(string), "~r~Demoted to~n~~w~Admin Level %d", lvl);
- GameTextForPlayer(playerid, string, 9000, 0);
- }
- pInfo[ID][Admin] = lvl;
- format(string, sizeof(string), "-| You have given %s(%d) admin level %d (%s) |-", GetName(ID), ID, lvl, lvlname);
- SendClientMessage(playerid, COLOR_ADMIN, string);
- format(string, sizeof(string), "-| Admin %s has given you admin level %d (%s) |-", GetName(playerid), lvl, lvlname);
- SendClientMessage(ID, COLOR_ADMIN, string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: Player is already that level.");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected. Use /adminoffline to set an offline player's level.");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a high enough level to use this command.");
- }
- }
- return 1;
- }
- //////////////////////////////////////////
- /////// HOUSE COMMANDS ///////////////
- //////////////////////////////////////
- CMD:createhouse(playerid, params[])
- {
- new price;
- new HouseID = HouseCount;
- new Location[28];
- new string[128];
- new AddressID;
- if(sscanf(params, "i", price))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /createhouse [Price]");
- return 1;
- }
- else
- {
- if(pInfo[playerid][Admin] >= 4)
- {
- GetPlayer2DZone(playerid, Location, 28);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- hInfo[HouseID][Owned] = false;
- format(hInfo[HouseID][HouseOwner], MAX_PLAYER_NAME, "None %d", HouseID);
- hInfo[HouseID][HouseX] = x;
- hInfo[HouseID][HouseY] = y;
- hInfo[HouseID][HouseZ] = z;
- hInfo[HouseID][Price] = price;
- hInfo[HouseID][Locked] = true;
- hInfo[HouseID][HousePickup] = true;
- zInfo[GetPlayer2DZoneID(playerid)][HousesInZone]++;
- AddressID = zInfo[GetPlayer2DZoneID(playerid)][HousesInZone];
- format(hInfo[HouseID][HouseAddress], 48, "%d %s", AddressID, Location);
- hInfo[HouseID][DoorPickup] = CreateDynamicPickup(1273, 1, x, y, z, 0);
- format(string, sizeof(string), "{00FF00}House for Sale\n{00FFFF}$%d\nAddress: %s", price, hInfo[HouseID][HouseAddress]);
- hInfo[HouseID][DoorTextID] = CreateDynamic3DTextLabel(string, 0x008080FF, x, y, z + 0.7, 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1);
- Iter_Add(Houses, HouseID);
- format(string, sizeof(string), "-| House ID %d created! |-", HouseID);
- SendClientMessage(playerid, COLOR_GREEN, string);
- hInfo[HouseID][Buyable] = true;
- HouseFileCreate(HouseID);
- HouseCount++;
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a high enough level to use this command.");
- }
- }
- return 1;
- }
- CMD:delhouse(playerid, params[])
- {
- new string[128];
- new HouseID;
- if(pInfo[playerid][Admin] >= 4)
- {
- foreach(new h : Houses)
- {
- if(IsValidDynamicPickup(hInfo[h][DoorPickup]))
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, hInfo[h][HouseX], hInfo[h][HouseY], hInfo[h][HouseZ]))
- {
- format(string, sizeof(string), "-| House ID %d deleted. |-", h);
- SendClientMessage(playerid, COLOR_RED, string);
- hInfo[h][Owned] = false;
- format(hInfo[HouseID][HouseName], 128, "Deleted %d", HouseID);
- DestroyDynamicPickup(hInfo[h][DoorPickup]);
- DestroyDynamic3DTextLabel(hInfo[h][DoorTextID]);
- hInfo[h][Buyable] = false;
- hInfo[h][Locked] = false;
- hInfo[h][HousePickup] = false;
- Iter_Remove(Houses, h);
- HouseFileRemove(h);
- zInfo[GetPlayer2DZoneID(playerid)][HousesInZone]--;
- return 1;
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a high enough level to use this command.");
- }
- return 1;
- }
- /*CMD:buyhouse(playerid, params[])
- {
- #pragma unused params
- foreach(new h : Houses)
- {
- if(IsValidDynamicPickup(hInfo[h][DoorPickup]))
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, hInfo[h][HouseX], hInfo[h][HouseY], hInfo[h][HouseZ]))
- {
- if(GetPlayerMoney(playerid) >= hInfo[h][Price])
- {
- GivePlayerMoney(playerid, -hInfo[h][Price])
- SendClientMessage(playerid, COLOR_GREEN, "-| You have successfully bought a house! |-");
- */
- ///////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_String("IP", pInfo[playerid][IP], 16);
- INI_Int("Banned", pInfo[playerid][Banned]);
- INI_Int("Password", pInfo[playerid][Password]);
- INI_Int("Money", pInfo[playerid][Money]);
- INI_Int("MoneyInBank", pInfo[playerid][MoneyInBank]);
- INI_Int("Level", pInfo[playerid][Level]);
- INI_Int("Points", pInfo[playerid][Points]);
- INI_Float("Health", pInfo[playerid][Health]);
- INI_Float("Armor", pInfo[playerid][Armor]);
- INI_Int("Kills", pInfo[playerid][Kills]);
- INI_Int("Deaths", pInfo[playerid][Deaths]);
- INI_Int("TimesArrested", pInfo[playerid][TimesArrested]);
- INI_Int("TimesFined", pInfo[playerid][TimesFined]);
- INI_Int("TimesWarned", pInfo[playerid][TimesWarned]);
- INI_Int("TimesKicked", pInfo[playerid][TimesKicked]);
- INI_Int("TimesJailed", pInfo[playerid][TimesJailed]);
- INI_Int("Skin", pInfo[playerid][Skin]);
- INI_Int("PhoneNumber", pInfo[playerid][PhoneNumber]);
- INI_Float("XPosition", pInfo[playerid][XPos]);
- INI_Float("YPosition", pInfo[playerid][YPos]);
- INI_Float("ZPosition", pInfo[playerid][ZPos]);
- INI_Int("CarsSold", pInfo[playerid][CarsSold]);
- INI_Int("MoneyEarnedFromSoldCars", pInfo[playerid][MoneyEarnedFromSoldCars]);
- INI_String("Slot1Car", pInfo[playerid][CarNameInSlot1], 100);
- INI_String("Slot2Car", pInfo[playerid][CarNameInSlot2], 100);
- INI_String("Slot3Car", pInfo[playerid][CarNameInSlot3], 100);
- INI_String("Slot4Car", pInfo[playerid][CarNameInSlot4], 100);
- INI_String("Slot5Car", pInfo[playerid][CarNameInSlot5], 100);
- INI_String("VIPSlot6Car", pInfo[playerid][CarNameInVIPSlot6], 100);
- INI_String("VIPSlot7Car", pInfo[playerid][CarNameInVIPSlot7], 100);
- INI_String("VIPSlot8Car", pInfo[playerid][CarNameInVIPSlot8], 100);
- INI_String("VIPSlot9Car", pInfo[playerid][CarNameInVIPSlot9], 100);
- INI_String("VIPSlot10Car", pInfo[playerid][CarNameInVIPSlot10], 100);
- INI_Int("HouseInSlot1", pInfo[playerid][HouseIDInSlot1]);
- INI_Int("HouseInSlot2", pInfo[playerid][HouseIDInSlot2]);
- INI_Int("HouseInSlot3", pInfo[playerid][HouseIDInSlot3]);
- INI_Int("HouseInVIPSlot4", pInfo[playerid][HouseIDInVIPSlot4]);
- INI_Int("HouseInVIPSlot5", pInfo[playerid][HouseIDInVIPSlot5]);
- INI_Int("BusinessInSlot1", pInfo[playerid][BusinessIDInSlot1]);
- INI_Int("BusinessInSlot2", pInfo[playerid][BusinessIDInSlot2]);
- INI_Int("BusinessInVIPSlot3", pInfo[playerid][BusinessIDInVIPSlot3]);
- INI_Int("BusinessInVIPSlot4", pInfo[playerid][BusinessIDInVIPSlot4]);
- INI_Int("BusinessInVIPSlot5", pInfo[playerid][BusinessIDInVIPSlot5]);
- INI_Int("VIP", pInfo[playerid][VIP]);
- INI_Int("Admin", pInfo[playerid][Admin]);
- INI_Int("Helper", pInfo[playerid][Helper]);
- INI_Int("InTaxiCompany", pInfo[playerid][InTaxiCompany]);
- INI_Int("InSANewsCompany", pInfo[playerid][InSANewsCompany]);
- INI_Int("Governor", pInfo[playerid][Governor]);
- INI_Int("InPolice", pInfo[playerid][InPolice]);
- INI_Int("InFBI", pInfo[playerid][InFBI]);
- INI_Int("InSWAT", pInfo[playerid][InSWAT]);
- INI_Int("InSANG", pInfo[playerid][InSANG]);
- INI_Int("InSAFMD", pInfo[playerid][InSAFMD]);
- INI_Float("Slot1CarXPos", pInfo[playerid][Slot1CarXPos]);
- INI_Float("Slot1CarYPos", pInfo[playerid][Slot1CarYPos]);
- INI_Float("Slot1CarZPos", pInfo[playerid][Slot1CarZPos]);
- INI_Float("Slot2CarXPos", pInfo[playerid][Slot2CarXPos]);
- INI_Float("Slot2CarYPos", pInfo[playerid][Slot2CarYPos]);
- INI_Float("Slot2CarZPos", pInfo[playerid][Slot2CarZPos]);
- INI_Float("Slot3CarXPos", pInfo[playerid][Slot3CarXPos]);
- INI_Float("Slot3CarYPos", pInfo[playerid][Slot3CarYPos]);
- INI_Float("Slot3CarZPos", pInfo[playerid][Slot3CarZPos]);
- INI_Float("Slot4CarXPos", pInfo[playerid][Slot4CarXPos]);
- INI_Float("Slot4CarYPos", pInfo[playerid][Slot4CarYPos]);
- INI_Float("Slot4CarZPos", pInfo[playerid][Slot4CarZPos]);
- INI_Float("Slot5CarXPos", pInfo[playerid][Slot5CarXPos]);
- INI_Float("Slot5CarYPos", pInfo[playerid][Slot5CarYPos]);
- INI_Float("Slot5CarZPos", pInfo[playerid][Slot5CarZPos]);
- INI_Float("Slot6CarXPos", pInfo[playerid][Slot6CarXPos]);
- INI_Float("Slot6CarYPos", pInfo[playerid][Slot6CarYPos]);
- INI_Float("Slot6CarZPos", pInfo[playerid][Slot6CarZPos]);
- INI_Float("Slot7CarXPos", pInfo[playerid][Slot7CarXPos]);
- INI_Float("Slot7CarYPos", pInfo[playerid][Slot7CarYPos]);
- INI_Float("Slot7CarZPos", pInfo[playerid][Slot7CarZPos]);
- INI_Float("Slot8CarXPos", pInfo[playerid][Slot8CarXPos]);
- INI_Float("Slot8CarYPos", pInfo[playerid][Slot8CarYPos]);
- INI_Float("Slot8CarZPos", pInfo[playerid][Slot8CarZPos]);
- INI_Float("Slot9CarXPos", pInfo[playerid][Slot9CarXPos]);
- INI_Float("Slot9CarYPos", pInfo[playerid][Slot9CarYPos]);
- INI_Float("Slot9CarZPos", pInfo[playerid][Slot9CarZPos]);
- INI_Float("Slot10CarXPos", pInfo[playerid][Slot10CarXPos]);
- INI_Float("Slot10CarYPos", pInfo[playerid][Slot10CarYPos]);
- INI_Float("Slot10CarZPos", pInfo[playerid][Slot10CarZPos]);
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- stock HousePath(HouseID)
- {
- new string[128];
- format(string,sizeof(string),HPATH,HouseID);
- return string;
- }
- stock udb_hash(buf[]) {
- 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 minrand(min, max) //By Alex "Y_Less" Cole
- {
- return random(max - min) + min;
- }
- stock GivePlayerWarning(playerid, warnedid, reason[])
- {
- foreach(new admins:
- new string[128];
- if(pInfo[warnedid][CurrentWarnings] == 0)
- {
- format(string, sizeof(string), "-| %s has been warned by an admin. | Reason: %s | Warning 1/3 |-", GetName(warnedid), reason);
- ProxDetector(25.0, warnedid, string, COLOR_ADMIN);
- pInfo[warnedid][CurrentWarnings] = 1;
- }
- if(pInfo[warnedid][CurrentWarnings] == 1)
- {
- format(string, sizeof(string), "-| %s has been warned by an admin. | Reason: %s | Warning 2/3 |-", GetName(warnedid), reason);
- ProxDetector(25.0, warnedid, string, COLOR_ADMIN);
- pInfo[warnedid][CurrentWarnings] = 2;
- }
- if(pInfo[warnedid][CurrentWarnings] == 2)
- {
- format(string, sizeof(string), "-| %s has been auto kicked. Too many warnings. | Reason: %s | Warning 3/3 |-", GetName(warnedid), reason);
- ProxDetector(25.0, warnedid, string, COLOR_ADMIN);
- pInfo[warnedid][CurrentWarnings] = 0;
- pInfo[warnedid][TimesKicked]++;
- Kick(warnedid);
- }
- return 1;
- }
- stock HouseFileCreate(HouseID)
- {
- new INI:File = INI_Open(HousePath(HouseID));
- INI_WriteInt(File, "HouseID", HouseID);
- INI_WriteString(File, "HouseAddress", hInfo[HouseID][HouseAddress]);
- INI_WriteFloat(File,"XPosition", hInfo[HouseID][HouseX]);
- INI_WriteFloat(File,"YPosition", hInfo[HouseID][HouseY]);
- INI_WriteFloat(File,"ZPosition", hInfo[HouseID][HouseZ]);
- INI_WriteBool(File,"Owned", hInfo[HouseID][Owned]);
- INI_WriteInt(File,"Price", hInfo[HouseID][Price]);
- INI_WriteString(File,"HouseOwner", hInfo[HouseID][HouseOwner]);
- INI_WriteInt(File,"InteriorID", hInfo[HouseID][Interior]);
- INI_WriteFloat(File,"IntX", hInfo[HouseID][IntX]);
- INI_WriteFloat(File,"IntY", hInfo[HouseID][IntY]);
- INI_WriteFloat(File,"IntZ", hInfo[HouseID][IntZ]);
- INI_WriteBool(File,"Locked", hInfo[HouseID][Locked]);
- INI_WriteBool(File,"BuyPickup", hInfo[HouseID][HousePickup]);
- INI_WriteString(File,"DoorText", hInfo[HouseID][DoorText]);
- INI_WriteBool(File,"Buyable", hInfo[HouseID][Buyable]);
- INI_Close(File);
- return 1;
- }
- stock HouseFileRemove(HouseID)
- {
- fremove(HousePath(HouseID));
- return 1;
- }
- ///////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////
- public Tut2(playerid)
- {
- SetPlayerCameraPos(playerid, 1385.0044, -1589.4882, 83.8622);
- SetPlayerCameraLookAt(playerid, 1385.9458, -1589.8208, 83.5972);
- TD_SendMessage(playerid, "If you break the law, the ~b~police~w~ will come after you.~n~If they get to you and cuff you, they will take you~n~to the ~y~police department~w~and question you. After that, they usually ~r~arrest~w~~n~you..~n~You can pay a ~y~bail~w~ to get out, or~n~serve the time. If you are caught ~r~fighting~w~ in jail, you will be~n~~b~tazed~w~ and given more time.", "Getting Arrested", 12500, 0x000000AA, 20.0000, 110.000000, 130.000000);
- SetTimerEx("Tut3", 14000, false, "i", playerid);
- return 1;
- }
- public Tut3(playerid)
- {
- SetPlayerCameraPos(playerid, 1813.2134, -1827.4246, 30.1471);
- SetPlayerCameraLookAt(playerid, 1814.0741, -1827.9305, 29.5921);
- TD_SendMessage(playerid, "This is a ~y~24/7~w~. At 24/7s, you can buy and sell things. This is also ~n~where you can buy useful things such as ~r~medkits~w~,~y~repair kits~w~,~n~and ~b~locks~w~. Some 24/7s are also gas stations.", "24/7 Store", 12500, 0x000000AA, 20.0000, 110.000000, 130.000000);
- SetTimerEx("Tut4", 12500, false, "i", playerid);
- return 1;
- }
- public Tut4(playerid)
- {
- SetPlayerCameraPos(playerid, -97.9495, 1996.9739, 97.2413);
- SetPlayerCameraLookAt(playerid, -96.9954, 1996.6803, 97.0662);
- TD_SendMessage(playerid, "~y~Fort Offutt~w~ is a restricted area. ~b~Anyone~w~ caught inside it~n~is entering a ~r~restricted~w~ area and will be~n~~y~questioned~w~ and ~r~arrested~w~.", "Fort Offutt", 12500, 0x000000AA, 20.0000, 110.000000, 130.000000);
- SetTimerEx("Tut5", 13500, false, "i", playerid);
- return 1;
- }
- public Tut5(playerid)
- {
- SetPlayerCameraPos(playerid, 1620.6338, 1706.5488, 28.9259);
- SetPlayerCameraLookAt(playerid, 1621.4407, 1707.1355, 28.6609);
- TD_SendMessage(playerid, "You can buy ~y~clothes~w~ (toys) at clothes shops.~n~There are clothes shops located in ~g~every~w~city.~n~You can also change your ~y~skin~w~.", "Clothes Shops", 12500, 0x000000AA, 20.0000, 110.000000, 130.000000);
- SetTimerEx("Tut6", 12500, false, "i", playerid);
- return 1;
- }
- public Tut6(playerid)
- {
- SetPlayerCameraPos(playerid, 1763.4729, 1538.3271, 55.9853);
- SetPlayerCameraLookAt(playerid, 1762.7649, 1537.6239, 55.6452);
- TD_SendMessage(playerid, "At airports, you can get rides to other airports.~n~A ~g~progress bar~w~ will show up indicating how close you are to the ~y~~n~destination. Each plane ticket costs a different amount of cash, depending on how far~n~your destination is. This can be used for ~g~easy~w~ travel.", "Airplane Rides", 12500, 0x000000AA, 20.0000, 110.000000, 130.000000);
- SetTimerEx("FinalTut", 12500, false, "i", playerid);
- return 1;
- }
- public FinalTut(playerid)
- {
- SetPlayerCameraPos(playerid, -1784.7091, -355.8275, 210.3701);
- SetPlayerCameraLookAt(playerid, -1785.2263, -354.9741, 210.1050);
- TD_SendMessage(playerid, "You're ready to go into the world of ~y~GW-RP~w~! Get ~g~ready~w~!", "Ready to go!", 5001, 0x000000AA, 20.0000, 110.000000, 130.000000);
- SetTimerEx("Spawn", 5000, false, "i", playerid);
- }
- public Spawn(playerid)
- {
- if(strcmp(pInfo[playerid][Gender], "Male", true))
- {
- TogglePlayerSpectating(playerid, 0);
- SetPlayerPos(playerid, -1424.6716, -288.3624, 14.1484);
- SetPlayerInterior(playerid, 0);
- SetCameraBehindPlayer(playerid);
- SetPlayerSkin(playerid, 295);
- pInfo[playerid][Level] = 1;
- }
- else if(strcmp(pInfo[playerid][Gender], "Female", true))
- {
- TogglePlayerSpectating(playerid, 0);
- SetPlayerPos(playerid, 1643.0640, -2332.2261, 13.5469);
- SetPlayerInterior(playerid, 0);
- SetCameraBehindPlayer(playerid);
- SetPlayerSkin(playerid, 93);
- pInfo[playerid][Level] = 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment