Jump to content
  • 0

Problema login


fytza

Question

Nick:fytza

Problema: dupa ce scriu parola sa ma loghez mai stau vreo 10-20 secunde in aer-

Erori / warnings:-

Lini/script:-

Ai incercat sa rezolvi singur ?:da..

Video: https://www.youtube.com/watch?v=uXFXoMwmTsE&feature=youtu.be

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

[pawn] public OnPlayerLogin(playerid,password[])

{

    new hour,minute,second;

gettime(hour,minute,second);

        MySQLCheckConnection();

  new string2[64];

  new tmp2[256];

MySQLFetchAcctSingle(PlayerData[playerid][pSQLID], "Password", PlayerData[playerid][pKey]);

if(!strcmp(PlayerData[playerid][pKey],password, false) && strlen(password) != 0)

{

    new Query[255];

    format(Query, sizeof(Query), "SELECT * FROM players WHERE id= %d", PlayerData[playerid][pSQLID]);

        mysql_query(Query);

        mysql_store_result();

        if(mysql_num_rows())

        if(mysql_fetch_row_format(Query,"|"))

        {

sscanf(Query, "p<|>e<is[128]s[64]iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii>",PlayerData[playerid]);

}

MySQLUltLog(PlayerData[playerid][pSQLID], "MarriedTo", PlayerData[playerid][pMarriedTo]);

    mysql_store_result();

    MySQLUltLog(PlayerData[playerid][pSQLID], "Email", PlayerData[playerid][pEmail]);

    mysql_store_result();

}

else

{

new loginstring[128];

new loginname[64];

GetPlayerName(playerid,loginname,sizeof(loginname));

format(loginstring,sizeof(loginstring),"PAROLA GRESITA\nTe rog baga parola corecta:",loginname);

ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"{FF0000}L{FFFFFF}ogeaza-te",loginstring,"Login","Exit");

        gPlayerLogTries[playerid] += 1;

        if(gPlayerLogTries[playerid] == 4) { Kick(playerid); }

        return 1;

}

if (PlayerData[playerid][pLevel] >= 0)

{

    new string56[128];

new name[MAX_PLAYER_NAME];

GetPlayerName(playerid, name, sizeof(name));

new playersip[256];

GetPlayerIp(playerid, playersip, sizeof(playersip));

format(string56, sizeof(string56), "{FF0000}LOGIN: {FFFFFF}%s sa logat pe server cu IP:{FF0000} %s",name, playersip);

ABroadCast(COLOR_YELLOW2, string56, 1);

}

new year, month,day;

getdate(year, month, day);

new string[128];

new query[MAX_STRING];

new zero1[5];

new zero2[5];

new zero3[5];

new zero4[5];

if(hour < 10)

{

    zero1 = "0";

}

if(minute < 10)

{

    zero2 = "0";

}

        if(day < 10)

{

    zero3 = "0";

}

if(month < 10)

{

    zero4 = "0";

}

format(string, sizeof(string), "%s%d:%s%d  %s%d.%s%d.%d",zero1,hour,zero2,minute,zero3,day,zero4,month,year);

strmid(PlayerData[playerid][pUltLog], string, 0, strlen(string), 255);

format(query, sizeof(query), "UPDATE players SET UltLog='%s' WHERE id=%d", PlayerData[playerid][pUltLog], PlayerData[playerid][pSQLID]);

mysql_query(query);

if(PlayerData[playerid][pPcarkey] == 0)

{

    PlayerData[playerid][pPcarkey] = 999;

    format(query, sizeof(query), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);

mysql_query(query);

}

if(PlayerData[playerid][pPcarkey2] == 0)

{

    PlayerData[playerid][pPcarkey2] = 999;

    format(query, sizeof(query), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[playerid][pPcarkey2], PlayerData[playerid][pSQLID]);

mysql_query(query);

}

if(PlayerData[playerid][pPcarkey3] == 0)

{

    PlayerData[playerid][pPcarkey3] = 999;

    format(query, sizeof(query), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[playerid][pPcarkey3], PlayerData[playerid][pSQLID]);

mysql_query(query);

}

PlayerData[playerid][pAdjustable] = 0;

ConsumingMoney[playerid] = 1;

if(PlayerData[playerid][pReg] == 0)

