Код:
public OnPlayerConnect(playerid) {
if(IsPlayerNPC(playerid)) return 1;
g_arrQueryHandle{playerid} = random(256);
TotalConnect++;
if(Iter_Count(Player) > MaxPlayersConnected) {
MaxPlayersConnected = Iter_Count(Player);
getdate(MPYear,MPMonth,MPDay);
}
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
SetPVarInt(playerid, "IsInArena", -1);
SetPVarInt(playerid, "ArenaNumber", -1);
SetPVarInt(playerid, "ArenaEnterPass", -1);
SetPVarInt(playerid, "ArenaEnterTeam", -1);
SetPVarInt(playerid, "EditingTurfs", -1);
SetPVarInt(playerid, "EditingTurfsStage", -1);
SetPVarInt(playerid, "EditingHillStage", -1);
SetPVarInt(playerid, "EditingFamC", -1);
SetPVarInt(playerid, "editingfamhq", INVALID_FAMILY_ID);
SetPVarInt(playerid, "UsingSurfAttachedObject", -1);
SetPVarInt(playerid, "UsingBriefAttachedObject", -1);
SetPVarInt(playerid, "AOSlotPaintballFlag", -1);
SetPVarInt(playerid, "MovingStretcher", -1);
SetPVarInt(playerid, "DraggingPlayer", INVALID_PLAYER_ID);
SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
SetPVarInt(playerid, "ttBuyer", INVALID_PLAYER_ID);
SetPVarInt(playerid, "ttCost", 0);
SetPVarInt(playerid, "buyingVoucher", INVALID_PLAYER_ID);
SetPVarInt(playerid, "sellerVoucher", INVALID_PLAYER_ID);
SetPVarInt(playerid, "buyerVoucher", INVALID_PLAYER_ID);
SetPVarInt(playerid, "AccountSaving", 0);
SetPVarInt(playerid, "AccountSaved", 0);
DeletePVar(playerid, "BeingDragged");
DeletePVar(playerid, "PlayerCuffed");
DeletePVar(playerid, "COMMUNITY_ADVISOR_REQUEST");
SetPVarInt(playerid,"DaLoadXong",0);
SetPVarInt(playerid,"TickUpMau",GetTickCount());
DeletePVar(playerid,"OldHealth");
DeletePVar(playerid,"OldArmour");
DeletePVar(playerid, "Injured");
DeletePVar(playerid,"costs");
DeletePVar(playerid,"edits");
DeletePVar(playerid, "gID");
DeletePVar(playerid, "Furniture_Price");
DeletePVar(playerid, "Furniture_Cost");
DeletePVar(playerid, "Furniture_Slot");
DeletePVar(playerid, "Furniture_Edit");
DeletePVar(playerid, "House_ID");
DeletePVar(playerid, "SpraySoundSteps");
DeletePVar(playerid, "SprayTagID");
DeletePVar(playerid, "SprayString");
GunPrice[playerid] = 0;
HackingMods[playerid] = 0;
pSpeed[playerid] = 0.0;
for(new i = 0; i < 10; i ++)
{
Profile_TD[playerid][i] = PlayerText:INVALID_TEXT_DRAW;
}
DeletePVar(playerid, "GetStats");
DeletePVar(playerid, "GetStats_Page");
DeletePVar(playerid, "GetStats_TargetID");
for(new i = 0; i < 3; i++) {
StopaniFloats[playerid][i] = 0;
}
for(new i = 0; i < 3; i++) {
ConfigEventCPs[playerid][i] = 0;
}
ConfigEventCPId[playerid] = 0;
RCPIdCurrent[playerid] = 0;
for(new i = 0; i < 6; i++) {
EventFloats[playerid][i] = 0.0;
}
EventLastInt[playerid] = 0; EventLastVW[playerid] = 0;
for(new i = 0; i < MAX_PLAYERVEHICLES; ++i) {
PlayerVehicleInfo[playerid][i][pvModelId] = 0;
PlayerVehicleInfo[playerid][i][pvId] = INVALID_PLAYER_VEHICLE_ID;
PlayerVehicleInfo[playerid][i][pvSpawned] = 0;
PlayerVehicleInfo[playerid][i][pvSlotId] = 0;
}
for(new i = 0; i < MAX_PLAYERTOYS; i++) {
PlayerToyInfo[playerid][i][ptID] = -1;
PlayerToyInfo[playerid][i][ptModelID] = 0;
PlayerToyInfo[playerid][i][ptBone] = 0;
PlayerToyInfo[playerid][i][ptSpecial] = 0;
}
for(new i = 0; i < 11; i++) {
PlayerHoldingObject[playerid][i] = 0;
}
for(new i = 0; i < 5; i++) {
LottoNumbers[playerid][i] = 0;
}
for(new i = 0; i < MAX_BUSINESSSALES; i++) {
Selected[playerid][i] = 0;
}
for(new x=0; x < mS_SELECTION_ITEMS; x++) {
gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
}
for(new i = 0; i < 8; i++)
{
PlayerBalo[playerid][pBaloWeapon][i] = 0;
PlayerBalo[playerid][pBaloAmmo][i] = 0;
PlayerBalo[playerid][pBaloAmmo2][i] = 0;
}
gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
gCancelButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
SP_Timer[playerid] = -1;
SP_TimerEx[playerid] = -1;
SP_Edit[playerid] = -1;
TruckerInvite[playerid] = INVALID_PLAYER_ID;
TruckerInviteSQL[playerid] = -1;
TruckerTogetther[playerid] = INVALID_PLAYER_ID;
GarageUsing[playerid] = -1;
VTokens_Amount[playerid] = 0;
VTokens_Price[playerid] = 0;
VTokens_Seller[playerid] = INVALID_PLAYER_ID;
VTokens_Seller_SQL[playerid] = -1;
Biz_Seller[playerid] = INVALID_PLAYER_ID;
Biz_Seller_SQL[playerid] = -1;
Biz_Price[playerid] = 0;
TruckUsed[playerid] = INVALID_VEHICLE_ID;
pDrunkLevelLast[playerid] = 0;
BackupClearTimer[playerid] = 0;
Backup[playerid] = 0;
CarRadars[playerid] = 0;
CurrentArmor[playerid] = 0.0;
PlayerInfo[playerid][pReg] = 0;
TruckUsed[playerid] = INVALID_VEHICLE_ID;
HouseOffer[playerid] = INVALID_PLAYER_ID;
House[playerid] = 0;
HousePrice[playerid] = 0;
playerTabbed[playerid] = 0;
playerAFK[playerid] = 0;
gBug{playerid} = 1;
TazerTimeout[playerid] = 0;
DangDeoBaLo[playerid] = 0;
gRadio{playerid} = 1;
playerLastTyped[playerid] = 0;
pTazer{playerid} = 0;
pTazerReplace{playerid} = 0;
pCurrentWeapon{playerid} = 0;
SuaXe[playerid] = 0;
KillTimer(TimeSuaXe[playerid]);
DangSuaXe[playerid] = false;
TogTaiXiu[playerid]=true;
MedicAccepted[playerid] = INVALID_PLAYER_ID;
DefendOffer[playerid] = INVALID_PLAYER_ID;
AppealOffer[playerid] = INVALID_PLAYER_ID;
AppealOfferAccepted[playerid] = 0;
PlayerInfo[playerid][pWantedLevel] = 0;
DefendPrice[playerid] = 0;
Spectating[playerid] = 0;
GettingSpectated[playerid] = INVALID_PLAYER_ID;
PlayerInfo[playerid][pPhonePrivacy] = 0;
NewbieTimer[playerid] = 0;
HlKickTimer[playerid] = 0;
HelperTimer[playerid] = 0;
VehicleOffer[playerid] = INVALID_PLAYER_ID;
VehiclePrice[playerid] = 0;
VehicleId[playerid] = -1;
NOPTrigger[playerid] = 0;
JustReported[playerid] = -1;
UsedCrack[playerid] = 0;
UsedWeed[playerid] = 0;
SexOffer[playerid] = INVALID_PLAYER_ID;
DrinkOffer[playerid] = INVALID_PLAYER_ID;
PotOffer[playerid] = INVALID_PLAYER_ID;
PotStorageID[playerid] = -1;
CrackOffer[playerid] = INVALID_PLAYER_ID;
CrackStorageID[playerid] = -1;
GunOffer[playerid] = INVALID_PLAYER_ID;
GunStorageID[playerid] = -1;
CraftOffer[playerid] = INVALID_PLAYER_ID;
RepairOffer[playerid] = INVALID_PLAYER_ID;
GuardOffer[playerid] = INVALID_PLAYER_ID;
LiveOffer[playerid] = INVALID_PLAYER_ID;
RefillOffer[playerid] = INVALID_PLAYER_ID;
MatsOffer[playerid] = INVALID_PLAYER_ID;
VangOffer[playerid] = INVALID_PLAYER_ID;
MatsStorageID[playerid] = -1;
VangStorageID[playerid] = -1;
MatsPrice[playerid] = 0;
VangPrice[playerid] = 0;
VangAmount[playerid] = 0;
MatsAmount[playerid] = 0;
BoxOffer[playerid] = INVALID_PLAYER_ID;
ProposeOffer[playerid] = INVALID_PLAYER_ID;
DivorceOffer[playerid] = INVALID_PLAYER_ID;
HidePM[playerid] = 0;
PlayerSurfing[playerid] = 0;
PhoneOnline[playerid] = 0;
unbanip[playerid][0] = 0;
advisorchat[playerid] = 1;
ChosenSkin[playerid]=0;
SelectFChar[playerid]=0;
MatDeliver[playerid]=0;
MatDeliver2[playerid]=0;
szAdvert[playerid][0] = 0;
AdvertType[playerid] = 0;
SelectFCharPlace[playerid]=0;
GettingJob[playerid]=0;
GettingJob2[playerid]=0;
GuardOffer[playerid]= INVALID_PLAYER_ID;
GuardPrice[playerid]=0;
ApprovedLawyer[playerid]=0;
CallLawyer[playerid]=0;
WantLawyer[playerid]=0;
CurrentMoney[playerid]=0;
UsedFind[playerid]=0;
CP[playerid]=0;
Condom[playerid]=0;
SexOffer[playerid]= INVALID_PLAYER_ID;
SexPrice[playerid]=0;
PlayerInfo[playerid][pAdmin]=0;
RepairOffer[playerid]= INVALID_PLAYER_ID;
RepairPrice[playerid]=0;
RepairCar[playerid]=0;
TalkingLive[playerid]=INVALID_PLAYER_ID;
LiveOffer[playerid]= INVALID_PLAYER_ID;
RefillOffer[playerid]= INVALID_PLAYER_ID;
RefillPrice[playerid]=0;
InsidePlane[playerid]=INVALID_VEHICLE_ID;
InsideMainMenu{playerid}=0;
InsideTut{playerid}=0;
PotOffer[playerid]= INVALID_PLAYER_ID;
PotStorageID[playerid]=-1;
CrackOffer[playerid]= INVALID_PLAYER_ID;
CrackStorageID[playerid]=-1;
PlayerCuffed[playerid]=0;
PlayerCuffedTime[playerid]=0;
PotPrice[playerid]=0;
CrackPrice[playerid]=0;
RegistrationStep[playerid]=0;
PotGram[playerid]=0;
CrackGram[playerid]=0;
PlayerInfo[playerid][pBanned]=0;
ConnectedToPC[playerid]=0;
OrderReady[playerid]=0;
GunId[playerid]=0;
GunMats[playerid]=0;
CraftId[playerid]=0;
CraftMats[playerid]=0;
HitOffer[playerid]= INVALID_PLAYER_ID;
HitToGet[playerid]= INVALID_PLAYER_ID;
InviteOffer[playerid]= INVALID_PLAYER_ID;
InviteFamily[playerid]=INVALID_FAMILY_ID;
hInviteHouse[playerid]=INVALID_HOUSE_ID;
hInviteOffer[playerid]= INVALID_PLAYER_ID;
hInviteOfferTo[playerid]= INVALID_PLAYER_ID;
JailPrice[playerid]=0;
GotHit[playerid]=0;
GoChase[playerid]= INVALID_PLAYER_ID;
GetChased[playerid]= INVALID_PLAYER_ID;
CalledCops[playerid]=0;
CopsCallTime[playerid]=0;
BoxWaitTime[playerid]=0;
CalledMedics[playerid]=0;
TransportDuty[playerid]=0;
PlayerTied[playerid]=0;
MedicsCallTime[playerid]=0;
BusCallTime[playerid]=0;
TaxiCallTime[playerid]=0;
EMSCallTime[playerid]=0;
MedicCallTime[playerid]=0;
MechanicCallTime[playerid]=0;
FindTimePoints[playerid]=0;
FindingPlayer[playerid]=-1;
FindTime[playerid]=0;
JobDuty[playerid]=0;
Mobile[playerid]=INVALID_PLAYER_ID;
Music[playerid]=0;
BoxOffer[playerid]= INVALID_PLAYER_ID;
PlayerBoxing[playerid]=0;
Spectate[playerid]= INVALID_PLAYER_ID;
PlayerDrunk[playerid]=0;
PlayerDrunkTime[playerid]=0;
format(PlayerInfo[playerid][pPrisonReason],128,"None");
HelpingNewbie[playerid]= INVALID_PLAYER_ID;
turfWarsRadar[playerid]=0;
courtjail[playerid]=0;
gLastCar[playerid]=0;
FirstSpawn[playerid]=0;
JetPack[playerid]=0;
PlayerInfo[playerid][pKills]=0;
PlayerInfo[playerid][pPaintTeam]=0;
TextSpamTimes[playerid] = 0;
TextSpamUnmute[playerid] = 0;
CommandSpamTimes[playerid] = 0;
CommandSpamUnmute[playerid] = 0;
gOoc[playerid] = 0;
arr_Towing[playerid] = INVALID_VEHICLE_ID;
gNews[playerid] = 0;
gNewbie[playerid] = 1;
gHelp[playerid] = 1;
gFam[playerid] = 0;
gPlayerLogged{playerid} = 0;
gPlayerLogTries[playerid] = 0;
IsSpawned[playerid] = 0;
SpawnKick[playerid] = 0;
PlayerStoned[playerid] = 0;
PlayerInfo[playerid][pPot] = 0;
StartTime[playerid] = 0;
TicketOffer[playerid] = INVALID_PLAYER_ID;
TicketMoney[playerid] = 0;
PlayerInfo[playerid][pVehicleKeysFrom] = INVALID_PLAYER_ID;
ActiveChatbox[playerid] = 1;
TutStep[playerid] = 0;
PlayerInfo[playerid][pVehicleKeys] = INVALID_PLAYER_VEHICLE_ID;
TaxiAccepted[playerid] = INVALID_PLAYER_ID;
EMSAccepted[playerid] = INVALID_PLAYER_ID;
BusAccepted[playerid] = INVALID_PLAYER_ID;
PlayerInfo[playerid][pCrack] = 0;
HireCar[playerid] = 299;
TransportValue[playerid] = 0;
TransportMoney[playerid] = 0;
TransportTime[playerid] = 0;
TransportCost[playerid] = 0;
TransportDriver[playerid] = INVALID_PLAYER_ID;
Locator[playerid] = 0;
ReleasingMenu[playerid] = INVALID_PLAYER_ID;
ProposeOffer[playerid] = INVALID_PLAYER_ID;
MarryWitness[playerid] = INVALID_PLAYER_ID;
MarryWitnessOffer[playerid] = INVALID_PLAYER_ID;
MarriageCeremoney[playerid] = 0;
ProposedTo[playerid] = INVALID_PLAYER_ID;
GotProposedBy[playerid] = INVALID_PLAYER_ID;
DivorceOffer[playerid] = INVALID_PLAYER_ID;
gBike[playerid] = 0;
gBikeRenting[playerid] = 0;
Fixr[playerid] = 0;
VehicleSpawned[playerid] = 0;
ReportCount[playerid] = 0;
ReportHourCount[playerid] = 0;
PlayerInfo[playerid][pServiceTime] = 0;
Homes[playerid] = 0;
IsShowIpod[playerid] = false;
iIpod[playerid] = 0;
iIpodMp3Amount[playerid] = 0;
iIpodMp3HienTai[playerid] = 0;
iIpodPlayed[playerid] = 0;
iIpodNgheTrongList[playerid] = 0;
strdel(PlayerInfo[playerid][pAutoTextReply], 0, 64);
rBigEarT[playerid] = 0;
aLastShot[playerid] = INVALID_PLAYER_ID;
// These need to be reset to prevent some bugs (DO NOT REMOVE)
PlayerInfo[playerid][pModel] = 0;
PlayerInfo[playerid][pLeader] = INVALID_GROUP_ID;
PlayerInfo[playerid][pMember] = INVALID_GROUP_ID;
PlayerInfo[playerid][pDivision] = INVALID_DIVISION;
PlayerInfo[playerid][pFMember] = INVALID_FAMILY_ID;
PlayerInfo[playerid][pRank] = INVALID_RANK;
PlayerInfo[playerid][pBusiness] = INVALID_BUSINESS_ID;
acstruct[playerid][LastOnFootPosition][0] = 0.0; acstruct[playerid][LastOnFootPosition][1] = 0.0; acstruct[playerid][LastOnFootPosition][2] = 0.0;
acstruct[playerid][checkmaptp] = 0; acstruct[playerid][maptplastclick] = 0;
acstruct[playerid][maptp][0] = 0.0; acstruct[playerid][maptp][1] = 0.0; acstruct[playerid][maptp][2] = 0.0;
for(new x = 0; x < MAX_PLAYERS; x++)
{
ShotPlayer[playerid][x] = 0;
}
for(new v = 0; v < MAX_PLAYERVEHICLES; v++) {
PlayerVehicleInfo[playerid][v][pvAllowedPlayerId] = INVALID_PLAYER_ID;
}
for(new s = 0; s < 12; s++) {
PlayerInfo[playerid][pAGuns][s] = 0;
PlayerInfo[playerid][pGuns][s] = 0;
}
for(new s = 0; s < 40; s++) {
ListItemReportId[playerid][s] = -1;
}
for(new s = 0; s < 20; s++) {
ListItemRCPId[playerid][s] = -1;
}
CancelReport[playerid] = -1;
GiveKeysTo[playerid] = INVALID_PLAYER_ID;
RocketExplosions[playerid] = -1;
ClearMarriage(playerid);
for(new i =0;i<MAX_IPOD_MP3;i++)
{
format(iIpodMp3Link[playerid][i],128,"");
format(iIpodMp3Name[playerid][i],128,"");
}
// Crash Fix - GhoulSlayeR
if(!InvalidNameCheck(playerid)) {
return 1;
}
CheckBanEx(playerid);
InsideMainMenu{playerid} = 0;
InsideTut{playerid} = 0;
ShowMainMenuGUI(playerid);
SetPlayerJoinCamera(playerid);
ClearChatbox(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
SendClientMessage( playerid, COLOR_WHITE, "SERVER: Chao mung ban tham gia may chu cua chung toi." );
SyncPlayerTime(playerid);
ShowNoticeGUIFrame(playerid, 1);
RemoveBuildings(playerid);
return 1;
}