17.09.2012, 15:36
When Im Connected To The Server The Commands Doesn't Work,public OnPlayerConnect:
PHP код:
public OnPlayerConnect(playerid)
{
new vehid = GetPlayerVehicleID(playerid)
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw0);
pTazed[playerid] = 0;
pTazer[playerid] = 0;
TazerAcceso[playerid] = 0;
C4Plant[vehid] = 0;
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
WPlayer[playerid][pGun1] = dini_Int(wpfile(playerid), "Gunlist1");
WPlayer[playerid][pGun2] = dini_Int(wpfile(playerid), "Gunlist2");
WPlayer[playerid][pGun3] = dini_Int(wpfile(playerid), "Gunlist3");
WPlayer[playerid][pGun4] = dini_Int(wpfile(playerid), "Gunlist4");
WPlayer[playerid][pGun5] = dini_Int(wpfile(playerid), "Gunlist5");
WPlayer[playerid][pGun6] = dini_Int(wpfile(playerid), "Gunlist6");
WPlayer[playerid][pGun7] = dini_Int(wpfile(playerid), "Gunlist7");
WPlayer[playerid][pGun8] = dini_Int(wpfile(playerid), "Gunlist8");
WPlayer[playerid][pGun9] = dini_Int(wpfile(playerid), "Gunlist9");
WPlayer[playerid][pGun10] = dini_Int(wpfile(playerid), "Gunlist10");
WPlayer[playerid][pGun11] = dini_Int(wpfile(playerid), "Gunlist11");
WPlayer[playerid][pGun12] = dini_Int(wpfile(playerid), "Gunlist12");
WPlayer[playerid][pGun13] = dini_Int(wpfile(playerid), "Gunlist13");
WPlayer[playerid][pGun14] = dini_Int(wpfile(playerid), "Gunlist14");
WPlayer[playerid][pGun15] = dini_Int(wpfile(playerid), "Gunlist15");
WPlayer[playerid][pGun16] = dini_Int(wpfile(playerid), "Gunlist16");
WPlayer[playerid][pGun17] = dini_Int(wpfile(playerid), "Gunlist17");
WPlayer[playerid][pGun18] = dini_Int(wpfile(playerid), "Gunlist18");
WPlayer[playerid][pGun19] = dini_Int(wpfile(playerid), "Gunlist19");
WPlayer[playerid][pGun20] = dini_Int(wpfile(playerid), "Gunlist20");
WPlayer[playerid][pGun21] = dini_Int(wpfile(playerid), "Gunlist21");
WPlayer[playerid][pGun22] = dini_Int(wpfile(playerid), "Gunlist22");
WPlayer[playerid][pGun23] = dini_Int(wpfile(playerid), "Gunlist23");
WPlayer[playerid][pGun24] = dini_Int(wpfile(playerid), "Gunlist24");
WPlayer[playerid][pGun25] = dini_Int(wpfile(playerid), "Gunlist25");
WPlayer[playerid][pGun26] = dini_Int(wpfile(playerid), "Gunlist26");
WPlayer[playerid][pGun27] = dini_Int(wpfile(playerid), "Gunlist27");
WPlayer[playerid][pGun28] = dini_Int(wpfile(playerid), "Gunlist28");
WPlayer[playerid][pGun29] = dini_Int(wpfile(playerid), "Gunlist29");
new string2[64];
new playername2[MAX_PLAYER_NAME];
new playernamesplit[3][MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
split(playername2, playernamesplit, '_');
format(string2, sizeof(string2), "users/%s.ini", playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
new PassData[256];
new keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Key" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}
}
if(Security != 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Host has broken one of the Agreement rules, action has been taken.");
Kick(playerid);
return 1;
}
new namestring = strfind(plname, "_", true);
if(namestring == -1)
{
SendClientMessage(playerid, COLOR_YELLOW2, "SERVER: Your name must be in the format Firstname_Lastname.");
Kick(playerid);
return 1;
}
//
ScriptWeaponsUpdated[playerid] = 0;
new Country[256];
GetPlayerCountry(playerid,Country);
new mess[256],IP[256];
GetPlayerIp(playerid,IP,sizeof(IP));
format(mess,sizeof(mess),"%s has joined the server.[Country: %s |IP Address: %s |Ping: %i ]",plname,Country,IP,GetPlayerPing(playerid));
printf(mess);
//if(playerid > MAX_PLAYERS) return Kick(playerid);
//
gActivePlayers[playerid]++;
numplayers++;
new string[MAX_PLAYER_NAME];
veh1[playerid] = 999; veh2[playerid] = 999;
SelectChar[playerid] = 0; HidePM[playerid] = 0; PhoneOnline[playerid] = 0;
SelectCharID[playerid] = 0; SelectCharPlace[playerid] = 0; ChosenSkin[playerid] = 0;
GettingJob[playerid] = 0;
KickPlayer[playerid] = 0; UsedFind[playerid] = 0;
CP[playerid] = 0; LCP[playerid] = 0; VCP[playerid] = 0; Robbed[playerid] = 0; SpawnChange[playerid] = 1;
CarOffer[playerid] = 999; CarPrice[playerid] = 0; CarID[playerid] = 0;
RobbedTime[playerid] = 0; MoneyMessage[playerid] = 0; Condom[playerid] = 0; Rope[playerid] = 0;
STDPlayer[playerid] = 0; PlayerEaten[playerid] = 0; FishWait[playerid] = 0; SignalWait[playerid] = 0; TeleWait[playerid] = 0; Kerchief[playerid] = false;
FakeDriv[playerid] = false; FakeFly[playerid] = false; FakeWep[playerid] = false;
RepairOffer[playerid] = 999; RepairPrice[playerid] = 0; RepairCar[playerid] = 0;
ColorOffer[playerid]=999; ColorPrice[playerid]=0; ColorKind[playerid]=0; ColorCar[playerid]=0;
TalkingLive[playerid] = 255; LiveOffer[playerid] = 999; TakingLesson[playerid] = 0;
RefillOffer[playerid] = 999; RefillPrice[playerid] = 0; MapIconsShown[playerid] = 0;
DrugOffer[playerid] = 999; PlayerCuffed[playerid] = 0; PlayerCuffedTime[playerid] = 0;
DrugPrice[playerid] = 0; RegistrationStep[playerid] = 0; OnCK[playerid] = 999; GettingCK[playerid] = 999;
DrugGram[playerid] = 0; ConnectedToPC[playerid] = 0; OrderReady[playerid] = 0; DrugKind[playerid] = 0;
JailPrice[playerid] = 0; MedicTime[playerid] = 0; NeedMedicTime[playerid] = 0; MedicBill[playerid] = 0; GotHit[playerid] = 0;
WantedPoints[playerid] = 0; GoChase[playerid] = 999; GetChased[playerid] = 999; PlacedNews[playerid] = 0;
OnDuty[playerid] = 0; WantedLevel[playerid] = 0;
BoxWaitTime[playerid] = 0; SchoolSpawn[playerid] = 0; ChangePos2[playerid][1] = 0;
SafeTime[playerid] = 60; TransportDuty[playerid] = 0; PlayerTied[playerid] = 0;
BusCallTime[playerid] = 0; TaxiCallTime[playerid] = 0; MedicCallTime[playerid] = 0; MechanicCallTime[playerid] = 0;
BusrouteEast[playerid][0] = 0; BusrouteWest[playerid][0] = 0; BusShowLocation[playerid][0] = 0; BusShowLocationC[playerid] = 0;
FindTimePoints[playerid] = 0; FindTime[playerid] = 0; JobDuty[playerid] = 0;
Mobile[playerid] = 255; Music[playerid] = 0; BoxOffer[playerid] = 999; PlayerBoxing[playerid] = 0; BoxBet[playerid] = 0;
Spectate[playerid] = 255; //PlayerDrunk[playerid] = 0; PlayerDrunkTime[playerid] = 0;
Unspec[playerid][sLocal] = 255; FishCount[playerid] = 0;
WritingPaper[playerid] = 0; WritingPaperNumber[playerid] = 999; WritingLine[playerid] = 0; BringingPaper[playerid] = 0; GotPaper[playerid] = 0;
PaperOffer[playerid] = 999; /*ConsumingMoney[playerid] = 0;*/
ScriptMoney[playerid] = 0; ScriptMoneyUpdated[playerid] = 0;
for (new c=0; c<13; c++) ScriptWeapons[playerid][c] = 0;
ScriptWeaponsUpdated[playerid] = 0; Specing[playerid] = 0;
gLastCar[playerid] = 0; FirstSpawn[playerid] = 1;
gOoc[playerid] = 0; gNews[playerid] = 0; BigEar[playerid] = 0; gDice[playerid] = 0; gFam[playerid] = 0; gCFam[playerid]=0;
gSpeedo[playerid] = 0; gGas[playerid] = 1;
gPlayerLogged[playerid] = 0; AC_gPlayerLoggedx(playerid,0); gPlayerLogTries[playerid] = 0; gPlayerAccount[playerid] = 0;
gPlayerSpawned[playerid] = 0; PlayerKarting[playerid] = 0; PlayerInKart[playerid] = 0;
PlayerTazeTime[playerid] = 0; PlayerStoned[playerid] = 0;
StartTime[playerid] = 0; TicketOffer[playerid] = 999; TicketMoney[playerid] = 0;
MatsHolding[playerid] = 0; TutTime[playerid] = 0; IsOnUnderCover[playerid]=false; SeatBelt[playerid]=false;
TaxiAccepted[playerid] = 999; BusAccepted[playerid] = 999; Trace[playerid]=999; DTracker[playerid] = 999; DMole[playerid] = 999;
PlayerInfo[playerid][pCash] = dollah; NoFuel[playerid] = 0;
HireCar[playerid] = 299; GangCar[playerid] = 512; dying[playerid] = 0;
TransportValue[playerid] = 0; TransportMoney[playerid] = 0; TransportTime[playerid] = 0; TransportCost[playerid] = 0; TransportDriver[playerid] = 999;
Locator[playerid] = 0;
WatchingTV[playerid] = 0; PlayerPaintballing[playerid] = 0; PlayerPaintballKills[playerid] = 0;
ProposeOffer[playerid] = 999; MarryWitness[playerid] = 999; MarryWitnessOffer[playerid] = 999; MarriageCeremoney[playerid] = 0; ProposedTo[playerid] = 999; GotProposedBy[playerid] = 999; DivorceOffer[playerid] = 999;
//GiveCash(playerid,PlayerInfo[playerid][pCash]);
PizzaCallTime[playerid] = 0; bPizza[playerid] = 0; sPizza[playerid] = 0; FarmerVar[playerid] = 0; FarmerPickup[playerid][0] = 0; SmugglerWork[playerid] = 0; SmuggledDrugs[playerid] = 0; JustDied[playerid] = 0; KnockedDown[playerid] = 0; UnidentifedCall[playerid] = 0;
LicenseOffer[playerid] = 999; LicensePrice[playerid] = 0; LicenseType[playerid] = 0; UsingDrugs[playerid] = 0; AfterTutorial[playerid] = 0;
BlindFold[playerid] = 0; PlayerIsSweeping[playerid] = 0; AdminDuty[playerid] = 0; HelperDuty[playerid] = 0; PlayerNeedsHelp[playerid] = 0; AdminSpec[playerid] = 0; IsSmoking[playerid] = 0; UsingSmokeAnim[playerid] = 0; ReduceTime[playerid] = 0;
CreatingGun[playerid] = 0; CreatingGunAmmo[playerid] = 0; CreatingGunPrice[playerid] = 0; IsPuttingMaterials[playerid] = 0; IsTakingGun[playerid] = 0; lseconds[playerid]=60;
InAFoodPlace[playerid] = 0;
PlayerInfo[playerid][pLevel] = 0;
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pHelper] = 0;
PlayerInfo[playerid][pDonateRank] = 0;
PlayerInfo[playerid][pBMX] = 0;
PlayerInfo[playerid][gPupgrade] = 0;
PlayerInfo[playerid][pConnectTime] = 0;
PlayerInfo[playerid][pEat] = 0;
PlayerInfo[playerid][pReg] = 0;
PlayerInfo[playerid][pSex] = 0;
PlayerInfo[playerid][pHMoney] = 0;
PlayerInfo[playerid][pAge] = 0;
PlayerInfo[playerid][pOrigin] = 0;
PlayerInfo[playerid][pExp] = 0;
PlayerInfo[playerid][pAccount] = 0;
PlayerInfo[playerid][pCrimes] = 0;
PlayerInfo[playerid][pDeaths] = 0;
PlayerInfo[playerid][pArrested] = 0;
PlayerInfo[playerid][pWantedDeaths] = 0;
PlayerInfo[playerid][pPhoneBook] = 0;
PlayerInfo[playerid][pLottoNr] = 0;
PlayerInfo[playerid][pJob] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pHeadValue] = 0;
PlayerInfo[playerid][pJailed] = 0;
PlayerInfo[playerid][pJailCell] = 0;
PlayerInfo[playerid][pJailTime] = 0;
PlayerInfo[playerid][pMats] = 0;
//PlayerInfo[playerid][pDrugs] = 0;
PlayerInfo[playerid][pWeed] = 0;
PlayerInfo[playerid][pCocaine] = 0;
PlayerInfo[playerid][pCrack] = 0;
PlayerInfo[playerid][pHeroin] = 0;
PlayerInfo[playerid][pEcstacy] = 0;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pFMember] = 0;
PlayerInfo[playerid][pFLeader] = 0;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pContractTime] = 0;
PlayerInfo[playerid][pBoxSkill] = 0;
PlayerInfo[playerid][pSHealth] = 0.0;
PlayerInfo[playerid][pHealth] = 50.0;
PlayerInfo[playerid][pPos_x] = 1612.3240;
PlayerInfo[playerid][pPos_y] = -2330.1670;
PlayerInfo[playerid][pPos_z] = 13.5469;
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
PlayerInfo[playerid][pTeam] = 3;
PlayerInfo[playerid][pModel] = 7;
new randphone = 100000 + random(899999);//minimum 1000 max 9999 //giving one at the start
PlayerInfo[playerid][pPnumber] = randphone;
PlayerInfo[playerid][pPcarkey] = 0;
PlayerInfo[playerid][pPcarkey2] = 0;
PlayerInfo[playerid][pPcarkey3] = 0;
PlayerInfo[playerid][pPhousekey] = 255;
PlayerInfo[playerid][pGangKey] = 255;
PlayerInfo[playerid][pPbiskey] = 255;
PlayerInfo[playerid][pCarLic] = 0;
PlayerInfo[playerid][pFlyLic] = 0;
PlayerInfo[playerid][pGunLic] = 0;
PlayerInfo[playerid][pCarTime] = 0;
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayDayPU] = 0;
PlayerInfo[playerid][pPayDayHad] = 0;
PlayerInfo[playerid][pWatch] = 0;
PlayerInfo[playerid][pBag] = 0;
PlayerInfo[playerid][pCrashed] = 0;
PlayerInfo[playerid][pWins] = 0;
PlayerInfo[playerid][pLoses] = 0;
PlayerInfo[playerid][pAlcoholPerk] = 0;
PlayerInfo[playerid][pDrugPerk] = 0;
PlayerInfo[playerid][pMiserPerk] = 0;
PlayerInfo[playerid][pPainPerk] = 0;
PlayerInfo[playerid][pTraderPerk] = 0;
PlayerInfo[playerid][pTut] = 0;
PlayerInfo[playerid][pWarns] = 0;
PlayerInfo[playerid][pFuel] = 0;
PlayerInfo[playerid][pGasCan] = 0;
PlayerInfo[playerid][pSwat] = 0;
PlayerInfo[playerid][pVirWorld] = 0;
PlayerInfo[playerid][pRequestingBackup] = 0;
PlayerInfo[playerid][pRoadblock] = 0;
PlayerInfo[playerid][pFishTool] = 0;
strmid(PlayerInfo[playerid][pNote1], "None", 0, strlen("None"), 255);
PlayerInfo[playerid][pNote1s] = 0;
strmid(PlayerInfo[playerid][pNote2], "None", 0, strlen("None"), 255);
PlayerInfo[playerid][pNote2s] = 0;
strmid(PlayerInfo[playerid][pNote3], "None", 0, strlen("None"), 255);
PlayerInfo[playerid][pNote3s] = 0;
strmid(PlayerInfo[playerid][pNote4], "None", 0, strlen("None"), 255);
PlayerInfo[playerid][pNote4s] = 0;
strmid(PlayerInfo[playerid][pNote5], "None", 0, strlen("None"), 255);
PlayerInfo[playerid][pNote5s] = 0;
PlayerInfo[playerid][pLighter] = 0;
PlayerInfo[playerid][pCigarettes] = 0;
PlayerInfo[playerid][pMask] = 1;
PlayerInfo[playerid][pToolkit] = 0;
PlayerInfo[playerid][pMaskuse] = 0;
PlayerInfo[playerid][pHideNumber] = 0;
PlayerInfo[playerid][pSpeaker] = 0;
PlayerInfo[playerid][pLocked] = 0;
PlayerInfo[playerid][pWT] = 0;
PlayerInfo[playerid][pWTc] = 0;
strmid(PlayerInfo[playerid][pAccent], "None", 0, strlen("None"), 255);
strmid(PlayerInfo[playerid][pPrisonDate], "00/00/00", 0, strlen("00/00/00"), 255);
strmid(PlayerInfo[playerid][pFakeName], "None", 0, strlen("None"), 255);
PlayerInfo[playerid][pDrivWarn] = 0;
PlayerInfo[playerid][pGenWarn] = 0;
PlayerInfo[playerid][pLang1] = 0;
PlayerInfo[playerid][pLang2] = 0;
new str[256];
GetPlayerName(playerid, plname, sizeof(plname));
format(str, sizeof(str), "Vehicles/Players/%s.cfg", plname);
if(dini_Exists(str))
{
strmid(PlayerVehicle[playerid][pVeh1], dini_Get(str, "Vehicle1"), 0, strlen(dini_Get(str, "Vehicle1")), 255);
strmid(PlayerVehicle[playerid][pVeh2], dini_Get(str, "Vehicle2"), 0, strlen(dini_Get(str, "Vehicle2")), 255);
// pToolkit[playerid] = dini_Int(str, "Toolkit");
//return 1;
}
else
{
dini_Create(str);
strmid(PlayerVehicle[playerid][pVeh1], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh2], "None", 0, strlen("None"), 255);
//return 1;
}
for(new iv = 0; iv < MAX_VEHICLES; iv++)
{
if(VehicleInfo[iv][vOwned] == 1)
{
if(!strcmp(plname, VehicleInfo[iv][vOwner], true))
{
format(str, sizeof(str), "%s.%s", plname, VehicleNames[GetVehicleModel(iv)-400]);
if(strcmp(str, PlayerVehicle[playerid][pVeh1], true) == 0)
{
veh1[playerid] = iv;
}
else if(strcmp(str, PlayerVehicle[playerid][pVeh2], true) == 0)
{
veh2[playerid] = iv;
}
break ;
}
}
}
pColor[playerid] = -1;
pToAccept[playerid] = 255;
vToAccept[playerid] = 999;
prToAccept[playerid] = 0;
//
ClearCrime(playerid);
//ClearCooking(playerid);
ClearGroceries(playerid);
ClearMarriage(playerid);
SetPlayerColor(playerid,COLOR_GRAD2);
HouseEntered[playerid] = 255;
BizEntered[playerid] = 255;
//map icons
SetPlayerMapIcon(playerid, 1, 592.6260,-1510.6340,28.6099, 55, COLOR_YELLOW); // Driving School
SetPlayerMapIcon(playerid, 20, 1357.2695,-1647.8325,30.2789, 20, COLOR_YELLOW); // Fire Department
SetPlayerMapIcon(playerid, 5, 396.2429, -2074.728, 7.835938, 25, COLOR_YELLOW); // Fishing School
SetPlayerMapIcon(playerid, 6, 1528.779, -1678.113, 5.890625, 30, COLOR_YELLOW); // Police Station
SetPlayerMapIcon(playerid, 7,609.1711,-1241.8591,64.1859, 52, COLOR_YELLOW); // Bank
SetPlayerMapIcon(playerid, 9, 1178.03, -1323.41, 14.10, 22, COLOR_YELLOW); // Hospital
//SetPlayerMapIcon(playerid, 11, 2410.1682,-1220.7765,25.2978, 49, COLOR_YELLOW); // Pig Pen
//SetPlayerMapIcon(playerid, 12, 2312.9451,-1645.0206,14.8270, 49, COLOR_YELLOW); // Ten Green
//SetPlayerMapIcon(playerid, 14, 1498.4476,-1582.8242,13.5469, 50, COLOR_YELLOW); // Restaurant
SetPlayerMapIcon(playerid, 15, 2468.4919,-2092.9902,13.5469, 51, COLOR_YELLOW); // Truck Place
//SetPlayerMapIcon(playerid, 16, 2146.3523,-2267.7498,14.2344, 18, COLOR_YELLOW); // Gun Dealer Reg.
//SetPlayerMapIcon(playerid, 17, 1312.4210,-898.5630,39.5781, 52, COLOR_YELLOW); // 24/7
//SetPlayerMapIcon(playerid, 18, 1832.4276,-1838.3896,13.5781, 52, COLOR_YELLOW); // 24/7
//SetPlayerMapIcon(playerid, 19, 1353.6860,-1757.4297,13.5078, 52, COLOR_YELLOW); // 24/7
//SetPlayerMapIcon(playerid, 19, 3588.6843,-1557.0931,3.9948, 19, COLOR_YELLOW); // Prison
SetPlayerMapIcon(playerid, 21, 2105.4858,-1806.4725,13.5547, 29, COLOR_YELLOW); // Pizza stack
//SetPlayerMapIcon(playerid, 22, 2229.9011,-1721.2582,13.5613, 54, COLOR_YELLOW); // Gym
SetPlayerMapIcon(playerid, 23, 2244.3423,-1665.5542,15.4766, 45, COLOR_YELLOW); // Binco
SetPlayerMapIcon(playerid, 25, 2793.02, -1807.42, 30.72, 45, COLOR_YELLOW); // Security
/*for(new h = 184; h < sizeof(CarInfo); h++)
{
SetVehicleParamsForPlayer(h,playerid,0,CarInfo[h][cLock]);
}*/
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "users/%s.ini", plname);
SendClientMessage(playerid, COLOR_WHITE, "Welcome to Nexus RolePlay ,please wait...");
AC_OnPlayerConnect(playerid);
UpdateID();
if(!fexist(string))
{
gPlayerAccount[playerid] = 0;
}
else if(fexist(string))
{
gPlayerAccount[playerid] = 1;
}
new string3[256];
format(string3, sizeof(string3), "pLogs/%s.admin.log", plname);
if(!fexist(string3))
fcreate(string3);
format(string3, sizeof(string3), "pLogs/%s.crime.log", plname);
if(!fexist(string3))
fcreate(string3);
return 1;
}