{

PlayerData[playerid][pLevel] = 1;

PlayerData[playerid][pSHealth] = 0.0;

PlayerData[playerid][pHealth] = 50.0;

PlayerData[playerid][pArmour] = 0.0;

PlayerData[playerid][pPos_x] = 2246.6;

PlayerData[playerid][pPos_y] = -1161.9;

PlayerData[playerid][pPos_z] = 1029.7;

PlayerData[playerid][pInt] = 15;

PlayerData[playerid][pLocal] = 255;

PlayerData[playerid][pTeam] = 3;

PlayerData[playerid][pModel] = 264;

new randphone = 1000 + random(8999);

PlayerData[playerid][pPnumber] = randphone;

PlayerData[playerid][pPhousekey] = 255;

PlayerData[playerid][pPbiskey] = 255;

PlayerData[playerid][pPcarkey] = 999;

PlayerData[playerid][pAccount] = 25000;

PlayerData[playerid][pReg] = 1;

PlayerData[playerid][pLocked] = 0;

GivePlayerCash(playerid, 100000);

format(string, sizeof(string), "UPDATE players SET Registered='%d' WHERE id=%d", PlayerData[playerid][pReg], PlayerData[playerid][pSQLID]);

mysql_query(string);

format(string, sizeof(string), "UPDATE players SET PhoneNr='%d' WHERE id=%d", PlayerData[playerid][pPnumber], PlayerData[playerid][pSQLID]);

mysql_query(string);

format(string, sizeof(string), "UPDATE players SET House='%d' WHERE id=%d", PlayerData[playerid][pPhousekey], PlayerData[playerid][pSQLID]);

mysql_query(string);

format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);

mysql_query(string);

format(string, sizeof(string), "UPDATE players SET Bank='%d' WHERE id=%d", PlayerData[playerid][pAccount], PlayerData[playerid][pSQLID]);

mysql_query(string);

format(string, sizeof(string), "UPDATE players SET Locked='%d' WHERE id=%d", PlayerData[playerid][pLocked], PlayerData[playerid][pSQLID]);

mysql_query(string);

}

printf(" %s has logged in.", PlayerData[playerid][pNume]);

new playersip[256];

getdate(year, month, day);

  gettime(hour,minute,second);

GetPlayerIp(playerid,playersip,sizeof(playersip));

format(string, sizeof(string), "INSERT INTO ConnectLog (Nume, Data, IP, Tip) VALUES ('%s', '%s', '%s', 'Logare')", PlayerData[playerid][pNume], PlayerData[playerid][pUltLog], playersip);

mysql_query(string);

PlayerData[playerid][pStatus] = 1;

format(string, sizeof(string), "UPDATE players SET Status='%d' WHERE id=%d", PlayerData[playerid][pStatus], PlayerData[playerid][pSQLID]);

mysql_query(string);

if(PlayerData[playerid][pAllowed] == 0)

{

for(new i=1; i<=maxim;i++)

{

if(strfind(playersip, BanData[xIp], true) != -1)

{

    SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Server: {FFFFFF}Ai primit ban pe aceasta clasa de ip.");

    SendClientMessage(playerid, COLOR_LIGHTRED, "Pentru unban viziteaza www.StarZGame.Ro/forum/");

    Kick(playerid);

    return 1;

}

}

}

getdate(year, month, day);

new hourr,minutee,secondd;

gettime(hourr,minutee,secondd);

if(Registerr[playerid] == 2)

{

new stringg[128];

format(stringg, sizeof(stringg), "%d %d %d",day,month,year);

strmid(PlayerData[playerid][pDateReg], stringg, 0, strlen(stringg), 255);

format(query, sizeof(query), "UPDATE players SET DateReg='%s' WHERE id=%d", stringg, PlayerData[playerid][pSQLID]);

Registerr[playerid] = 0;

mysql_query(query);

}

if (PlayerData[playerid][pDonateRank] > 0 && PlayerData[playerid][pAdmin] < 1 && PlayerData[playerid][pAgent] < 1)

{

SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FF0000}Server:{FFFFFF} Esti donator.");

}

  if (PlayerData[playerid][pAdmin] >= 1 && PlayerData[playerid][pDonateRank] < 1 && PlayerData[playerid][pAgent] < 1)

{

    format(string2, sizeof(string2), "{FF0000}Server:{FFFFFF} Te-ai logat. Esti admin level %d.", PlayerData[playerid][pAdmin]);

SendClientMessage(playerid, COLOR_LIGHTBLUE,string2);

}

if (PlayerData[playerid][pAdmin] >= 1 && PlayerData[playerid][pDonateRank] > 0 && PlayerData[playerid][pAgent] < 1)

{

    format(string2, sizeof(string2), "{FF0000}Server:{FFFFFF} Te-ai logat. Esti donator si admin level %d.", PlayerData[playerid][pAdmin]);

SendClientMessage(playerid, COLOR_LIGHTBLUE,string2);

}

