30.05.2015, 23:53
Buenas, quisiera que me dijeran que es lo que estб haciendo crashear al servidor, ya que al usar /guardarcuenta se cierra el server, pero yo no noto nada extraсo en la funciуn que guarda la informaciуn de las cuentas.
Desde ya muchas gracias.
Este es el comando:
Esta es la funciуn de OnPlayerSavedStats.
Desde ya muchas gracias.
Este es el comando:
PHP код:
command(guardarcuenta, playerid, params[]){
if(gPlayerLogged{playerid}){
if(Info[playerid][pSavedTime] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "Sуlo puedes usar este comando cada 5 minutos.");
Info[playerid][pSavedTime] = 300;
SendClientMessageEx(playerid, -1, "Tu cuenta ha sido guardada correctamente, sуlo puedes usar este comando cada 5 minutos.");
OnPlayerSavedStats(playerid);
}
return 1;
}
PHP код:
OnPlayerSavedStats(playerid)
{
if(GetPVarInt(playerid, "TempName") == 1) return 1;
if(!gPlayerLogged{playerid}) return 1;
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(INI_Exist(playername))
{
new PlayerFile[ 13 + MAX_PLAYER_NAME + 1];
format( PlayerFile , sizeof PlayerFile, USERFILE, playername);
new INI:File = INI_Open(PlayerFile);
INI_SetTag(File,"data");
INI_WriteInt(File,"TarjetaCredito",Info[playerid][pTarjetaCredito]);
INI_WriteInt(File,"Level",Info[playerid][pLevel]);
INI_WriteInt(File,"AdminNivelZC",Info[playerid][pAdminZC]);
INI_WriteInt(File,"AdminZC",Info[playerid][pLvlAdminZC]);
INI_WriteInt(File,"BanAppealer",Info[playerid][pBanAppealer]);
INI_WriteInt(File,"FactionModerator",Info[playerid][pFactionModerator]);
INI_WriteInt(File,"ModStaff",Info[playerid][pModStaff]);
INI_WriteInt(File,"GangModerator",Info[playerid][pGangModerator]);
INI_WriteInt(File,"Helper",Info[playerid][pHelper]);
INI_WriteInt(File,"ConnectedTime",Info[playerid][pConnectTime]);
INI_WriteInt(File,"Registered",Info[playerid][pReg]);
INI_WriteInt(File,"Sex",Info[playerid][pSex]);
INI_WriteInt(File,"Age",Info[playerid][pAge]);
INI_WriteInt(File,"Origin",Info[playerid][pOrigin]);
INI_WriteInt(File,"Respect",Info[playerid][pExp]);
INI_WriteInt(File,"Money",GetPVarInt(playerid, "Cash"));
INI_WriteInt(File,"Bank",Info[playerid][pAccount]);
INI_WriteString(File,"IP", Info[playerid][pIP]);
INI_WriteInt(File,"Kills",Info[playerid][pKills]);
INI_WriteInt(File,"Deaths",Info[playerid][pDeaths]);
INI_WriteInt(File,"Arrested",Info[playerid][pArrested]);
INI_WriteInt(File,"JailAdmin",Info[playerid][pJailAdmin]);
INI_WriteInt(File,"LottoNr",Info[playerid][pLottoNr]);
INI_WriteInt(File,"Job",Info[playerid][pJob]);
INI_WriteInt(File,"NewMuted",Info[playerid][pNMute]);
INI_WriteInt(File,"NewMutedTotal",Info[playerid][pNMuteTotal]);
INI_WriteInt(File,"Warn",Info[playerid][pWarn]);
INI_WriteInt(File,"WRestricted",Info[playerid][pWRestricted]);
INI_WriteInt(File,"Jailed",Info[playerid][pJailed]);
INI_WriteInt(File,"JailTime",Info[playerid][pJailTime]);
INI_WriteInt(File,"Materials",Info[playerid][pMats]);
INI_WriteInt(File,"Packages",GetPVarInt(playerid, "Packages"));
INI_WriteInt(File,"Drugs",Info[playerid][pDrugs]);
INI_WriteInt(File,"Cosecha",Info[playerid][pCosecha]);
INI_WriteInt(File,"Crack",Info[playerid][pCrack]);
INI_WriteInt(File,"Pot",Info[playerid][pPot]);
INI_WriteInt(File,"Crates",Info[playerid][pCrates]);
INI_WriteInt(File,"Adic",Info[playerid][pAdiccion]);
INI_WriteInt(File,"Leader",Info[playerid][pLeader]);
INI_WriteInt(File,"Member",Info[playerid][pMember]);
INI_WriteInt(File,"FMember",Info[playerid][pFMember]);
INI_WriteInt(File,"Division",Info[playerid][pDivision]);
INI_WriteInt(File,"Rank",Info[playerid][pRank]);
INI_WriteInt(File,"Char",Info[playerid][pChar]);
if(GetPVarInt(playerid, "EventToken") == 0 && GetPVarInt(playerid, "IsInArena") == 0){
GetPlayerHealth(playerid,Info[playerid][pHealth]);
}
INI_WriteFloat(File,"pHealth",Info[playerid][pHealth]);
if(GetPVarInt(playerid, "EventToken") == 0 && GetPVarInt(playerid, "IsInArena") == 0){
GetPlayerArmour(playerid,Info[playerid][pArmour]);
}
INI_WriteFloat(File,"pArmour",Info[playerid][pArmour]);
INI_WriteInt(File,"Team",Info[playerid][pTeam]);
INI_WriteInt(File,"Model",Info[playerid][pModel]);
INI_WriteInt(File,"PhoneNr",Info[playerid][pPnumber]);
INI_WriteInt(File,"Sprunk",Info[playerid][pSprunk]);
INI_WriteInt(File,"Phonebook",Info[playerid][pPhoneBook]);
INI_WriteInt(File,"House",Info[playerid][pPhousekey]);
INI_WriteInt(File,"House2",Info[playerid][pPhousekey2]);
INI_WriteInt(File,"Garajekey",Info[playerid][pGarajekey]);
INI_WriteInt(File,"Int", Info[playerid][pInt]);
INI_WriteFloat(File,"Pos_x",Info[playerid][pPos_x]);
INI_WriteFloat(File,"Pos_y",Info[playerid][pPos_y]);
INI_WriteFloat(File,"Pos_z",Info[playerid][pPos_z]);
INI_WriteFloat(File,"SPos_r",Info[playerid][pPos_r]);
INI_WriteInt(File,"CarLic",Info[playerid][pCarLic]);
INI_WriteInt(File,"FlyLic",Info[playerid][pFlyLic]);
INI_WriteInt(File,"BoatLic",Info[playerid][pBoatLic]);
INI_WriteInt(File,"GunLic",Info[playerid][pGunLic]);
INI_WriteInt(File,"Gafas",Info[playerid][pGafas]);
INI_WriteInt(File,"Tutorial",Info[playerid][pTut]);
INI_WriteInt(File,"Test",Info[playerid][pTestTut]);
INI_WriteInt(File,"VWorld",Info[playerid][pVW]);
INI_WriteInt(File,"Lighter",Info[playerid][pLighter]);
INI_WriteInt(File,"Cigarettes",Info[playerid][pCigarettes]);
INI_WriteInt(File,"BanZC",Info[playerid][pBannedZC]);
INI_WriteInt(File,"DisabledZC",Info[playerid][pDisabledZC]);
INI_WriteInt(File,"BlockBug",Info[playerid][pBlockBug]);
INI_WriteInt(File,"DNI",Info[playerid][pDNI]);
INI_WriteInt(File,"VSkill",Info[playerid][pArmsSkill]);
INI_WriteInt(File,"TSkill",Info[playerid][pTruckSkill]);
INI_WriteInt(File,"SmugglerSkill",Info[playerid][pSmugSkill]);
INI_WriteInt(File,"DrugsSkill",Info[playerid][pDrugsSkill]);
INI_WriteInt(File,"SIDA",Info[playerid][pSIDA]);
INI_WriteInt(File,"Cancer" ,Info[playerid][pCancer]);
INI_WriteInt(File,"Epilepsia",Info[playerid][pEpilepsia]);
INI_WriteInt(File,"Dengue",Info[playerid][pDengue]);
INI_WriteInt(File,"FStyle",Info[playerid][pFStyle]);
INI_WriteInt(File,"Busqueda",Info[playerid][pWantedLevel]);
INI_WriteInt(File,"AntiSIDA",Info[playerid][pAntiSIDA]);
INI_WriteInt(File,"AntiCancer",Info[playerid][pAntiCancer]);
INI_WriteInt(File,"AntiEpilepsia",Info[playerid][pAntiEpilepsia]);
INI_WriteInt(File,"Rent",Info[playerid][pRenting]);
INI_WriteInt(File,"prMoney",Info[playerid][p_Pr_Money]);
INI_WriteInt(File,"Rob",Info[playerid][pRob]);
INI_WriteInt(File,"Premium",Info[playerid][pVIP]);
INI_WriteInt(File,"FichasCash",Info[playerid][pPTR]);
INI_WriteInt(File,"CarPremium",Info[playerid][pCarKey2]);
INI_WriteInt(File,"BanDuda",Info[playerid][pBanDuda]);
INI_WriteInt(File,"ReportMuted",Info[playerid][pRMuted]);
INI_WriteInt(File,"ReportMutedTotal",Info[playerid][pRMutedTotal]);
INI_WriteInt(File,"ReportMutedTime",Info[playerid][pRMutedTime]);
INI_WriteInt(File,"Pasaporte",Info[playerid][pPasaporte]);
INI_WriteInt(File,"RadioP", Info[playerid][pRadio]);
INI_WriteInt(File,"KHZ",Info[playerid][pRadioFreq]);
INI_WriteInt(File,"Ipad",Info[playerid][pIpadMusic]);
INI_WriteInt(File,"GiftTime",Info[playerid][pGiftTime]);
for( new m = 0; m < 12; m++ )
{
new mStr[24];
format(mStr,sizeof(mStr), "Gun%d", m);
INI_WriteInt(File,mStr, Info[playerid][pWeapons][m]);
}
INI_WriteInt(File,"Acento",Info[playerid][pAccent]);
INI_WriteInt(File,"PTokens",Info[playerid][pPaintTokens]);
INI_WriteInt(File,"Undercover",Info[playerid][pUndercover]);
INI_WriteInt(File,"Head",Info[playerid][pHead]);
INI_WriteInt(File,"TaxiLicense", Info[playerid][pTaxiLicense]);
INI_WriteInt(File,"Hospital",Info[playerid][pHospital]);
INI_WriteInt(File,"CHits",Info[playerid][pCHits]);
INI_WriteInt(File,"FHits",Info[playerid][pFHits]);
INI_WriteInt(File,"Spraycan",Info[playerid][pSpraycan]);
INI_WriteInt(File,"Married",Info[playerid][pMarried]);
INI_WriteString(File,"MarriedTo",Info[playerid][pMarriedTo]);
INI_WriteString(File,"ContractBy",Info[playerid][pContractBy]);
INI_WriteString(File,"ContractDetail",Info[playerid][pContractDetail]);
INI_WriteInt(File,"pWExists",Info[playerid][pWExists]);
INI_WriteFloat(File,"pWX",Info[playerid][pWX]);
INI_WriteFloat(File,"pWY",Info[playerid][pWY]);
INI_WriteFloat(File,"pWZ",Info[playerid][pWZ]);
INI_WriteInt(File,"pWVW",Info[playerid][pWVW]);
INI_WriteInt(File,"pWInt",Info[playerid][pWInt]);
INI_WriteInt(File,"pWValue",Info[playerid][pWValue]);
INI_WriteInt(File,"pWSeeds",Info[playerid][pWSeeds]);
INI_WriteInt(File,"PayEx",Info[playerid][YaCobre]);
INI_WriteInt(File,"AdMuted",Info[playerid][pADMute]);
INI_WriteInt(File,"AdMutedTotal",Info[playerid][pADMuteTotal]);
INI_WriteString(File,"Warrants",Info[playerid][pWarrant]);
INI_WriteInt(File,"JudgeJailTime",Info[playerid][pJudgeJailTime]);
INI_WriteInt(File,"JudgeJailType",Info[playerid][pJudgeJailType]);
INI_WriteInt(File,"BeingSentenced",Info[playerid][pBeingSentenced]);
INI_WriteInt(File,"ProbationTime",Info[playerid][pProbationTime]);
INI_WriteInt(File,"RewardsHours",Info[playerid][pRHours]);
INI_WriteInt(File,"ADTime",Info[playerid][pADTime]);
INI_WriteInt(File,"Otros",Info[playerid][pOther]);
INI_WriteInt(File,"GGTokens",Info[playerid][pGTokens]);
INI_WriteInt(File,"HDExp",Info[playerid][pDobleExp]);
INI_WriteInt(File,"DPHoras",Info[playerid][pDPHours]);
INI_WriteInt(File,"DPTiempo",Info[playerid][pDPTime]);
INI_WriteInt(File,"DPTotal",Info[playerid][pDPTotal]);
INI_WriteInt(File,"Order",Info[playerid][pOrder]);
INI_WriteInt(File,"TempVIP",Info[playerid][pTempVIP]);
INI_WriteInt(File,"VIPInviteDay",Info[playerid][pVIPInviteDay]);
INI_WriteInt(File,"BuddyInvite",Info[playerid][pBuddyInvited]);
INI_WriteInt(File,"VTokens",Info[playerid][pVTokens]);
INI_WriteInt(File,"Job2",Info[playerid][pJob2]);
INI_WriteInt(File,"TypeSpawn",Info[playerid][pTypeSpawn]);
INI_WriteInt(File,"ShopTech",Info[playerid][pShopTech]);
INI_WriteInt(File,"Status",Info[playerid][pEstado]);
INI_WriteInt(File,"DayVIP",Info[playerid][pVIPDateD]);
INI_WriteInt(File,"MonthVIP",Info[playerid][pVIPDateM]);
INI_WriteInt(File,"IDRegalo",Info[playerid][pRegalo]);
for( new m = 0; m < 11; m++ )
{
new mStr[24];
format(mStr,sizeof(mStr), "Mueble%d", m);
INI_WriteInt(File,mStr, Info[playerid][pMuebles][m]);
}
INI_WriteInt(File,"Screwdrivers", Info[playerid][pScrewdriver]);
INI_WriteInt(File,"Firstaid", Info[playerid][pFirstaid]);
INI_WriteInt(File,"CamOculta", Info[playerid][pSurveillance]);
INI_WriteInt(File,"Negocio",Info[playerid][pPbizzkey]);
INI_WriteInt(File,"skinn",Info[playerid][pgskin]);
INI_WriteInt(File,"robita",Info[playerid][probita]);
INI_WriteInt(File,"DNIFalse",Info[playerid][pDNIFalse]);
INI_WriteString(File,"DNIName",Info[playerid][pDNIName]);
INI_WriteInt(File,"Boombox",Info[playerid][pBoombox]);
for(new v = 0; v < MAX_PLAYERTOYS; v++)
{
new string[64];
format( string,64, "pt%dModelID", v);
INI_WriteInt(File,string, PlayerToyInfo[playerid][v][ptModelID]);
format(string, 64, "pt%dBone",v);
INI_WriteInt(File,string, PlayerToyInfo[playerid][v][ptBone]);
format(string, 64, "pt%dPosX",v);
INI_WriteFloat(File,string, PlayerToyInfo[playerid][v][ptPosX]);
format(string, 64, "pt%dPosY",v);
INI_WriteFloat(File,string, PlayerToyInfo[playerid][v][ptPosY]);
format(string, 64, "pt%dPosZ",v);
INI_WriteFloat(File,string, PlayerToyInfo[playerid][v][ptPosZ]);
format(string, 64, "pt%dRotX",v);
INI_WriteFloat(File,string,PlayerToyInfo[playerid][v][ptRotX]);
format(string, 64, "pt%dRotY",v);
INI_WriteFloat(File,string,PlayerToyInfo[playerid][v][ptRotY]);
format(string, 64, "pt%dRotZ",v);
INI_WriteFloat(File,string,PlayerToyInfo[playerid][v][ptRotZ]);
format(string, 64, "pt%dSizX",v);
INI_WriteFloat(File,string,PlayerToyInfo[playerid][v][ftscaleX]);
format(string, 64, "pt%dSizY",v);
INI_WriteFloat(File,string,PlayerToyInfo[playerid][v][ftscaleY]);
format(string, 64, "pt%dSizZ",v);
INI_WriteFloat(File,string,PlayerToyInfo[playerid][v][ftscaleZ]);
}
for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
{
new string[64];
format(string, 64, "pv%dPosX",v);
INI_WriteFloat(File,string,PlayerVehicleInfo[playerid][v][pvPosX]);
format(string, 64, "pv%dPosY",v);
INI_WriteFloat(File,string,PlayerVehicleInfo[playerid][v][pvPosY]);
format(string, 64, "pv%dPosZ",v);
INI_WriteFloat(File,string,PlayerVehicleInfo[playerid][v][pvPosZ]);
format(string, 64, "pv%dPosAngle",v);
INI_WriteFloat(File,string,PlayerVehicleInfo[playerid][v][pvPosAngle]);
format(string, 64, "pv%dVirtualW",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvVW]);
format(string, 64, "pv%dModelId",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvModelId]);
format(string, 64, "pv%dLock",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvLock]);
format(string, 64, "pv%dLocked",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvLocked]);
format(string, 64, "pv%dPaintJob",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvPaintJob]);
format(string, 64, "pv%dColor1",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvColor1]);
format(string, 64, "pv%dColor2",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvColor2]);
format(string, 64, "pv%dPrice",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvPrice]);
format(string, 64, "pv%dTicket",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvTicket]);
format(string, 64, "pv%dWeapon0",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWeapons][0]);
format(string, 64, "pv%dWeapon1",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWeapons][1]);
format(string, 64, "pv%dWeapon2",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWeapons][2]);
format(string, 64, "pv%dWeapon3",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWeapons][3]);
format(string, 64, "pv%dWeapon4",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWeapons][4]);
format(string, 64, "pv%dWeapon5",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWeapons][5]);
format(string, 64, "pv%dWeapon6",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWeapons][6]);
format(string, 64, "pv%dWeapon7",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWeapons][7]);
format(string, 64, "pv%dWepUpgrade",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvWepUpgrade]);
format(string, 64, "pv%dFuel",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvFuel]);
format(string, 64, "pv%dImpound",v);
INI_WriteInt(File,string,PlayerVehicleInfo[playerid][v][pvImpounded]);
format(string, 64, "pv%dHealth",v);
INI_WriteFloat(File,string,PlayerVehicleInfo[playerid][v][pvHealth]);
for(new m = 0; m < MAX_MODS; m++)
{
new strings[64];
format(strings, 64, "pv%dMod%d", v, m);
INI_WriteInt(File,strings,PlayerVehicleInfo[playerid][v][pvMods][m]);
}
}
INI_Close(File);
}
return 1;
}