02.07.2011, 00:48
(
Последний раз редактировалось russ0; 02.07.2011 в 01:30.
)
Been trying to use this plugin with the CWRP (the base plugin doesn't works at linux / is bugged) gamemode but the login bugs completely... This is my code, it doesn't even finishs, the server keeps running but the player just 'frozes', even though some sendclientmessage (example: you are not logged etc) will still be sent to the user after some time.
PS: I know about the lack of password check. I'm just testing.
pawn Код:
stock loginPlayer(playerid, const senha[50])
{
new field[120][1024];
new query[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(query, sizeof(query), "SELECT * FROM players WHERE Name = '%s'", pname);
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row(data))
{
splith(data, field, '|');
PlayerInfo[playerid][pLevel] = strval(field[3]);
PlayerInfo[playerid][pAdmin] = strval(field[4]);
PlayerInfo[playerid][pDonateRank] = strval(field[5]);
PlayerInfo[playerid][gPupgrade] = strval(field[6]);
PlayerInfo[playerid][pConnectTime] = strval(field[7]);
PlayerInfo[playerid][pReg] = strval(field[8]);
PlayerInfo[playerid][pSex] = strval(field[9]);
PlayerInfo[playerid][pAge] = strval(field[10]);
PlayerInfo[playerid][pOrigin] = strval(field[11]);
PlayerInfo[playerid][pCK] = strval(field[12]);
PlayerInfo[playerid][pMuted] = strval(field[13]);
PlayerInfo[playerid][pExp] = strval(field[14]);
PlayerInfo[playerid][pCash] = strval(field[15]);
PlayerInfo[playerid][pAccount] = strval(field[16]);
PlayerInfo[playerid][pCrimes] = strval(field[17]);
PlayerInfo[playerid][pKills] = strval(field[18]);
PlayerInfo[playerid][pDeaths] = strval(field[19]);
PlayerInfo[playerid][pArrested] = strval(field[20]);
PlayerInfo[playerid][pWantedDeaths] = strval(field[21]);
PlayerInfo[playerid][pPhoneBook] = strval(field[22]);
PlayerInfo[playerid][pLottoNr] = strval(field[23]);
PlayerInfo[playerid][pFishes] = strval(field[24]);
PlayerInfo[playerid][pBiggestFish] = strval(field[25]);
PlayerInfo[playerid][pJob] = strval(field[26]);
PlayerInfo[playerid][pPayCheck] = strval(field[27]);
PlayerInfo[playerid][pHeadValue] = strval(field[28]);
PlayerInfo[playerid][pJailed] = strval(field[29]);
PlayerInfo[playerid][pJailTime] = strval(field[30]);
PlayerInfo[playerid][pMats] = strval(field[31]);
PlayerInfo[playerid][pDrugs] = strval(field[32]);
PlayerInfo[playerid][pLeader] = strval(field[33]);
PlayerInfo[playerid][pMember] = strval(field[34]);
PlayerInfo[playerid][pFMember] = strval(field[35]);
PlayerInfo[playerid][pRank] = strval(field[36]);
PlayerInfo[playerid][pChar] = strval(field[37]);
PlayerInfo[playerid][pContractTime] = strval(field[38]);
PlayerInfo[playerid][pDetSkill] = strval(field[39]);
PlayerInfo[playerid][pSexSkill] = strval(field[40]);
PlayerInfo[playerid][pBoxSkill] = strval(field[41]);
PlayerInfo[playerid][pLawSkill] = strval(field[42]);
PlayerInfo[playerid][pMechSkill] = strval(field[43]);
PlayerInfo[playerid][pJackSkill] = strval(field[44]);
PlayerInfo[playerid][pCarSkill] = strval(field[45]);
PlayerInfo[playerid][pNewsSkill] = strval(field[46]);
PlayerInfo[playerid][pDrugsSkill] = strval(field[47]);
PlayerInfo[playerid][pCookSkill] = strval(field[48]);
PlayerInfo[playerid][pFishSkill] = strval(field[49]);
PlayerInfo[playerid][pSHealth] = floatstr(field[50]);
PlayerInfo[playerid][pHealth] = floatstr(field[51]);
PlayerInfo[playerid][pInt] = strval(field[52]);
PlayerInfo[playerid][pLocal] = strval(field[53]);
PlayerInfo[playerid][pTeam] = strval(field[54]);
PlayerInfo[playerid][pModel] = strval(field[55]);
PlayerInfo[playerid][pPnumber] = strval(field[56]);
PlayerInfo[playerid][pPhousekey] = strval(field[57]);
PlayerInfo[playerid][pPcarkey] = strval(field[58]);
PlayerInfo[playerid][pPapptkey] = strval(field[59]);
PlayerInfo[playerid][pPbiskey] = strval(field[60]);
PlayerInfo[playerid][pPos_x] = floatstr(field[61]);
PlayerInfo[playerid][pPos_y] = floatstr(field[62]);
PlayerInfo[playerid][pPos_z] = floatstr(field[63]);
PlayerInfo[playerid][pCarLic] = strval(field[64]);
PlayerInfo[playerid][pFlyLic] = strval(field[65]);
PlayerInfo[playerid][pBoatLic] = strval(field[66]);
PlayerInfo[playerid][pFishLic] = strval(field[67]);
PlayerInfo[playerid][pGunLic] = strval(field[68]);
PlayerInfo[playerid][pGun1] = strval(field[69]);
PlayerInfo[playerid][pGun2] = strval(field[70]);
PlayerInfo[playerid][pGun3] = strval(field[71]);
PlayerInfo[playerid][pGun4] = strval(field[72]);
PlayerInfo[playerid][pAmmo1] = strval(field[73]);
PlayerInfo[playerid][pAmmo2] = strval(field[74]);
PlayerInfo[playerid][pAmmo3] = strval(field[75]);
PlayerInfo[playerid][pAmmo4] = strval(field[76]);
PlayerInfo[playerid][pCarTime] = strval(field[77]);
PlayerInfo[playerid][pPayDay] = strval(field[78]);
PlayerInfo[playerid][pPayDayHad] = strval(field[79]);
PlayerInfo[playerid][pCDPlayer] = strval(field[80]);
PlayerInfo[playerid][pWins] = strval(field[81]);
PlayerInfo[playerid][pLoses] = strval(field[82]);
PlayerInfo[playerid][pAlcoholPerk] = strval(field[83]);
PlayerInfo[playerid][pDrugPerk] = strval(field[84]);
PlayerInfo[playerid][pMiserPerk] = strval(field[85]);
PlayerInfo[playerid][pPainPerk] = strval(field[86]);
PlayerInfo[playerid][pTraderPerk] = strval(field[87]);
PlayerInfo[playerid][pTut] = strval(field[88]);
PlayerInfo[playerid][pMissionNr] = strval(field[89]);
PlayerInfo[playerid][pWarns] = strval(field[90]);
PlayerInfo[playerid][pAdjustable] = strval(field[91]);
PlayerInfo[playerid][pFuel] = strval(field[92]);
PlayerInfo[playerid][pMarried] = strval(field[93]); // QUATRO \/
PlayerInfo[playerid][pMarriedTo] = strmid(PlayerInfo[playerid][pMarriedTo], field[94], 0, strlen(field[94])-1, 255);
PlayerInfo[playerid][pLinked] = strval(field[96]); // 96
PlayerInfo[playerid][pDeagle] = strval(field[97]);
PlayerInfo[playerid][pShotgun] = strval(field[98]);
PlayerInfo[playerid][pRifle] = strval(field[99]);
PlayerInfo[playerid][pSDPistol] = strval(field[100]);
PlayerInfo[playerid][pMP5] = strval(field[101]);
PlayerInfo[playerid][pM4] = strval(field[102]);
PlayerInfo[playerid][pAK47] = strval(field[103]);
format(PlayerInfo[playerid][pStartIP], 16, "%s", field[104]);
format(PlayerInfo[playerid][pEndIP], 16, "%s", field[105]);
PlayerInfo[playerid][pLocker] = strval(field[106]);
PlayerInfo[playerid][pRadioFrequency] = strval(field[107]);
PlayerInfo[playerid][pRadio] = strval(field[108]);
PlayerInfo[playerid][pPecArm] = strval(field[109]);
PlayerInfo[playerid][pMesa] = strval(field[110]);
PlayerInfo[playerid][pLuvas] = strval(field[111]);
drugInfo[playerid][dgCocaina] = strval(field[112]);
drugInfo[playerid][dgMaconha] = strval(field[113]);
drugInfo[playerid][dgOpio] = strval(field[114]);
drugInfo[playerid][dgCrack] = strval(field[115]);
drugInfo[playerid][dgMeth] = strval(field[116]);
drugInfo[playerid][dgHeroina] = strval(field[117]);
drugInfo[playerid][dgHaxixe] = strval(field[118]);
PlayerInfo[playerid][pPcarkey2] = strval(field[119]);
mysql_free_result();
PlayerInfo[playerid][pAdjustable] = 0;
ResetPlayerCash(playerid);
GivePlayerCash(playerid,PlayerInfo[playerid][pCash]);
if(PlayerInfo[playerid][pReg] == 0)
{
PlayerInfo[playerid][pLevel] = 1;
PlayerInfo[playerid][pSHealth] = 0.0;
PlayerInfo[playerid][pHealth] = 100.0;
PlayerInfo[playerid][pPos_x] = NOOB_X;
PlayerInfo[playerid][pPos_y] = NOOB_Y;
PlayerInfo[playerid][pPos_z] = NOOB_Z;
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 1;
PlayerInfo[playerid][pTeam] = 3;
PlayerInfo[playerid][pModel] = 135;
new randphone = 10000000 + random(89999999);
PlayerInfo[playerid][pNumero] = randphone;
PlayerInfo[playerid][pPhousekey] = 255;
PlayerInfo[playerid][pPcarkey] = 999;
PlayerInfo[playerid][pPcarkey2] = 999;
PlayerInfo[playerid][pPcarkey3] = 999;
PlayerInfo[playerid][pPapptkey] = 255;
PlayerInfo[playerid][pPbiskey] = 255;
PlayerInfo[playerid][pAccount] = 0;
PlayerInfo[playerid][pReg] = 1;
GivePlayerCash(playerid, 500);
}
if(PlayerInfo[playerid][pLevel] == -999) return Ban(playerid);
gPlayerLogged[playerid] = 1;
SpawnPlayer(playerid);
if(PlayerInfo[playerid][pDonateRank]==0)
{
PlayerInfo[playerid][pMascara]=0;
}
SetPlayerSpawn(playerid);
DateProp(playerid);
load_peixes(playerid);
load_celular(playerid);
LoadNewProfile(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin1]);
SetPVarInt(playerid, "logouAgora", 1);
print("Erro? carregardados4(playerid) 02");
format(data, 3, " ");
SetTimerEx("LoadArmas", 3000, false, "i", playerid);
ClearChatbox(playerid, 10);
return 1;
}
}