if (PlayerData[playerid][pAdmin] >= 1 && PlayerData[playerid][pDonateRank] > 0 && PlayerData[playerid][pAgent] > 0)

{

    format(string2, sizeof(string2), "{FF0000}Server:{FFFFFF} Te-ai logat. Esti donator,asistent si admin level %d.", PlayerData[playerid][pAdmin]);

SendClientMessage(playerid, COLOR_LIGHTBLUE,string2);

}

        if (PlayerData[playerid][pAgent] >= 1 && PlayerData[playerid][pDonateRank] < 1 && PlayerData[playerid][pAdmin] < 1)

{

    format(string2, sizeof(string2), "{FF0000}Server:{FFFFFF} Te-ai logat. Esti asistent.");

SendClientMessage(playerid, COLOR_LIGHTBLUE,string2);

}

if (PlayerData[playerid][pAgent] >= 1 && PlayerData[playerid][pDonateRank] > 0 && PlayerData[playerid][pAdmin] < 1)

{

    format(string2, sizeof(string2), "{FF0000}Server:{FFFFFF} Te-ai logat. Esti donator si asistent.");

SendClientMessage(playerid, COLOR_LIGHTBLUE,string2);

}

WantedLevel[playerid] = PlayerData[playerid][pWantedLevel];

WantedPoints[playerid] =  PlayerData[playerid][pWantedPoints];

SetPlayerWantedLevel(playerid, PlayerData[playerid][pWantedLevel]);

if (PlayerData[playerid][pWantedLevel] > 0)

{

format(string2, sizeof(string2), "{FF0000}Server:{FFFFFF} Ai primit inapoi %d stele!",WantedLevel[playerid]);

SendClientMessage(playerid, COLOR_LIGHTRED, string2);

}

TextDrawHideForPlayer(playerid,logintd0);

TextDrawHideForPlayer(playerid,logintd1);

TextDrawHideForPlayer(playerid,logintd2);

TextDrawHideForPlayer(playerid,logintd3);

TextDrawHideForPlayer(playerid,logintd4);

TextDrawHideForPlayer(playerid,logintd5);

PlayerData[playerid][pLocked] = 0;

SetCameraBehindPlayer(playerid);

if(gTeam[playerid] == 0)

{

gTeam[playerid] = 3;

}

else

{

gTeam[playerid] = PlayerData[playerid][pTeam];

}

  gPlayerLogged[playerid] = 1;

  GivePlayerMoney(playerid, -GetPlayerMoney(playerid));

  SetPlayerCash(playerid);

SpawnPlayer(playerid);

format(tmp2, sizeof(tmp2), "~w~ Bun Venit %s",PlayerData[playerid][pNume]);

StopAudioStreamForPlayer(playerid);

  GameTextForPlayer(playerid, tmp2, 5000, 1);

return 1;

} [/pawn]

[pawn] public OprestePlayer(playerid)

{

if(IsPlayerConnected(playerid))

{

        LoopingAnim(playerid,"PED","SEAT_idle", 4.0, 1, 0, 0, 0, 0);

        LoopingAnim(playerid,"PED","SEAT_idle", 4.0, 1, 0, 0, 0, 0);

        LoopingAnim(playerid,"PED","SEAT_idle", 4.0, 1, 0, 0, 0, 0);

        SetPlayerCameraPos(playerid,1481.4584, -1790.3481, 155.7499);

                SetPlayerCameraLookAt(playerid,1471.9847, -842.8941, 155.7499);

TogglePlayerControllable(playerid, 0);

}

} [/pawn]

[pawn] public SetupPlayerForClassSelection(playerid)

{

TogglePlayerSpectating(playerid, 1);

InterpolateCameraPos(playerid,1481.4584, -1790.3481, 155.7499,1471.9847, -842.8941, 155.7499,15000,CAMERA_MOVE);

InterpolateCameraLookAt(playerid,1471.9847, -842.8941, 155.7499,0.0000, 0.0000, 8.6400,16000,CAMERA_MOVE);

SetPlayerWeather(playerid, 0);

} [/pawn]

Link to comment
Share on other sites

[pawn]     if(PlayerData[playerid][pTut] == 0)

    {

gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;

TogglePlayerControllable(playerid, 0);

RegistrationStep[playerid] = 1;

ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"{FFFFFF}Care este sex-ul tau?","{FFFFFF}1. {FFFFFF}Masculin\r\n{FFFFFF}2. {FFFFFF}Feminin","Urmatorul", "");

//SetTimerEx("OprestePlayer", 2000, false, "i", playerid);

OprestePlayer(playerid);

    } [/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.