25.04.2009, 13:03
debian version?
Originally Posted by [MG
mysan ]
I have a problem . Plugin doesn't work on VPS server WINDOWS SERVER 2003. Plugin by adrenaline work but no have needed functions |
Originally Posted by Reamis
debian version?
|
Originally Posted by mabako
Quote:
Quote:
|
new pass[128];
mysql_fetch_field_row(pass, "password");
print(pass);
Originally Posted by Sneaky.
|
Originally Posted by krisk
And the inbuilt debug makes it so much easier to run betas/tests.
|
[08:19:39] mysql_fetch_row(МъЈ
ПъЈ
ЧъЈ
ЯъЈ
// and so on
Originally Posted by ǝɹoɯ‾ʎ
Quote:
pawn Код:
|
I've also noticed an overall performance increase/less CPU usage, and things works as supposed to here, no need to do lame walk-arounds to free memory and stuff like that, generally easy to understand, even Damian wanted to try out on SQL when we switched |
public OnPlayerLogin(playerid,password[]) { MYSQLBaglantiKontrol(); new tmp2[256]; new string2[64]; new Isim[MAX_PLAYER_NAME]; GetPlayerName(playerid, Isim, sizeof(Isim)); new query[MAX_STRING]; new query2[MAX_STRING]; format(query,sizeof(query),"SELECT * FROM `oyuncular` WHERE Name = '%s' AND Password = '%s'",Isim,password); mysql_query(query); mysql_store_result(); if(mysql_num_rows() == 1) { mysql_free_result(); MYSQLOyuncuGiris(playerid, PlayerInfo[playerid][pSQLID]); } else { mysql_free_result(); SendClientMessage(playerid, COLOR_WHITE, "SUNUCU: Sifrenizi yanlis girdiniz."); gPlayerLogTries[playerid] += 1; if(gPlayerLogTries[playerid] == 4) { Ban(playerid); } return 1; } PlayerInfo[playerid][pAdjustable] = 0; NormalParaSil(playerid); ConsumingMoney[playerid] = 1; NormalParaVer(playerid,PlayerInfo[playerid][pCash]); CurrentMoney[playerid] = PlayerInfo[playerid][pCash]; if(PlayerInfo[playerid][pReg] == 0) { new tckimlik = 10000000000 + random(24000000000); format(query2, sizeof(query2), "SELECT * FROM oyuncular WHERE LOWER(TC) = LOWER('%s')", tckimlik); mysql_query(query2); mysql_store_result(); if(mysql_num_rows() == 0) { PlayerInfo[playerid][pTC] = tckimlik; PlayerInfo[playerid][pReg] = 1; } mysql_free_result(); } if(PlayerInfo[playerid][pHesapKilit] == 1) { Ban(playerid); } if (PlayerInfo[playerid][pHikayeKabul] == 0) { SendClientMessage(playerid, COLOR_LIGHTRED, "..:BILGI: Hikayeniz henuz kontrol edilmemis."); SendClientMessage(playerid, COLOR_LIGHTRED, "..:BILGI: Hikayeniz kontrol edilince size E-Posta ile bildirilecektir."); Kick(playerid); } if(PlayerInfo[playerid][pKO] == 1) { format(string2, sizeof(string2), "..:BILGI: Hayatinizi kaybettiniz. Yeni bir hesap aliniz."); SendClientMessage(playerid, COLOR_WHITE, string2); Kick(playerid); } if(PlayerInfo[playerid][pVaaz] > 0) { SendClientMessage(playerid, COLOR_WHITE,"..:BILGI: Vaaziniz sonra erdi."); VaazBitir(playerid); PlayerInfo[playerid][pVaaz] = 0; } if (PlayerInfo[playerid][pDonateRank] > 0) { SendClientMessage(playerid, COLOR_WHITE,"..:BILGI: Siz ust seviye bir kullanicisiniz."); } new isim[MAX_PLAYER_NAME], soyisim[MAX_PLAYER_NAME]; RPName(PlayerName(playerid),isim,soyisim) format(string2, sizeof(string2), "..:BILGI: Sayin %s, hosgeldiniz.",soyisim); SendClientMessage(playerid, COLOR_WHITE,string2); printf("%s giris yapti.",Isim); new nxtlevel = PlayerInfo[playerid][pLevel]+1; new expamount = nxtlevel*levelexp; PlayerInfo[playerid][pSeviyeTavan] = expamount; SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1); gPlayerLogged[playerid] = 1; SpawnPlayer(playerid); format(tmp2, sizeof(tmp2), "~w~Hosgeldiniz ~n~~y~ %s", Isim); DateProp(playerid); GameTextForPlayer(playerid, tmp2, 5000, 1); SendClientMessage(playerid, COLOR_YELLOW, motd); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pMaskeKullanim] == 1) { ShowPlayerNameTagForPlayer(playerid, i, 0); } } } PlayerInfo[playerid][pMuted] = 0; OnPlayerUpdate(playerid); return 1; }
Originally Posted by G-sTyLeZzZ
Код:
Update as of 06/28/09: - It's important that you recompile your script with the newest include file before using the plugin - Fixed various reported bugs such as mysql_debug - Improved almost all functions to decrease CPU usage - Added a alternative second parameter to 'mysql_query()' in combination with a new callback named 'OnQueryFinish()' to check whether a query is finished or not (suggested,tested and used by krisk) - Added 'mysql_insert_id()' (suggested by Gehaktbal) |
if(G_THREAD_LOGON_ID == -1)
{
G_THREAD_LOGON_ID = playerid;
mysql_query(query, D_THREAD_USERLOGON);
return 1;
}
else
{
new szRes[64];
format(szRes, sizeof(szRes), "Thread is busy by %i", G_THREAD_LOGON_ID);
return SendClientMessage(playerid, COLOR_YELLOW, szRes);
}
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
printf("Query with result id %d has finished! (Connection ID %d | Query: %s)",resultid,connectionHandle,query);
switch(resultid)
{
case D_THREAD_USERLOGON:
{
USERSYS_Receive_Thread(query);
}
default:
{
}
}
return 1;
}