Szerző Téma: MySQL Gond(Kezdõ vagyok benne)  (Megtekintve 753 alkalommal)

MySQL Gond(Kezdõ vagyok benne)
« Dátum: 2011. Január 27. - 07:51:25 »
0 Show voters
Sziasztok. Nos már régóta scriptelek, és értek a dolgokhoz, de az õszintét megvallva, MySQL-el még sohasem dolgoztam, és hát próbáltam átnézni más módokból a dolgot, javarészt sikerült is, de valami mégse jó neki.. Létrehoztam az adatbázist, megadtam alapértelmezett értékeket, de a regisztráció nem mûködik, csak az elsõ regisztrált karakterrel, de azzal is errorokkal, mikor a másodikat próbálnám regisztrálni, kifagy a szerver... Segítsetek kérlek, már vagy egy hete ezzel ügyetlenkedek, és nem meg. :(
Logfájl:
 
SA-MP Dedicated Server
----------------------
v0.3c, (C)2005-2010 SA-MP Team
[07:09:13] filterscripts = \"\"  (string)
[07:09:13] weburl = \"www.sa-mp.com\"  (string)
[07:09:13]
[07:09:13] Server Plugins
[07:09:13] --------------
[07:09:13]  Loading plugin: streamer
[07:09:13]
*** Streamer Plugin v2.5.1 by Incognito loaded ***
[07:09:13]   Loaded.
[07:09:13]  Loading plugin: sampmysql
[07:09:13]
/*************************************************/
/* SAMP-MySQL v0.15 Plugin loaded successfully ! */
/*************************************************/
[07:09:13]   Loaded.
[07:09:13]  Loaded 2 plugins.
[07:09:13]
[07:09:13] Filter Scripts
[07:09:13] ---------------
[07:09:13]   Loaded 0 filter scripts.
[07:09:13] Szerver indul...
[07:09:13] MySQL kapcsolódás...
[07:09:13] MYSQL: Attempting to connect to server...
[07:09:13]
Connection to MySQL database: Successfull !
[07:09:13] MYSQL: Database connection established.
[07:09:13] MySQL kapcsolódás sikeres
[07:09:13] Szerver elinditva, Mod Betoltve!
[07:09:13] [sCRIPT]: Loaded 870 Cars
[07:09:13] [szkript]: Betoltve 1023 Haz
[07:09:13] [sCRIPT]: Loaded 30 Bizzes
[07:09:13] [sCRIPT]: Betöltve 30 Benzinkut
[07:09:13] [szkript]: Betoltve 1623 Object
[07:09:13] [szkript]: Betoltve 684 Pickup
[07:09:13] 
[07:09:13] ==========WesternRP==========
[07:09:13] ==========Scripter: Rolee & Light=========
[07:09:13] 
[07:09:13] Number of vehicle models: 71
[07:09:39] Incoming connection: 5.152.91.212:50637
[07:09:39] [join] Counter_Strike has joined the server (0:5.152.91.212)
[07:09:49] Error in mysql_query: Duplicate entry \'1\' for key 2
[07:09:49] Error in mysql_query: Unknown column \'AdminLevel\' in \'field list\'
[07:09:49] Error in mysql_query: Unknown column \'Muanyag\' in \'field list\'
[07:09:49] Error in mysql_query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'Char=0,ContractTime=0,DetSkill=0,SexSkill=0,BoxSkill=0,LawSkill=0,MechSkill=0,Ja\' at line 1
[07:09:49] Error in mysql_query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'Int=0,IntNR=0,Local=255,Model=1,PhoneNr=6635,Car=0,Car2=0,House=0,Pos_x=\'1468.70\' at line 1

 
Funkciók:
           
public MySQLConnect(sqlhost[], sqluser[], sqlpass[], sqldb[]) // by Luk0r
{
print(\"MYSQL: Attempting to connect to server...\");
samp_mysql_connect(sqlhost, sqluser, sqlpass);
samp_mysql_select_db(sqldb);
if(samp_mysql_ping()==0)
{
print(\"MYSQL: Database connection established.\");
return 1;
}
else
{
print(\"MYSQL: Connection error, retrying...\");
samp_mysql_connect(sqlhost, sqluser, sqlpass);
samp_mysql_select_db(sqldb);
if(samp_mysql_ping()==0)
{
   print(\"MYSQL: Reconnection successful. We can continue as normal.\");
   return 1;
}
else
{
   print(\"MYSQL: Could not reconnect to server, terminating server...\");
   SendRconCommand(\"exit\");
   return 0;
}
}
}
public MySQLDisconnect() // by Luk0r
{
samp_mysql_close();
return 1;
}
public MySQLCheckConnection() // by Luk0r
{
if(samp_mysql_ping()==0)
{
return 1;
}
else
{
print(\"MYSQL: Connection seems dead, retrying...\");
MySQLDisconnect();
MySQLConnect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB);
if(samp_mysql_ping()==0)
{
   print(\"MYSQL: Reconnection successful. We can continue as normal.\");
   return 1;
}
else
{
   print(\"MYSQL: Could not reconnect to server, terminating server...\");
   SendRconCommand(\"exit\");
   return 0;
}
}
}
public MySQLUpdateBuild(query[], sqlplayerid) // by Luk0r
{
new querylen = strlen(query);
//new querymax = sizeof(query);
new querymax = MAX_STRING;
if (querylen < 1) format(query, querymax, \"UPDATE players SET \");
else if (querymax-querylen < 50) // make sure we\'re being safe here
{
// query is too large, send this one and reset
new whereclause[32];
format(whereclause, sizeof(whereclause), \" WHERE id=%d\", sqlplayerid);
strcat(query, whereclause, querymax);
samp_mysql_query(query);
format(query, querymax, \"UPDATE players SET \");
}
else if (strfind(query, \"=\", true) != -1) strcat(query, \",\", MAX_STRING);
return 1;
}
public MySQLUpdateFinish(query[], sqlplayerid) // by Luk0r
{
if (strcmp(query, \"WHERE id=\", false) == 0) samp_mysql_query(query);
else
{
new whereclause[32];
format(whereclause, sizeof(whereclause), \" WHERE id=%d\", sqlplayerid);
strcat(query, whereclause, MAX_STRING);
samp_mysql_query(query);
format(query, MAX_STRING, \"UPDATE players SET \");
}
return 1;
}
public MySQLUpdatePlayerInt(query[], sqlplayerid, sqlvalname[], sqlupdateint) // by Luk0r
{
MySQLUpdateBuild(query, sqlplayerid);
new updval[64];
format(updval, sizeof(updval), \"%s=%d\", sqlvalname, sqlupdateint);
strcat(query, updval, MAX_STRING);
return 1;
}
public MySQLUpdatePlayerFlo(query[], sqlplayerid, sqlvalname[], Float:sqlupdateflo) // by Luk0r
{
/*   new query[128];
format(query, sizeof(query), \"UPDATE players SET %s=%f WHERE id=%d\", sqlvalname, sqlupdateflo, sqlplayerid);
samp_mysql_query(query);*/
new flotostr[32];
format(flotostr, sizeof(flotostr), \"%f\", sqlupdateflo);
MySQLUpdatePlayerStr(query, sqlplayerid, sqlvalname, flotostr);
return 1;
}
public MySQLUpdatePlayerStr(query[], sqlplayerid, sqlvalname[], sqlupdatestr[]) // by Luk0r
{
MySQLUpdateBuild(query, sqlplayerid);
new escstr[128];
new updval[128];
samp_mysql_real_escape_string(sqlupdatestr, escstr);
format(updval, sizeof(updval), \"%s=\'%s\'\", sqlvalname, escstr);
strcat(query, updval, MAX_STRING);
return 1;
}
public MySQLUpdatePlayerIntSingle(sqlplayerid, sqlvalname[], sqlupdateint) // by Luk0r
{
new query[128];
format(query, sizeof(query), \"UPDATE players SET %s=%d WHERE id=%d\", sqlvalname, sqlupdateint, sqlplayerid);
samp_mysql_query(query);
return 1;
}
public MySQLCheckAccount(sqlplayersname[]) // by Luk0r
{
new query[128];
new escstr[MAX_PLAYER_NAME];
samp_mysql_real_escape_string(sqlplayersname, escstr);
format(query, sizeof(query), \"SELECT id FROM players WHERE LOWER(Name) = LOWER(\'%s\') LIMIT 1\", escstr);
samp_mysql_query(query);
samp_mysql_store_result();
if (samp_mysql_num_rows()==0)
{
return 0;
}
else
{
new strid[32];
new intid;
samp_mysql_fetch_row(strid);
intid = strval(strid);
return intid;
}
}
public MySQLCheckIPBanned(ip[])
{
new query[64];
format(query, sizeof(query), \"SELECT type FROM bans WHERE ip = \'%s\' AND inactive = 0 ORDER BY id DESC LIMIT 1\", ip);
samp_mysql_query(query);
samp_mysql_store_result();
if (samp_mysql_num_rows() != 0)
{
new bantypestr[4];
new bantypeint;
samp_mysql_fetch_row(bantypestr);
bantypeint = strval(bantypestr);
samp_mysql_free_result();
return bantypeint;
}
return 0;
}
public MySQLFetchAcctSingle(sqlplayerid, sqlvalname[], sqlresult[])
{
new query[128];
format(query, sizeof(query), \"SELECT %s FROM players WHERE id = %d LIMIT 1\", sqlvalname, sqlplayerid);
samp_mysql_query(query);
samp_mysql_store_result();
if(samp_mysql_fetch_row(sqlresult)==1)
{
return 1;
}
return 0;
}
public MySQLFetchAcctRecord(sqlplayerid, sqlresult[]) // by Luk0r
{
new query[64];
format(query, sizeof(query), \"SELECT * FROM players WHERE id = %d LIMIT 1\", sqlplayerid);
samp_mysql_query(query);
samp_mysql_store_result();
if(samp_mysql_fetch_row(sqlresult)==1)
{
return 1;
}
return 0;
}
public MySQLCreateAccount(newplayersname[], newpassword[]) // by Luk0r
{
new query[128];
new sqlplyname[64];
new sqlpassword[64];
samp_mysql_real_escape_string(newplayersname, sqlplyname);
samp_mysql_real_escape_string(newpassword, sqlpassword);
format(query, sizeof(query), \"INSERT INTO players (Name, Password) VALUES (\'%s\', \'%s\')\", sqlplyname, sqlpassword);
samp_mysql_query(query);
new newplayersid = MySQLCheckAccount(newplayersname);
if (newplayersid != 0)
{
return newplayersid;
}
return 0;
}
public MySQLAddLoginRecord(sqlplayerid, ipaddr[]) // by Luk0r
{
new query[128];
new escip[16];
samp_mysql_real_escape_string(ipaddr, escip);
format(query, sizeof(query), \"INSERT INTO logins (time,ip,userid) VALUES (UNIX_TIMESTAMP(),\'%s\',%d)\", escip, sqlplayerid);
samp_mysql_query(query);
return 1;
}
stock CreateAccount(newplayersname[], newpassword[]) // by Luk0r
{
new query[128];
new sqlplyname[64];
new sqlpassword[64];
samp_mysql_real_escape_string(newplayersname, sqlplyname);
samp_mysql_real_escape_string(newpassword, sqlpassword);
format(query, sizeof(query), \"INSERT INTO players (Name, Password) VALUES (\'%s\', \'%s\')\", sqlplyname, sqlpassword);
samp_mysql_query(query);
return 0;
}

 
AdatMentés:
     
public AdatMentes(playerid) // by Luk0r v1.2
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerNPC(playerid))
{
    MySQLCheckConnection();
   new query[MAX_MYSQL_STRING];
   format(query, sizeof(query), \"UPDATE %s SET \", SQL_DB_Player);
   MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pID], \"Password\", PlayerInfo[playerid][pKey]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"PlayerLevel\", PlayerInfo[playerid][pLevel]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"AdminLevel\", PlayerInfo[playerid][pAdmin]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Registered\", PlayerInfo[playerid][pReg]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CsatlakozasIdo\", PlayerInfo[playerid][pConnectTime]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Sex\", PlayerInfo[playerid][pNem]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Age\", PlayerInfo[playerid][pKor]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"GPS\", PlayerInfo[playerid][pVanGPS]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Origin\", PlayerInfo[playerid][pOrigin]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CK\", PlayerInfo[playerid][pCK]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Muted\", PlayerInfo[playerid][pMuted]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Blinded\", PlayerInfo[playerid][pBlind]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Respect\", PlayerInfo[playerid][pExp]);
   PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash];
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Money\", PlayerInfo[playerid][pCash]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Bank\", PlayerInfo[playerid][pAccount]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"BankSzamla\", PlayerInfo[playerid][pSzamla]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Crimes\", PlayerInfo[playerid][pCrimes]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Kills\", PlayerInfo[playerid][pKills]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Deaths\", PlayerInfo[playerid][pDeaths]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Arrested\", PlayerInfo[playerid][pArrested]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"WantedDeaths\", PlayerInfo[playerid][pWantedDeaths]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Phonebook\", PlayerInfo[playerid][pPhoneBook]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"LottoNr\", PlayerInfo[playerid][pLottoNr]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Fishes\", PlayerInfo[playerid][pFishes]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"BiggestFish\", PlayerInfo[playerid][pBiggestFish]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Job\", PlayerInfo[playerid][pJob]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Paycheck\", PlayerInfo[playerid][pPayCheck]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"HeadValue\", PlayerInfo[playerid][pHeadValue]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Jailed\", PlayerInfo[playerid][pJailed]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"JailTime\", PlayerInfo[playerid][pJailTime]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CanRobTime\", PlayerInfo[playerid][pRobTime]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Materials\", PlayerInfo[playerid][pMats]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Muanyag\", PlayerInfo[playerid][pMuanyag]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Drugs\", PlayerInfo[playerid][pDrugs]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Leader\", PlayerInfo[playerid][pLeader]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Member\", PlayerInfo[playerid][pMember]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"FMember\", PlayerInfo[playerid][pFMember]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Rank\", PlayerInfo[playerid][pRank]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Char\", PlayerInfo[playerid][pMunkaSkin]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"ContractTime\", PlayerInfo[playerid][pContractTime]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"DetSkill\", PlayerInfo[playerid][pDetSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"SexSkill\", PlayerInfo[playerid][pSexSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"BoxSkill\", PlayerInfo[playerid][pBoxSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"LawSkill\", PlayerInfo[playerid][pLawSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"MechSkill\", PlayerInfo[playerid][pMechSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"JackSkill\", PlayerInfo[playerid][pJackSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CarSkill\", PlayerInfo[playerid][pCarSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"NewsSkill\", PlayerInfo[playerid][pNewsSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"DrugsSkill\", PlayerInfo[playerid][pDrugsSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CookSkill\", PlayerInfo[playerid][pCookSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"FishSkill\", PlayerInfo[playerid][pFishSkill]);
   MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pID], \"pSHealth\", PlayerInfo[playerid][pSHealth]);
   GetPlayerHealth(playerid,PlayerInfo[playerid][pElet]);
   MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pID], \"pElet\", PlayerInfo[playerid][pElet]);
   GetPlayerArmour(playerid,PlayerInfo[playerid][pPajzs]);
   MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pID], \"pPajzs\", PlayerInfo[playerid][pPajzs]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Int\", PlayerInfo[playerid][pInt]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"IntNR\", PlayerInfo[playerid][pInteriorNr]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Local\", PlayerInfo[playerid][pLocal]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Model\", PlayerInfo[playerid][pSimaSkin]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"PhoneNr\", PlayerInfo[playerid][pPnumber]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Car\", PlayerInfo[playerid][pPcarkey]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Car2\", PlayerInfo[playerid][pPcarkey2]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"House\", PlayerInfo[playerid][pPhousekey]);
   if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
   {
      PlayerInfo[playerid][pPos_x] = 1684.9;
      PlayerInfo[playerid][pPos_y] = -2244.5;
      PlayerInfo[playerid][pPos_z] = 13.5;
   }
   MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pID], \"Pos_x\", PlayerInfo[playerid][pPos_x]);
   MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pID], \"Pos_y\", PlayerInfo[playerid][pPos_y]);
   MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pID], \"Pos_z\", PlayerInfo[playerid][pPos_z]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Utlevel\", PlayerInfo[playerid][pUtlevel]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CarLic\", PlayerInfo[playerid][pCarLic]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"FlyLic\", PlayerInfo[playerid][pFlyLic]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"BoatLic\", PlayerInfo[playerid][pBoatLic]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"FishLic\", PlayerInfo[playerid][pFishLic]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"GunLic\", PlayerInfo[playerid][pGunLic]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CopLic\", PlayerInfo[playerid][pCopLic]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CarTime\", PlayerInfo[playerid][pCarTime]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"PayDay\", PlayerInfo[playerid][pPayDay]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Szabalyzat\", PlayerInfo[playerid][pSzabalyzat]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Watch\", PlayerInfo[playerid][pOra]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Wins\", PlayerInfo[playerid][pWins]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Loses\", PlayerInfo[playerid][pLoses]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"AlcoholPerk\", PlayerInfo[playerid][pAlcoholPerk]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"DrugPerk\", PlayerInfo[playerid][pDrugPerk]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"MiserPerk\", PlayerInfo[playerid][pMiserPerk]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"PainPerk\", PlayerInfo[playerid][pPainPerk]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"TraderPerk\", PlayerInfo[playerid][pTraderPerk]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Tutorial\", PlayerInfo[playerid][pTut]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"VirtualWorld\", PlayerInfo[playerid][pVirWorld]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Fuel\", PlayerInfo[playerid][pFuel]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Married\", PlayerInfo[playerid][pMarried]);
   MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pID], \"MarriedTo\", PlayerInfo[playerid][pMarriedTo]);
   MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pID], \"Note1\", PlayerInfo[playerid][pNote1]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Note1s\", PlayerInfo[playerid][pNote1s]);
   MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pID], \"Note2\", PlayerInfo[playerid][pNote2]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Note2s\", PlayerInfo[playerid][pNote2s]);
   MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pID], \"Note3\", PlayerInfo[playerid][pNote3]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Note3s\", PlayerInfo[playerid][pNote3s]);
   MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pID], \"Note4\", PlayerInfo[playerid][pNote4]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Note4s\", PlayerInfo[playerid][pNote4s]);
   MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pID], \"Note5\", PlayerInfo[playerid][pNote5]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Note5s\", PlayerInfo[playerid][pNote5s]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvWeapon\", PlayerInfo[playerid][pInvWeapon]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvAmmo\", PlayerInfo[playerid][pInvAmmo]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvWeapon2\", PlayerInfo[playerid][pInvWeapon2]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvAmmo2\", PlayerInfo[playerid][pInvAmmo2]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvWeapon3\", PlayerInfo[playerid][pInvWeapon3]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvAmmo3\", PlayerInfo[playerid][pInvAmmo3]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvWeapon4\", PlayerInfo[playerid][pInvWeapon4]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvAmmo4\", PlayerInfo[playerid][pInvAmmo4]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvWeapon5\", PlayerInfo[playerid][pInvWeapon5]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvAmmo5\", PlayerInfo[playerid][pInvAmmo5]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvWeapon6\", PlayerInfo[playerid][pInvWeapon6]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"InvAmmo6\", PlayerInfo[playerid][pInvAmmo6]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Gyujto\", PlayerInfo[playerid][pGyujto]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Cigarettes\", PlayerInfo[playerid][pCigi]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Nikotin\", PlayerInfo[playerid][pNikotin]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Warnings\", PlayerInfo[playerid][pWarned]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Swat\", PlayerInfo[playerid][pSwat]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Fighting\", PlayerInfo[playerid][pFS]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Boxing\", PlayerInfo[playerid][pBoxiSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"KneeHead\", PlayerInfo[playerid][pKneeSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"KungFu\", PlayerInfo[playerid][pKungSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"GrabKick\", PlayerInfo[playerid][pGrabSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Elbow\", PlayerInfo[playerid][pElbowSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Tactical\", PlayerInfo[playerid][pTactical]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"SpecialF\", PlayerInfo[playerid][pSpecialF]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"DutyBanned\", PlayerInfo[playerid][pDBanned]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CDPlayer\", PlayerInfo[playerid][pCD]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Speedo\", PlayerInfo[playerid][pSpeedo]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"HydraDriver\", PlayerInfo[playerid][pHydraR]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"HunterDriver\", PlayerInfo[playerid][pHunterR]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"RhinoDriver\", PlayerInfo[playerid][pRhinoR]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"PredatorDriver\", PlayerInfo[playerid][pPredR]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"ViewPms\", PlayerInfo[playerid][pViewPms]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"AppearList\", PlayerInfo[playerid][pAppearList]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"PistolSkill\", PlayerInfo[playerid][pPistSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"SilencedSkill\", PlayerInfo[playerid][pSilenSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"DesertSkill\", PlayerInfo[playerid][pDesertSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"ShotgunSkill\", PlayerInfo[playerid][pShotgSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"SawnoffSkill\", PlayerInfo[playerid][pSawnSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"CombatSkill\", PlayerInfo[playerid][pCombSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"UziSkill\", PlayerInfo[playerid][pUziSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"SMGSkill\", PlayerInfo[playerid][pSmgSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"AK47Skill\", PlayerInfo[playerid][pAkSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"M4Skill\", PlayerInfo[playerid][pM4Skill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"SniperSkill\", PlayerInfo[playerid][pSnipSkill]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"ShiftName\", PlayerInfo[playerid][pShiftName]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon\", PlayerInfo[playerid][pGun]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo\", PlayerInfo[playerid][pAmmo]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon2\", PlayerInfo[playerid][pGun2]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo2\", PlayerInfo[playerid][pAmmo2]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon3\", PlayerInfo[playerid][pGun3]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo3\", PlayerInfo[playerid][pAmmo3]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon4\", PlayerInfo[playerid][pGun4]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo4\", PlayerInfo[playerid][pAmmo4]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon5\", PlayerInfo[playerid][pGun5]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo5\", PlayerInfo[playerid][pAmmo5]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon6\", PlayerInfo[playerid][pGun6]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo6\", PlayerInfo[playerid][pAmmo6]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon7\", PlayerInfo[playerid][pGun7]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo7\", PlayerInfo[playerid][pAmmo7]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon8\", PlayerInfo[playerid][pGun8]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo8\", PlayerInfo[playerid][pAmmo8]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon9\", PlayerInfo[playerid][pGun9]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo9\", PlayerInfo[playerid][pAmmo9]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon10\", PlayerInfo[playerid][pGun10]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo10\", PlayerInfo[playerid][pAmmo10]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon11\", PlayerInfo[playerid][pGun11]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo11\", PlayerInfo[playerid][pAmmo11]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Weapon12\", PlayerInfo[playerid][pGun12]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Ammo12\", PlayerInfo[playerid][pAmmo12]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Bannolva\", PlayerInfo[playerid][pBan]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"ChatMode\", PlayerInfo[playerid][pChatMode]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"TazerBullets\", PlayerInfo[playerid][pTazerBullets]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Kotszer\", PlayerInfo[playerid][pKotszer]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Kaja\", PlayerInfo[playerid][pKaja]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"DrogIdo\", PlayerInfo[playerid][pDrogido]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Pia\", PlayerInfo[playerid][pPia]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Kredit\", PlayerInfo[playerid][pKredit]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Mak\", PlayerInfo[playerid][pMak]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Cserje\", PlayerInfo[playerid][pCserje]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Cannabis\", PlayerInfo[playerid][pCannabis]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Kokain\", PlayerInfo[playerid][pKokain]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Heroin\", PlayerInfo[playerid][pHeroin]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Marihuana\", PlayerInfo[playerid][pMarihuana]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"C4\", PlayerInfo[playerid][pC4]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Terkep\", PlayerInfo[playerid][pTerkep]);
   MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pID], \"Beteg\", PlayerInfo[playerid][pBeteg]);
   MySQLUpdateFinish(query, PlayerInfo[playerid][pID]);
}
}
return 1;
}

 
Regisztrálás:
           
public OnPlayerRegister(playerid, password[]) // v1.0 by Luk0r
{
if(IsPlayerConnected(playerid))
{
    MySQLCheckConnection();
new newaccountsqlid = CreateAccount(PlayerName(playerid), password);
PlayerInfo[playerid][pID] = newaccountsqlid;
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
AdatMentes(playerid);
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, \"Account registered, you can now log in (/login [password]).\");
return 1;
}
return 0;
}

 
Bejelentkezés:
             
public OnPlayerLogin(playerid,password[])
{
MySQLCheckConnection();
new tmp2[256];
new playername2[MAX_PLAYER_NAME];
new playernamesplit[3][MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
split(playername2, playernamesplit, \'_\');
MySQLFetchAcctSingle(PlayerInfo[playerid][pID], \"Password\", PlayerInfo[playerid][pKey]);
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
{
new Data[1024];
new Field[64];
new rcnt = 1;
MySQLFetchAcctRecord(PlayerInfo[playerid][pID], Data);
samp_mysql_strtok(Field, \"|\", Data);
while (samp_mysql_strtok(Field, \"|\", \"\")==1)
{
   // The rcnt values here represent the order of the columns in the characters table, so don\'t mess with them
   // If you add a column to the table, just add a new line with a +1 rcnt to the block below
   // Start it at 3 to skip the first few records we don\'t need (id, player name, password)
            if (rcnt == 3)  PlayerInfo[playerid][pLevel] = strval(Field);
   if (rcnt == 4)  PlayerInfo[playerid][pAdmin] = strval(Field);
   if (rcnt == 5)  PlayerInfo[playerid][pReg] = strval(Field);
   if (rcnt == 6)  PlayerInfo[playerid][pConnectTime] = strval(Field);
   if (rcnt == 7)  PlayerInfo[playerid][pNem] = strval(Field);
   if (rcnt == 8)  PlayerInfo[playerid][pKor] = strval(Field);
   if (rcnt == 9)  PlayerInfo[playerid][pVanGPS] = strval(Field);
   if (rcnt == 10)  PlayerInfo[playerid][pOrigin] = strval(Field);
   if (rcnt == 11)  PlayerInfo[playerid][pCK] = strval(Field);
   if (rcnt == 12)  PlayerInfo[playerid][pMuted] = strval(Field);
   if (rcnt == 13)  PlayerInfo[playerid][pBlind] = strval(Field);
   if (rcnt == 14)  PlayerInfo[playerid][pExp] = strval(Field);
   if (rcnt == 15)  PlayerInfo[playerid][pCash] = strval(Field);
   if (rcnt == 16)  PlayerInfo[playerid][pAccount] = strval(Field);
   if (rcnt == 17)  PlayerInfo[playerid][pSzamla] = strval(Field);
   if (rcnt == 18)  PlayerInfo[playerid][pCrimes] = strval(Field);
   if (rcnt == 19)  PlayerInfo[playerid][pKills] = strval(Field);
   if (rcnt == 20)  PlayerInfo[playerid][pDeaths] = strval(Field);
   if (rcnt == 21)  PlayerInfo[playerid][pArrested] = strval(Field);
   if (rcnt == 22)  PlayerInfo[playerid][pWantedDeaths] = strval(Field);
   if (rcnt == 23)  PlayerInfo[playerid][pPhoneBook] = strval(Field);
   if (rcnt == 24)  PlayerInfo[playerid][pLottoNr] = strval(Field);
   if (rcnt == 25)  PlayerInfo[playerid][pFishes] = strval(Field);
   if (rcnt == 26)  PlayerInfo[playerid][pBiggestFish] = strval(Field);
   if (rcnt == 27)  PlayerInfo[playerid][pJob] = strval(Field);
   if (rcnt == 28)  PlayerInfo[playerid][pPayCheck] = strval(Field);
   if (rcnt == 29)  PlayerInfo[playerid][pHeadValue] = strval(Field);
   if (rcnt == 30)  PlayerInfo[playerid][pJailed] = strval(Field);
   if (rcnt == 31)  PlayerInfo[playerid][pJailTime] = strval(Field);
   if (rcnt == 32)  PlayerInfo[playerid][pRobTime] = strval(Field);
   if (rcnt == 33)  PlayerInfo[playerid][pMats] = strval(Field);
   if (rcnt == 34)  PlayerInfo[playerid][pMuanyag] = strval(Field);
   if (rcnt == 35)  PlayerInfo[playerid][pDrugs] = strval(Field);
   if (rcnt == 36)  PlayerInfo[playerid][pLeader] = strval(Field);
   if (rcnt == 37)  PlayerInfo[playerid][pMember] = strval(Field);
   if (rcnt == 38)  PlayerInfo[playerid][pFMember] = strval(Field);
   if (rcnt == 39)  PlayerInfo[playerid][pRank] = strval(Field);
   if (rcnt == 40)  PlayerInfo[playerid][pMunkaSkin] = strval(Field);
   if (rcnt == 41)  PlayerInfo[playerid][pContractTime] = strval(Field);
   if (rcnt == 42)  PlayerInfo[playerid][pDetSkill] = strval(Field);
   if (rcnt == 43)  PlayerInfo[playerid][pSexSkill] = strval(Field);
   if (rcnt == 44)  PlayerInfo[playerid][pBoxSkill] = strval(Field);
   if (rcnt == 45)  PlayerInfo[playerid][pLawSkill] = strval(Field);
   if (rcnt == 46)  PlayerInfo[playerid][pMechSkill] = strval(Field);
   if (rcnt == 47)  PlayerInfo[playerid][pJackSkill] = strval(Field);
   if (rcnt == 48)  PlayerInfo[playerid][pCarSkill] = strval(Field);
   if (rcnt == 49)  PlayerInfo[playerid][pNewsSkill] = strval(Field);
   if (rcnt == 50)  PlayerInfo[playerid][pDrugsSkill] = strval(Field);
   if (rcnt == 51)  PlayerInfo[playerid][pCookSkill] = strval(Field);
   if (rcnt == 52)  PlayerInfo[playerid][pFishSkill] = strval(Field);
   if (rcnt == 53)  PlayerInfo[playerid][pSHealth] = floatstr(Field);
   if (rcnt == 54)  PlayerInfo[playerid][pElet] = floatstr(Field);
   if (rcnt == 55)  PlayerInfo[playerid][pPajzs] = floatstr(Field);
   if (rcnt == 56)  PlayerInfo[playerid][pInt] = strval(Field);
   if (rcnt == 57)  PlayerInfo[playerid][pInteriorNr] = strval(Field);
   if (rcnt == 58)  PlayerInfo[playerid][pLocal] = strval(Field);
   if (rcnt == 59)  PlayerInfo[playerid][pSimaSkin] = strval(Field);
   if (rcnt == 60)  PlayerInfo[playerid][pPnumber] = strval(Field);
   if (rcnt == 61)  PlayerInfo[playerid][pPcarkey] = strval(Field);
   if (rcnt == 62)  PlayerInfo[playerid][pPcarkey2] = strval(Field);
   if (rcnt == 63)  PlayerInfo[playerid][pPhousekey] = strval(Field);
   if (rcnt == 64)  PlayerInfo[playerid][pPos_x] = floatstr(Field);
   if (rcnt == 65)  PlayerInfo[playerid][pPos_y] = floatstr(Field);
   if (rcnt == 66)  PlayerInfo[playerid][pPos_z] = floatstr(Field);
   if (rcnt == 67)  PlayerInfo[playerid][pUtlevel] = strval(Field);
   if (rcnt == 68)  PlayerInfo[playerid][pCarLic] = strval(Field);
   if (rcnt == 69)  PlayerInfo[playerid][pFlyLic] = strval(Field);
   if (rcnt == 70)  PlayerInfo[playerid][pBoatLic] = strval(Field);
   if (rcnt == 71)  PlayerInfo[playerid][pFishLic] = strval(Field);
   if (rcnt == 72)  PlayerInfo[playerid][pGunLic] = strval(Field);
   if (rcnt == 73)  PlayerInfo[playerid][pCopLic] = strval(Field);
   if (rcnt == 74)  PlayerInfo[playerid][pCarTime] = strval(Field);
   if (rcnt == 75)  PlayerInfo[playerid][pPayDay] = strval(Field);
   if (rcnt == 76)  PlayerInfo[playerid][pSzabalyzat] = strval(Field);
   if (rcnt == 77)  PlayerInfo[playerid][pOra] = strval(Field);
   if (rcnt == 78)  PlayerInfo[playerid][pWins] = strval(Field);
   if (rcnt == 79)  PlayerInfo[playerid][pLoses] = strval(Field);
   if (rcnt == 80)  PlayerInfo[playerid][pAlcoholPerk] = strval(Field);
   if (rcnt == 81)  PlayerInfo[playerid][pDrugPerk] = strval(Field);
   if (rcnt == 82)  PlayerInfo[playerid][pMiserPerk] = strval(Field);
   if (rcnt == 83)  PlayerInfo[playerid][pPainPerk] = strval(Field);
   if (rcnt == 84)  PlayerInfo[playerid][pTraderPerk] = strval(Field);
   if (rcnt == 85)  PlayerInfo[playerid][pTut] = strval(Field);
   if (rcnt == 86)  PlayerInfo[playerid][pVirWorld] = strval(Field);
   if (rcnt == 87)  PlayerInfo[playerid][pFuel] = strval(Field);
   if (rcnt == 88)  PlayerInfo[playerid][pMarried] = strval(Field);
   if (rcnt == 89)  PlayerInfo[playerid][pMarriedTo] =   strmid(PlayerInfo[playerid][pMarriedTo], Field, 0, strlen(Field)-1, 25);
   if (rcnt == 90)  PlayerInfo[playerid][pNote1] =   strmid(PlayerInfo[playerid][pNote1], Field, 0, strlen(Field)-1, 255);
   if (rcnt == 91)  PlayerInfo[playerid][pNote1s] = strval(Field);
   if (rcnt == 92)  PlayerInfo[playerid][pNote2] = strmid(PlayerInfo[playerid][pNote2], Field, 0, strlen(Field), 255);
   if (rcnt == 93)  PlayerInfo[playerid][pNote2s] = strval(Field);
   if (rcnt == 94)  PlayerInfo[playerid][pNote3] = strmid(PlayerInfo[playerid][pNote3], Field, 0, strlen(Field), 255);
   if (rcnt == 95)  PlayerInfo[playerid][pNote3s] = strval(Field);
   if (rcnt == 96)  PlayerInfo[playerid][pNote1] = strmid(PlayerInfo[playerid][pNote4], Field, 0, strlen(Field), 255);
   if (rcnt == 97)  PlayerInfo[playerid][pNote4s] = strval(Field);
   if (rcnt == 98)  PlayerInfo[playerid][pNote1] = strmid(PlayerInfo[playerid][pNote5], Field, 0, strlen(Field), 255);
   if (rcnt == 99)  PlayerInfo[playerid][pNote5s] = strval(Field);
   if (rcnt == 100)  PlayerInfo[playerid][pInvWeapon] = strval(Field);
   if (rcnt == 101)  PlayerInfo[playerid][pInvAmmo] = strval(Field);
   if (rcnt == 102)  PlayerInfo[playerid][pInvWeapon2] = strval(Field);
   if (rcnt == 103)  PlayerInfo[playerid][pInvAmmo2] = strval(Field);
   if (rcnt == 104)  PlayerInfo[playerid][pInvWeapon3] = strval(Field);
   if (rcnt == 105)  PlayerInfo[playerid][pInvAmmo3] = strval(Field);
   if (rcnt == 106)  PlayerInfo[playerid][pInvWeapon4] = strval(Field);
   if (rcnt == 107)  PlayerInfo[playerid][pInvAmmo4] = strval(Field);
   if (rcnt == 108)  PlayerInfo[playerid][pInvWeapon5] = strval(Field);
   if (rcnt == 109)  PlayerInfo[playerid][pInvAmmo5] = strval(Field);
   if (rcnt == 110)  PlayerInfo[playerid][pInvWeapon6] = strval(Field);
   if (rcnt == 111)  PlayerInfo[playerid][pInvAmmo6] = strval(Field);
   if (rcnt == 112)  PlayerInfo[playerid][pGyujto] = strval(Field);
   if (rcnt == 113)  PlayerInfo[playerid][pCigi] = strval(Field);
   if (rcnt == 114)  PlayerInfo[playerid][pNikotin] = strval(Field);
   if (rcnt == 115)  PlayerInfo[playerid][pWarned] = strval(Field);
   if (rcnt == 116)  PlayerInfo[playerid][pSwat] = strval(Field);
   if (rcnt == 117)  PlayerInfo[playerid][pFS] = strval(Field);
   if (rcnt == 118)  PlayerInfo[playerid][pBoxiSkill] = strval(Field);
   if (rcnt == 119)  PlayerInfo[playerid][pKneeSkill] = strval(Field);
   if (rcnt == 120)  PlayerInfo[playerid][pKungSkill] = strval(Field);
   if (rcnt == 121)  PlayerInfo[playerid][pGrabSkill] = strval(Field);
   if (rcnt == 122)  PlayerInfo[playerid][pElbowSkill] = strval(Field);
   if (rcnt == 123)  PlayerInfo[playerid][pTactical] = strval(Field);
   if (rcnt == 124)  PlayerInfo[playerid][pSpecialF] = strval(Field);
   if (rcnt == 125)  PlayerInfo[playerid][pDBanned] = strval(Field);
   if (rcnt == 126)  PlayerInfo[playerid][pCD] = strval(Field);
   if (rcnt == 127)  PlayerInfo[playerid][pSpeedo] = strval(Field);
   if (rcnt == 128)  PlayerInfo[playerid][pHydraR] = strval(Field);
   if (rcnt == 129)  PlayerInfo[playerid][pHunterR] = strval(Field);
   if (rcnt == 130)  PlayerInfo[playerid][pRhinoR] = strval(Field);
   if (rcnt == 131)  PlayerInfo[playerid][pPredR] = strval(Field);
   if (rcnt == 132)  PlayerInfo[playerid][pViewPms] = strval(Field);
   if (rcnt == 133)  PlayerInfo[playerid][pAppearList] = strval(Field);
   if (rcnt == 134)  PlayerInfo[playerid][pPistSkill] = strval(Field);
   if (rcnt == 135)  PlayerInfo[playerid][pSilenSkill] = strval(Field);
   if (rcnt == 136)  PlayerInfo[playerid][pDesertSkill] = strval(Field);
   if (rcnt == 137)  PlayerInfo[playerid][pShotgSkill] = strval(Field);
   if (rcnt == 138)  PlayerInfo[playerid][pSawnSkill] = strval(Field);
   if (rcnt == 139)  PlayerInfo[playerid][pCombSkill] = strval(Field);
   if (rcnt == 140)  PlayerInfo[playerid][pUziSkill] = strval(Field);
   if (rcnt == 141)  PlayerInfo[playerid][pSmgSkill] = strval(Field);
   if (rcnt == 142)  PlayerInfo[playerid][pAkSkill] = strval(Field);
   if (rcnt == 143)  PlayerInfo[playerid][pM4Skill] = strval(Field);
   if (rcnt == 144)  PlayerInfo[playerid][pSnipSkill] = strval(Field);
   if (rcnt == 145)  PlayerInfo[playerid][pShiftName] = strval(Field);
   if (rcnt == 146)  PlayerInfo[playerid][pGun] = strval(Field);
   if (rcnt == 147)  PlayerInfo[playerid][pAmmo] = strval(Field);
   if (rcnt == 148)  PlayerInfo[playerid][pGun2] = strval(Field);
   if (rcnt == 149)  PlayerInfo[playerid][pAmmo2] = strval(Field);
   if (rcnt == 150)  PlayerInfo[playerid][pGun3] = strval(Field);
   if (rcnt == 151)  PlayerInfo[playerid][pAmmo3] = strval(Field);
   if (rcnt == 152)  PlayerInfo[playerid][pGun4] = strval(Field);
   if (rcnt == 153)  PlayerInfo[playerid][pAmmo4] = strval(Field);
   if (rcnt == 154)  PlayerInfo[playerid][pGun5] = strval(Field);
   if (rcnt == 155)  PlayerInfo[playerid][pAmmo5] = strval(Field);
   if (rcnt == 156)  PlayerInfo[playerid][pGun6] = strval(Field);
   if (rcnt == 157)  PlayerInfo[playerid][pAmmo6] = strval(Field);
   if (rcnt == 158)  PlayerInfo[playerid][pGun7] = strval(Field);
   if (rcnt == 159)  PlayerInfo[playerid][pAmmo7] = strval(Field);
   if (rcnt == 160)  PlayerInfo[playerid][pGun8] = strval(Field);
   if (rcnt == 161)  PlayerInfo[playerid][pAmmo8] = strval(Field);
   if (rcnt == 162)  PlayerInfo[playerid][pGun9] = strval(Field);
   if (rcnt == 163)  PlayerInfo[playerid][pAmmo9] = strval(Field);
   if (rcnt == 164)  PlayerInfo[playerid][pGun10] = strval(Field);
   if (rcnt == 165)  PlayerInfo[playerid][pAmmo10] = strval(Field);
   if (rcnt == 166)  PlayerInfo[playerid][pGun11] = strval(Field);
   if (rcnt == 167)  PlayerInfo[playerid][pAmmo11] = strval(Field);
   if (rcnt == 168)  PlayerInfo[playerid][pGun12] = strval(Field);
   if (rcnt == 169)  PlayerInfo[playerid][pAmmo12] = strval(Field);
   if (rcnt == 170)  PlayerInfo[playerid][pBan] = strval(Field);
   if (rcnt == 171)  PlayerInfo[playerid][pChatMode] = strval(Field);
   if (rcnt == 172)  PlayerInfo[playerid][pTazerBullets] = strval(Field);
   if (rcnt == 173)  PlayerInfo[playerid][pKotszer] = strval(Field);
   if (rcnt == 174)  PlayerInfo[playerid][pKaja] = strval(Field);
   if (rcnt == 175)  PlayerInfo[playerid][pDrogido] = strval(Field);
   if (rcnt == 176)  PlayerInfo[playerid][pPia] = strval(Field);
   if (rcnt == 177)  PlayerInfo[playerid][pKredit] = strval(Field);
   if (rcnt == 178)  PlayerInfo[playerid][pMak] = strval(Field);
   if (rcnt == 179)  PlayerInfo[playerid][pCserje] = strval(Field);
   if (rcnt == 180)  PlayerInfo[playerid][pCannabis] = strval(Field);
   if (rcnt == 181)  PlayerInfo[playerid][pKokain] = strval(Field);
   if (rcnt == 182)  PlayerInfo[playerid][pHeroin] = strval(Field);
   if (rcnt == 183)  PlayerInfo[playerid][pMarihuana] = strval(Field);
   if (rcnt == 184)  PlayerInfo[playerid][pC4] = strval(Field);
   if (rcnt == 185)  PlayerInfo[playerid][pTerkep] = strval(Field);
   if (rcnt == 186)  PlayerInfo[playerid][pBeteg] = strval(Field);
   rcnt++;
}
samp_mysql_free_result();
}
else
{
SendClientMessage(playerid, COLOR_WHITE, \"SERVER: Password does not match your name.\");
//fclose(UserFile);
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
return 1;
}
new string[128];
GiveMoney(playerid,PlayerInfo[playerid][pCash]);
    if(PlayerInfo[playerid][pReg] == 0)
{
PlayerInfo[playerid][pLevel] = 1;
PlayerInfo[playerid][pElet] = 50.0;
PlayerInfo[playerid][pPajzs] = 0.0;
PlayerInfo[playerid][pUtlevel] = NINCS;
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
PlayerInfo[playerid][pPos_x] = 1468.7002;
PlayerInfo[playerid][pPos_y] = -1847.3125;
PlayerInfo[playerid][pPos_z] = 13.5;
PlayerInfo[playerid][pSimaSkin] = 135;
PlayerInfo[playerid][pPhousekey] = 0;
PlayerInfo[playerid][pPcarkey] = NINCS;
PlayerInfo[playerid][pPcarkey2] = NINCS;
PlayerInfo[playerid][pAccount] = 0;
PlayerInfo[playerid][pReg] = 1;
}
SetPlayerSkills(playerid);
if(PlayerInfo[playerid][pCK] > 0)
{
    Kick(playerid);
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
admins ++;
}
    if(PlayerInfo[playerid][pAdmin] >= 4)
{
    PlayerInfo[playerid][pAppearList] = 0;
}
else
{
    PlayerInfo[playerid][pAppearList] = 1;
}
if(PlayerInfo[playerid][pTerkep] == 0)
{
        GangZoneShowForPlayer(playerid, Terkep, 255);
    }
if(PlayerInfo[playerid][pLevel] == -999) //autoban
{
Ban(playerid);
}
printf(\"%s belepett\\n\", PlayerName(playerid));
if(!MoneyTxtCreated[playerid])
{
MoneyTxtCreated[playerid] = 1;
MoneyTxt[playerid] = TextDrawCreate(498.000000,80.000000,\"00000000Ft\");
TextDrawAlignment(MoneyTxt[playerid], 0);
TextDrawBackgroundColor(MoneyTxt[playerid], COLOR_LIGHTBLUE);
TextDrawFont(MoneyTxt[playerid], 3);
TextDrawLetterSize(MoneyTxt[playerid], 0.65, 2.9);
TextDrawColor(MoneyTxt[playerid], COLOR_GreenMoney);
TextDrawSetOutline(MoneyTxt[playerid], 1);
TextDrawSetProportional(MoneyTxt[playerid], 1);
TextDrawUseBox(MoneyTxt[playerid], 1);
TextDrawBoxColor(MoneyTxt[playerid], 0x000000FF);
}
TextDrawShowForPlayer(playerid, MoneyTxt[playerid]);
CurCol[playerid] = 1;
Conn[playerid] = 1;
ShowTextDraw(playerid, TD_Info);
gPlayerLogged[playerid] = 1;
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
format(tmp2, sizeof(tmp2), \"~w~Udv~n~~y~%s\", PlayerName(playerid));
GameTextForPlayer(playerid, tmp2, 5000, 1);
DateProp(playerid);
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, \"You were Muted by an administrator in your last session; Use /report if need help from Admins.\");
}
if(PlayerInfo[playerid][pJailed] == 1)
{
format(string, sizeof(string), \"AdminJailba raktak %d másodpercre; Kérj segítséget a /report ha jogtalannak látod!\", PlayerInfo[playerid][pJailTime]);
SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(PlayerInfo[playerid][pJailed] == 2)
{
format(string, sizeof(string), \"Bezártak %d másodpercre; Kérj segítséget a /report ha jogtalannak látod!\", PlayerInfo[playerid][pJailTime]);
SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
    if(PlayerInfo[playerid][pBlind] == 1)
{
TextDrawShowForPlayer(playerid, Textdraw5);
SendClientMessage(playerid, TEAM_CYAN_COLOR, \"Kijelentkezésed elõtt Egy admin vakított téged. Írj /report-ba\");
}
else
{
    TextDrawHideForPlayer(playerid, Textdraw5);
}
if(PlayerInfo[playerid][pFMember] < 255)
{
    format(tmp2, sizeof(tmp2), \"Frakció mai üzenete: %s.\", FamilyInfo[PlayerInfo[playerid][pFMember]][FamilyMOTD]);
    SendClientMessage(playerid, COLOR_YELLOW, tmp2);
}
return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal