Код:
public OnPlayerConnect(playerid)
{
if(!IsPlayerNPC(playerid))
{
if(Security != 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Host has broken one of the Agreement rules, action has been taken.");
Kick(playerid);
return 1;
}
new playername[MAX_PLAYER_NAME],f;
GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
if(strfind(playername,"_",true,1)!=-1)
f=1;
if(playername[strlen(playername)-1]=='_')
f=0;
for(new i=0;i<strlen(playername);i++)
if((playername[i]<='9')&&(playername[i]>='0'))
f=0;
if(!f)
{
SendClientMessage(playerid,COLOR_YELLOW,"Invalid Name: Your name is not Roleplay format: Firstname_Lastname.");
Kick(playerid);
}
gActivePlayers[playerid]++;
numplayers++;
SelectFChar[playerid] = 0; SelectChar[playerid] = 0; HidePM[playerid] = 0; PhoneOnline[playerid] = 0;
SelectFCharID[playerid] = 0; SelectCharID[playerid] = 0; SelectCharPlace[playerid] = 0; ChosenSkin[playerid] = 0;
GettingJob[playerid] = 0; GuardOffer[playerid] = 999; HomeOffer[playerid] = 999; GuardPrice[playerid] = 0;
ApprovedLawyer[playerid] = 0; CallLawyer[playerid] = 0; WantLawyer[playerid] = 0;
KickPlayer[playerid] = 0; CurrentMoney[playerid] = 0; UsedFind[playerid] = 0;
CP[playerid] = 0; Robbed[playerid] = 0; DefendOffer[playerid] = 999; DefendPrice[playerid] = 0;
CarOffer[playerid] = 999; CarPrice[playerid] = 0; CarID[playerid] = 0; CarCalls[playerid] = 0;
RobbedTime[playerid] = 0; MoneyMessage[playerid] = 0; Condom[playerid] = 0; Safeweapon[playerid] = 0;
STDPlayer[playerid] = 0; SexOffer[playerid] = 999; SexPrice[playerid] = 0; HandOffer[playerid] = 999; HandNr[playerid] = 0;
RepairOffer[playerid] = 999; RepairPrice[playerid] = 0; RepairCar[playerid] = 0;
TalkingLive[playerid] = 255; LiveOffer[playerid] = 999; FarmerVar[playerid] = 0; FarmerPickup[playerid][0] = 0;
RefillOffer[playerid] = 999; RefillPrice[playerid] = 0;
DrugOffer[playerid] = 999; PlayerCuffed[playerid] = 0; PlayerCuffedTime[playerid] = 0;
DrugPrice[playerid] = 0; RegistrationStep[playerid] = 0; TestFishes[playerid] = 0;
DrugGram[playerid] = 0; FamilyOffer[playerid] = 999; FactionOffer[playerid] = 999;
JailPrice[playerid] = 0; HitOffer[playerid] = 999; HitVictim[playerid] = 999;
GoChase[playerid] = 999; GetChased[playerid] = 999; PlacedNews[playerid] = 0; Spectating[playerid] = 0;
BoxWaitTime[playerid] = 0; ChangePos2[playerid][1] = 0; Unspec[playerid][sLocal] = 255; FishCount[playerid] = 0;
SafeTime[playerid] = 60; TransportDuty[playerid] = 0; PlayerTied[playerid] = 0;
TaxiCallTime[playerid] = 0; MedicCallTime[playerid] = 0; MechanicCallTime[playerid] = 0;
FindTimePoints[playerid] = 0; FindTime[playerid] = 0; JobDuty[playerid] = 0; MWanted[playerid] = 999;
Mobile[playerid] = 255; Music[playerid] = 0; BoxOffer[playerid] = 999; PlayerBoxing[playerid] = 0;
Spectate[playerid] = 500; PlayerStonedTime[playerid] = 0; MedicCaller[playerid] = 999;
WritingPaper[playerid] = 0; WritingPaperNumber[playerid] = 999; WritingLine[playerid] = 0; BringingPaper[playerid] = 0; GotPaper[playerid] = 0;
PaperOffer[playerid] = 999; TaxiAccepted[playerid] = 999; sprunk[playerid] = 0; sprunkuse[playerid] = 0;
gLastCar[playerid] = 0; gSpeedo[playerid] = 0; gGas[playerid] = 1; beer[playerid] = 0; beeruse[playerid] = 0;
gOoc[playerid] = 0; gNews[playerid] = 0; BigEar[playerid] = 0; gDice[playerid] = 0; gFam[playerid] = 0; gNewb[playerid] = 0;
gPlayerLogged[playerid] = 0; gPlayerLogTries[playerid] = 0; gPlayerAccount[playerid] = 0; drink[playerid] = 0; drinkuse[playerid] = 0;
PlayerTazeTime[playerid] = 0; PlayerStoned[playerid] = 0; MatsHolding[playerid] = 0; TutTime[playerid] = 0;
TicketOffer[playerid] = 999; TicketMoney[playerid] = 0; sprunkuse[playerid] = 0; sprunk[playerid] = 0; drinkuse[playerid] = 0;
PlayerInfo[playerid][pCash] = dollah; NoFuel[playerid] = 0; change[playerid] = 0; beeruse[playerid] = 0; drink[playerid] = 0;
HireCar[playerid] = 999; PlayersChannel[playerid] = 999; guntime[playerid] = 0; drugtime[playerid] = 0; beer[playerid] = 0;
TransportValue[playerid] = 0; TransportMoney[playerid] = 0; TransportTime[playerid] = 0; TransportCost[playerid] = 0; TransportDriver[playerid] = 999;
PlayerPaintballing[playerid] = 0; PlayerPaintballKills[playerid] = 0; bombstatus[playerid] = 0;
Fishes[playerid][pLastFish] = 0; Fishes[playerid][pFishID] = 0; PlayerIsSweeping[playerid] = 0;
ProposeOffer[playerid] = 999; MarryWitness[playerid] = 999; MarryWitnessOffer[playerid] = 999; MarriageCeremoney[playerid] = 0; ProposedTo[playerid] = 999; GotProposedBy[playerid] = 999; DivorceOffer[playerid] = 999;
GivePlayerCash(playerid,PlayerInfo[playerid][pCash]);
PlayerInfo[playerid][pLevel] = 0;
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pBanned] = 0;
PlayerInfo[playerid][pDonateRank] = 0;
PlayerInfo[playerid][gPupgrade] = 0;
PlayerInfo[playerid][pConnectTime] = 0;
PlayerInfo[playerid][pReg] = 0;
PlayerInfo[playerid][pSex] = 0;
PlayerInfo[playerid][pAge] = 0;
PlayerInfo[playerid][pExp] = 0;
PlayerInfo[playerid][pAccount] = 0;
PlayerInfo[playerid][pCrimes] = 0;
PlayerInfo[playerid][pKills] = 0;
PlayerInfo[playerid][pDeaths] = 0;
PlayerInfo[playerid][pArrested] = 0;
PlayerInfo[playerid][pPhoneBook] = 0;
PlayerInfo[playerid][pLottoNr] = 0;
PlayerInfo[playerid][pFishes] = 0;
PlayerInfo[playerid][pBiggestFish] = 0;
PlayerInfo[playerid][pJob] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pHeadValue] = 0;
PlayerInfo[playerid][pJailed] = 0;
PlayerInfo[playerid][pJailTime] = 0;
PlayerInfo[playerid][pMats] = 0;
PlayerInfo[playerid][pPot] = 0;
PlayerInfo[playerid][pCrack] = 0;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pFMember] = 255;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pPnumber] = 0;
PlayerInfo[playerid][pSkin] = 0;
PlayerInfo[playerid][pDetSkill] = 0;
PlayerInfo[playerid][pSexSkill] = 0;
PlayerInfo[playerid][pBoxSkill] = 0;
PlayerInfo[playerid][pLawSkill] = 0;
PlayerInfo[playerid][pMechSkill] = 0;
PlayerInfo[playerid][pJackSkill] = 0;
PlayerInfo[playerid][pCarSkill] = 0;
PlayerInfo[playerid][pNewsSkill] = 0;
PlayerInfo[playerid][pDrugsSkill] = 0;
PlayerInfo[playerid][pFishSkill] = 0;
PlayerInfo[playerid][pArmsSkill] = 0;
PlayerInfo[playerid][pSmugglerSkill] = 0;
PlayerInfo[playerid][pSHealth] = 0;
PlayerInfo[playerid][pHealth] = 50.0;
PlayerInfo[playerid][pArmour] = 0.0;
PlayerInfo[playerid][pPos_x] = 745.3572;
PlayerInfo[playerid][pPos_y] = -1753.6764;
PlayerInfo[playerid][pPos_z] = 13.0703;
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pVW] = 0;
PlayerInfo[playerid][pLocal] = 255;
PlayerInfo[playerid][pSkin] = 0;
PlayerInfo[playerid][pPhousekey] = 255;
PlayerInfo[playerid][pPbiskey] = 255;
PlayerInfo[playerid][pCarLic] = 1;
PlayerInfo[playerid][pFlyLic] = 1;
PlayerInfo[playerid][pBoatLic] = 1;
PlayerInfo[playerid][pFishLic] = 1;
PlayerInfo[playerid][pGunLic] = 1;
PlayerInfo[playerid][pGun0] = 0;
PlayerInfo[playerid][pGun1] = 0;
PlayerInfo[playerid][pGun2] = 0;
PlayerInfo[playerid][pGun3] = 0;
PlayerInfo[playerid][pGun4] = 0;
PlayerInfo[playerid][pGun5] = 0;
PlayerInfo[playerid][pGun6] = 0;
PlayerInfo[playerid][pGun7] = 0;
PlayerInfo[playerid][pGun8] = 0;
PlayerInfo[playerid][pGun9] = 0;
PlayerInfo[playerid][pGun10] = 0;
PlayerInfo[playerid][pGun11] = 0;
PlayerInfo[playerid][pGun12] = 0;
PlayerInfo[playerid][pCarTime] = 0;
PlayerInfo[playerid][pMechTime] = 0;
PlayerInfo[playerid][pDrugsTime] = 0;
PlayerInfo[playerid][pLawyerTime] = 0;
PlayerInfo[playerid][pLawyerFreeTime] = 0;
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayDayHad] = 0;
PlayerInfo[playerid][pCDPlayer] = 0;
PlayerInfo[playerid][pWins] = 0;
PlayerInfo[playerid][pLoses] = 0;
PlayerInfo[playerid][pTut] = 0;
PlayerInfo[playerid][pWarns] = 0;
PlayerInfo[playerid][pFuel] = 0;
PlayerInfo[playerid][pAdjustable] = 0;
PlayerInfo[playerid][pRoadblock] = 0;
PlayerInfo[playerid][pHospital] = 0;
PlayerInfo[playerid][pSpray] = 0;
PlayerInfo[playerid][pRope] = 0;
PlayerInfo[playerid][pSprunk] = 0;
PlayerInfo[playerid][pCigar] = 0;
PlayerInfo[playerid][pFStyle] = 0;
PlayerInfo[playerid][pWantedLevel] = 0;
PlayerInfo[playerid][pDuty] = 0;
PlayerInfo[playerid][pCarLock] = 0;
OnPizzaMission[playerid] = 0;
OnPizzaTimeLeft[playerid] = 0;
OnPizzaPizzasLeft[playerid] = 0;
OnPizzaTimeOffBike[playerid] = 0;
HasJustSpawned[playerid] = 0;
PlayerTazed[playerid] = 0;
ClearCrime(playerid);
ResetPlayerWeapons(playerid);
RestoreWeapons(playerid);
ClearFishes(playerid);
ClearMarriage(playerid);
ClearHit(playerid);
HouseEntered[playerid] = 255;
SetPlayerColor(playerid,COLOR_GRAD2);
SetPlayerColor(playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
SetPlayerMapIcon( playerid, 1, 2227.4419,-1715.6887,13.5317, 56, 0 ); // Gym
SetPlayerMapIcon( playerid, 2, 1176.6060,-1323.7875,14.0296, 22, 0 ); // Hospital
SetPlayerMapIcon( playerid, 3, 2029.2358,-1406.6061,17.2043,22,3); // Hospital (2)
SetPlayerMapIcon( playerid, 4, 2169.9661,-1675.4901,15.0859, 24, 0 ); // Drug Den
SetPlayerMapIcon( playerid, 5, 2352.0559,-1167.7043,27.7435, 16, 0 ); // Crack House
SetPlayerMapIcon( playerid, 6, 2164.9724,-1675.4099,15.0859,56,3); // Drug Dealer Job
SetPlayerMapIcon( playerid, 7, -2050.8962,460.0262,35.1719,56,3); // Paper Boy Job
SetPlayerMapIcon( playerid, 8, 1381.1366,-1088.8246,27.3906,56,3); // Lawyer Job
SetPlayerMapIcon( playerid, 9, 2421.6016,-1218.8038,36.0313,56,3); // Whore Job
SetPlayerMapIcon( playerid, 10, 2494.0708,-1464.7120,24.0255,56,3); // Street Sweeper Job
SetPlayerMapIcon( playerid, 11, 2132.9058,-1150.3094,29.2660,55,3); // Buycar Place
SetPlayerMapIcon( playerid, 12, 1742.9449,-1863.4119,13.5751,56,3); // Taxi Driver Job
SetPlayerMapIcon( playerid, 13, 2329.9788,-2315.4275,13.5469,56,3); // Mechanic Job
SetPlayerMapIcon( playerid, 14, -60.0301,83.4330,3.1172,56,3); // Farmer Job
SetPlayerMapIcon( playerid, 16, 1567.8070,-1692.0651,5.8906,30,3); // Police
SetPlayerMapIcon( playerid, 17, 1462.6630,-1012.4604,26.8438,52,3); // Bank
SetPlayerMapIcon( playerid, 18, 1353.1787,-1755.5480,13.3537,17,3); // 24-7 (1)
SetPlayerMapIcon( playerid, 19, 1831.0804,-1843.0154,13.5781,17,3); // 24-7 (2)
SetPlayerMapIcon( playerid, 20, 1315.1761,-900.6654,39.5781,17,3); // 24-7 (3)
SetPlayerMapIcon( playerid, 21, 691.8580,-547.0176,16.3359,17,3); // 24-7 (4)
SetPlayerMapIcon( playerid, 22, 1257.5806,204.4285,19.7174,17,3); // 24-7 (5) Montomery
SetPlayerMapIcon( playerid, 23, 1000.2641,-920.0627,45.6062,17,3); // 24-7 (6)
SetPlayerMapIcon( playerid, 24, 1458.8176,-1139.4344,24.0662,45,3); // Clothes
SetPlayerMapIcon( playerid, 25, 628.6774,-572.3161,17.1038,30,3); // Police in Dillimore
SetPlayerMapIcon( playerid, 26, 54.3987,-293.4884,1.6421,11,3); // Drug Factory
SetPlayerMapIcon( playerid, 27, 1752.4385,-1458.7010,13.5469,20,3); // Fire Department
SetPlayerMapIcon( playerid, 28, 1294.6450,235.9305,19.5547,50,3); // Restaurt Montomery
SetPlayerMapIcon( playerid, 30, 2288.1035,-1105.5369,37.9766,51,3); // Material Factory 2
SetPlayerMapIcon( playerid, 31, 2244.3589,-1665.3157,15.4766,45,3); // Binco Clothes
SetPlayerMapIcon( playerid, 32, 383.2222,-2076.7307,7.8359,9,3); // Fish Place
SetPlayerMapIcon( playerid, 33, 2303.4009,-16.2512,26.4844,52,3); // Bank Palomino
new plname[MAX_PLAYER_NAME];
new string[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "%s.ini", plname);
if(fexist(string))
{
gPlayerAccount[playerid] = 1;
new loginstring[128];
new loginname[64];
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: That name is registered, please wait to login");
SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now login by typing your password below");
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"Welcome to Simple Life Roleplay\nThat name is registered. please enter your password below");
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
return 1;
}
else
{
gPlayerAccount[playerid] = 0;
new regstring[128];
new regname[64];
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: That name is not registered, please wait to register");
SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now register by typing your password below");
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Welcome to Simple Life Roleplay\nPlease register your account by typing you password below");
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit");
return 1;
}
}
return 1;
}