Facebook
From Silver, 5 Months ago, written in CSS.
This paste is a reply to from - view diff
Embed
Download Paste or View Raw
Hits: 160
  1. // Onur AKAN(trablon)`in RolePlay Modu - ALPHA //
  2.  
  3. //======== Silver ========//
  4. // OnGameModeInit callback i├žinde, gettime ├ža─č─▒r─▒larak World time'a uyarland─▒.
  5. // SQL update sorunlar─▒ d├╝zeltildi, sorunsuz bir ┼čekilde kay─▒t sa─član─▒yor. (Server.exe normal kapat─▒ld─▒─č─▒nda, OnGameModeExit'─▒ devreye sokmuyor. 'Exit' komutu ├ža─čr─▒s─▒ ile devreye giriyor.)
  6. // ZCMD eklendi.
  7. // /saveall komutu olu┼čturuldu. [Kontrol edersin reis :)]
  8. // Renkler s├╝tunu a├žt─▒m.
  9. // OnPlayerSpawn + Connect'e oyuncu renkleri ekledim.
  10. // Level de─či┼čkeni getirdim, SQL tablosuna ekledim. * Kay─▒t olduktan sonra skor otomatik 1.
  11. // Skin de─či┼čkeni geldi.
  12. // OnPlayerSpawn callback'te de─či┼čiklikler yap─▒ld─▒. * 0 isimli skin tespitinde 299 skini atayacak.
  13. // OnPlayerUpdate fonksiyonuna ki┼činin level ve skini ne ise s├╝rekli kontrol edecek. / Bunu yaparken baya─č─▒ karars─▒z kald─▒m bi kontrol edersin sen ginede....
  14. // Giri┼č yapmadan komut ve yaz─▒ g├Ânderilmeyecek.
  15. //================================================================[kutuphaneler]
  16. #include <a_samp>
  17. #include <a_mysql>
  18. #include <zcmd>
  19. //=================================================================[mod tan─▒mlama]
  20. #define         MYSQL_HOST                      "127.0.0.1"
  21. #define         MYSQL_USER                      "root"
  22. #define         MYSQL_PASSWORD          ""
  23. #define         MYSQL_DATABASE          "onurakan"
  24.  
  25. #define         ServerIsmi                      "[TR] Ikinci Ya┼čam Online - RolePlay"
  26. #define         ServerSifresi           ""
  27. #define         ServerVersiyonu         "v0.1[ALPHA]"
  28. #define         ServerDili                      "T├╝rk├že/Turkish"
  29. #define     CoderIsmi           "Onur AKAN (trablon)"
  30. #define         HaritaIsmi          "Yasam Kasabasi"
  31. #define         RconSifresi         "31cilerinsavasi"
  32.  
  33. #define         GIRIS_ZAMANI    30      // Giris Zamani
  34.  
  35. // spawn noktasi
  36. #define         DEFAULT_POS_X           -203.0484
  37. #define         DEFAULT_POS_Y           985.0094
  38. #define         DEFAULT_POS_Z           19.3617
  39. #define         DEFAULT_POS_A           354.1208
  40. // oyuncu rengi
  41. #define         CONNECT_COLOR       0x80808000 // KOYU GR─░
  42. #define         SPAWN_COLOR             0xFFFFFF00 // BEYAZ
  43. //=================================================================[renkler]
  44. #define         BEYAZ               0xFFFFFFFF
  45. #define         KIRMIZI             0xFF0000FF
  46. #define         MAVI                    0x0080FFFF
  47. #define         YESIL               0x80FF00FF
  48. #define         SIYAH               0x000000FF
  49. //=================================================================[de─či┼čkenler]
  50. new MySQL: g_SQL;
  51.  
  52. enum E_PLAYERS
  53. {
  54.         ID,
  55.         Name[MAX_PLAYER_NAME],
  56.         Password[65],
  57.         Salt[17],
  58.         Float: X_Pos,
  59.         Float: Y_Pos,
  60.         Float: Z_Pos,
  61.         Float: A_Pos,
  62.         Interior,
  63.         VirtualWorld,
  64.         Level,
  65.         Skin,
  66.        
  67.         Cache: Cache_ID,
  68.         bool: IsLoggedIn,
  69.         LoginAttempts,
  70.         LoginTimer
  71. };
  72. new Player[MAX_PLAYERS][E_PLAYERS];
  73. new g_MysqlRaceCheck[MAX_PLAYERS];
  74.  
  75. // dialog bilgileri
  76. enum
  77. {
  78.         DIALOG_UNUSED,
  79.  
  80.         DIALOG_LOGIN,
  81.         DIALOG_REGISTER
  82. };
  83. //=================================================================[degiskenler]
  84. main()
  85. {
  86.         print("[===============================================================]");
  87.         printf("Sunucu Ismi: %s",ServerIsmi);
  88.         printf("Server Versiyonu: %s",ServerVersiyonu);
  89.         printf("Server Dili: %s",ServerDili);
  90.         printf("Server Haritasi: %s",HaritaIsmi);
  91.         printf("Gelistirici: %s",CoderIsmi);
  92.         print("[===============================================================]");
  93. }
  94.  
  95. CMD:saveall(playerid,params[])
  96. {
  97.         //new x=?; if(Player[playerid][Admin] < x) return 1; // yar─▒n admin/helper hallederim
  98.         if(!IsPlayerAdmin(playerid)) return 1; // ┼čimdilik rcon ┼čart─▒ koyuyorum.
  99.         for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
  100.         {
  101.                 if (IsPlayerConnected(i))
  102.                 {
  103.                         OyuncuVerileriniGuncelle(i,1); // ┼čart koymadan ├Ânce pool'a g├Âre kaydediyorum.
  104.                         if(i==0) i+=1; // Pool idye g├Âre ├žekiyor san─▒r─▒m, bu ┼čart─▒ koyuyorum ve printf al─▒yorum.
  105.                         printf("┼×u kadar karakter kay─▒t edildi: %d",i); // ald─▒m. + ┼čart sadece yaz─▒ amac─▒nda
  106.                         i-=1;// ┼čart─▒ tekrar eski haline ├žekiyorum.
  107.                 }
  108.         }
  109.         SendClientMessage(playerid,-1,"{80FF00}[@] {FFFFFF}Aktif oyuncular─▒n veri tabanlar─▒ kaydedildi!");
  110.         return 1;
  111. }
  112.  
  113. public OnGameModeInit()
  114. {
  115.         //Server Genel Ayarlamalari
  116.         new saat, dakika, saniye;
  117.         gettime(saat, dakika, saniye);
  118.         SetWorldTime(saat);
  119.         UsePlayerPedAnims();
  120.        
  121.         new str[64];
  122.         format(str,sizeof(str),"hostname %s",ServerIsmi);
  123.    SendRconCommand(str);
  124.    if(strcmp(ServerSifresi,"", false, 4))
  125.    {
  126.         }
  127.         else
  128.         {
  129.                 format(str,sizeof(str),"password %s",ServerSifresi);
  130.         SendRconCommand(str);
  131.         }
  132.         SetGameModeText(ServerVersiyonu);
  133.         format(str,sizeof(str),"language %s",ServerDili);
  134.    SendRconCommand(str);
  135.         format(str,sizeof(str),"mapname %s",HaritaIsmi);
  136.    SendRconCommand(str);
  137.         format(str,sizeof(str),"rcon_password %s",RconSifresi);
  138.    SendRconCommand(str);
  139.         // MySQL
  140.         new MySQLOpt: option_id = mysql_init_options();
  141.         mysql_set_option(option_id, AUTO_RECONNECT, true);
  142.         g_SQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, option_id);
  143.         if (g_SQL == MYSQL_INVALID_HANDLE || mysql_errno(g_SQL) != 0)
  144.         {
  145.             print("[SISTEM]: MySQL veritabanina baglanilamadi, sunucu kapatildi.");
  146.             SendRconCommand("exit");
  147.         }
  148.         else print("[SISTEM]: MySQL veritabanina basarili bir sekilde baglanildi.");
  149.         // MySQL
  150.         VeritabaniTableEkle();
  151.         return 1;
  152. }
  153.  
  154. public OnGameModeExit()
  155. {
  156.         // Butun oyuncularin verilerini kayit et
  157.         for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
  158.         {
  159.                 if (IsPlayerConnected(i))
  160.                 {
  161.                         // Normal cikis
  162.                         OnPlayerDisconnect(i, 1);
  163.                 }
  164.         }
  165.         printf("Sunucu sorunsuz bir ┼čekilde kapat─▒ld─▒!");
  166.         mysql_close(g_SQL);
  167.         return 1;
  168. }
  169.  
  170. public OnPlayerRequestClass(playerid, classid)
  171. {
  172.         SetPlayerCameraPos(playerid, -545.7316, 1128.8561, 95.5650);
  173.         SetPlayerCameraLookAt(playerid, -544.7459, 1129.0485, 95.1698);
  174.         return 1;
  175. }
  176.  
  177. public OnPlayerConnect(playerid)
  178. {
  179.    g_MysqlRaceCheck[playerid]++;
  180.    // Oyuncunun giristeki verilerini sifirlar.
  181.         static const empty_player[E_PLAYERS];
  182.         Player[playerid] = empty_player;
  183.  
  184.         GetPlayerName(playerid, Player[playerid][Name], MAX_PLAYER_NAME);
  185.         // Islem onceligi gonder oyuncu icin
  186.         new query[103];
  187.         mysql_format(g_SQL, query, sizeof query, "SELECT * FROM `hesaplar` WHERE `isim` = '%e' LIMIT 1", Player[playerid][Name]);
  188.         mysql_tquery(g_SQL, query, "OyuncuOyunaGiris", "dd", playerid, g_MysqlRaceCheck[playerid]);
  189.         return 1;
  190. }
  191.  
  192. public OnPlayerDisconnect(playerid, reason)
  193. {
  194.         g_MysqlRaceCheck[playerid]++;
  195.  
  196.         OyuncuVerileriniGuncelle(playerid, reason);
  197.  
  198.         // Kicklenen oyuncunun verilerini sifirla.
  199.         if (cache_is_valid(Player[playerid][Cache_ID]))
  200.         {
  201.                 cache_delete(Player[playerid][Cache_ID]);
  202.                 Player[playerid][Cache_ID] = MYSQL_INVALID_CACHE;
  203.         }
  204.         if (Player[playerid][LoginTimer])
  205.         {
  206.                 KillTimer(Player[playerid][LoginTimer]);
  207.                 Player[playerid][LoginTimer] = 0;
  208.         }
  209.  
  210.         // Oyuncunun durumunu offline yap. ++
  211.         Player[playerid][IsLoggedIn] = false;
  212.         return 1;
  213. }
  214.  
  215. public OnPlayerSpawn(playerid)
  216. {
  217.         SetPlayerVirtualWorld(playerid, Player[playerid][VirtualWorld]);
  218.    SetPlayerInterior(playerid, Player[playerid][Interior]);
  219.         SetPlayerPos(playerid, Player[playerid][X_Pos], Player[playerid][Y_Pos], Player[playerid][Z_Pos]);
  220.         SetPlayerFacingAngle(playerid, Player[playerid][A_Pos]);
  221.         SetPlayerScore(playerid, Player[playerid][Level]);
  222.         SetPlayerSkin(playerid, Player[playerid][Skin]);
  223.         if(Player[playerid][Skin] == 0){ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Yasakl─▒ K─▒yafet!", "K─▒yafetiniz '0' olarak tespit edildi─či i├žin otomatik olarak de─či┼čtirildi.", "Onayla", ""); SetPlayerSkin(playerid,299);}
  224.  
  225.    SetPlayerColor(playerid,SPAWN_COLOR);
  226.         SetCameraBehindPlayer(playerid);
  227.         return 1;
  228. }
  229.  
  230. public OnPlayerDeath(playerid, killerid, reason)
  231. {
  232.         return 1;
  233. }
  234.  
  235. public OnVehicleSpawn(vehicleid)
  236. {
  237.         return 1;
  238. }
  239.  
  240. public OnVehicleDeath(vehicleid, killerid)
  241. {
  242.         return 1;
  243. }
  244.  
  245. public OnPlayerText(playerid, text[])
  246. {
  247.         if(Player[playerid][IsLoggedIn] == false) return 0;
  248.         return 1;
  249. }
  250.  
  251. public OnPlayerCommandReceived(playerid, cmdtext[])
  252. {
  253.    if(Player[playerid][IsLoggedIn] == false) return 0;
  254.         return 1;
  255. }
  256.  
  257. public OnPlayerCommandText(playerid, cmdtext[])
  258. {
  259.    if(Player[playerid][IsLoggedIn] == false) return 0;
  260.         return 0;
  261. }
  262.  
  263. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  264. {
  265.         return 1;
  266. }
  267.  
  268. public OnPlayerExitVehicle(playerid, vehicleid)
  269. {
  270.         return 1;
  271. }
  272.  
  273. public OnPlayerStateChange(playerid, newstate, oldstate)
  274. {
  275.         return 1;
  276. }
  277.  
  278. public OnPlayerEnterCheckpoint(playerid)
  279. {
  280.         return 1;
  281. }
  282.  
  283. public OnPlayerLeaveCheckpoint(playerid)
  284. {
  285.         return 1;
  286. }
  287.  
  288. public OnPlayerEnterRaceCheckpoint(playerid)
  289. {
  290.         return 1;
  291. }
  292.  
  293. public OnPlayerLeaveRaceCheckpoint(playerid)
  294. {
  295.         return 1;
  296. }
  297.  
  298. public OnRconCommand(cmd[])
  299. {
  300.         return 1;
  301. }
  302.  
  303. public OnPlayerRequestSpawn(playerid)
  304. {
  305.         return 1;
  306. }
  307.  
  308. public OnObjectMoved(objectid)
  309. {
  310.         return 1;
  311. }
  312.  
  313. public OnPlayerObjectMoved(playerid, objectid)
  314. {
  315.         return 1;
  316. }
  317.  
  318. public OnPlayerPickUpPickup(playerid, pickupid)
  319. {
  320.         return 1;
  321. }
  322.  
  323. public OnVehicleMod(playerid, vehicleid, componentid)
  324. {
  325.         return 1;
  326. }
  327.  
  328. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  329. {
  330.         return 1;
  331. }
  332.  
  333. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  334. {
  335.         return 1;
  336. }
  337.  
  338. public OnPlayerSelectedMenuRow(playerid, row)
  339. {
  340.         return 1;
  341. }
  342.  
  343. public OnPlayerExitedMenu(playerid)
  344. {
  345.         return 1;
  346. }
  347.  
  348. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  349. {
  350.         return 1;
  351. }
  352.  
  353. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  354. {
  355.         return 1;
  356. }
  357.  
  358. public OnRconLoginAttempt(ip[], password[], success)
  359. {
  360.         return 1;
  361. }
  362.  
  363. public OnPlayerUpdate(playerid)
  364. {
  365.         if(Player[playerid][IsLoggedIn] == true){Player[playerid][Skin] = GetPlayerSkin(playerid); Player[playerid][Level] = GetPlayerScore(playerid);}
  366.         return 1;
  367. }
  368.  
  369. public OnPlayerStreamIn(playerid, forplayerid)
  370. {
  371.         return 1;
  372. }
  373.  
  374. public OnPlayerStreamOut(playerid, forplayerid)
  375. {
  376.         return 1;
  377. }
  378.  
  379. public OnVehicleStreamIn(vehicleid, forplayerid)
  380. {
  381.         return 1;
  382. }
  383.  
  384. public OnVehicleStreamOut(vehicleid, forplayerid)
  385. {
  386.         return 1;
  387. }
  388.  
  389. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  390. {
  391.         switch (dialogid)
  392.         {
  393.                 case DIALOG_UNUSED: return 1;
  394.  
  395.                 case DIALOG_LOGIN:
  396.                 {
  397.                         if (!response) return Kick(playerid);
  398.  
  399.                         new hashed_pass[65];
  400.                         SHA256_PassHash(inputtext, Player[playerid][Salt], hashed_pass, 65);
  401.  
  402.                         if (strcmp(hashed_pass, Player[playerid][Password]) == 0)
  403.                         {
  404.                                 // Spawn Dialogu
  405.                                 ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Yasam Online - Kayit/Giris Sekmesi", "Basariyla giris sagladiniz.", "Onayla", "");
  406.  
  407.                                 // Oyuncunun tablodaki ID degerini cek.
  408.                                 cache_set_active(Player[playerid][Cache_ID]);
  409.  
  410.                                 OyuncununVerileriniAktar(playerid);
  411.  
  412.                                 // Aktif baglantiyi kaldir ve cache ID degiskenine gecmis aktif baglantiyi store yap.
  413.                                 cache_delete(Player[playerid][Cache_ID]);
  414.                                 Player[playerid][Cache_ID] = MYSQL_INVALID_CACHE;
  415.  
  416.                                 KillTimer(Player[playerid][LoginTimer]);
  417.                                 Player[playerid][LoginTimer] = 0;
  418.                                 Player[playerid][IsLoggedIn] = true;
  419.  
  420.                                 // Giristen sonra oyuncuyu en son kaldigi yerden baslat.
  421.                                 SetSpawnInfo(playerid, NO_TEAM, Player[playerid][Skin], Player[playerid][X_Pos], Player[playerid][Y_Pos], Player[playerid][Z_Pos], Player[playerid][A_Pos], 0, 0, 0, 0, 0, 0);
  422.                                 SpawnPlayer(playerid);
  423.                         }
  424.                         else
  425.                         {
  426.                                 Player[playerid][LoginAttempts]++;
  427.  
  428.                                 if (Player[playerid][LoginAttempts] >= 3)
  429.                                 {
  430.                                         ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Yasam Online - Kayit/Giris Sekmesi", "Fazlasiyla hatali giris yaptiniz.(3/3)", "Onayla", "");
  431.                                         DelayedKick(playerid);
  432.                                 }
  433.                                 else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Yasam Online - Kayit/Giris Sekmesi", "Yanlis sifre.\nLutfen sifrenizi tekrardan giriniz:", "Giris", "Cikis");
  434.                         }
  435.                 }
  436.                 case DIALOG_REGISTER:
  437.                 {
  438.                         if (!response) return Kick(playerid);
  439.  
  440.                         if (strlen(inputtext) <= 5) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Yasam Online - Kayit/Giris Sekmesi", "Sifreniz 5 karakterden fazla olmalidir, lutfen tekrardan sifrenizi giriniz:", "Kayit", "Cikis");
  441.  
  442.                         // 16 ASCII rastgele karkater ata.(33`ten 126`ya kadar.) TrabSALT-16
  443.                         for (new i = 0; i < 16; i++) Player[playerid][Salt][i] = random(94) + 33;
  444.                         SHA256_PassHash(inputtext, Player[playerid][Salt], Player[playerid][Password], 65);
  445.  
  446.                         new query[221];
  447.                         mysql_format(g_SQL, query, sizeof query, "INSERT INTO `hesaplar` (`isim`, `sifre`, `salt`) VALUES ('%e', '%s', '%e')", Player[playerid][Name], Player[playerid][Password], Player[playerid][Salt]);
  448.                         mysql_tquery(g_SQL, query, "OyuncuKayit", "d", playerid);
  449.                 }
  450.  
  451.                 default: return 0; // Gecersiz Dialog
  452.         }
  453.         return 1;
  454. }
  455.  
  456. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  457. {
  458.         return 1;
  459. }
  460. //================================================================[fonksiyonlar]
  461. forward OyuncuOyunaGiris(playerid, race_check);
  462. public OyuncuOyunaGiris(playerid, race_check)
  463. {
  464.         if (race_check != g_MysqlRaceCheck[playerid]) return Kick(playerid);
  465.  
  466.         new string[115];
  467.         if(cache_num_rows() > 0)
  468.         {
  469.                 cache_get_value(0, "sifre", Player[playerid][Password], 65);
  470.                 cache_get_value(0, "salt", Player[playerid][Salt], 17);
  471.                
  472.                 Player[playerid][Cache_ID] = cache_save();
  473.  
  474.                 format(string, sizeof string, "Hesabiniz `%s` olarak sisteme tanimlanmistir. Sifrenizi girerek lutfen oyuna baslayiniz:", Player[playerid][Name]);
  475.                 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Yasam Online - Kayit/Giris Sekmesi", string, "Giris", "Cikis");
  476.                
  477.                 Player[playerid][LoginTimer] = SetTimerEx("OnLoginTimeout", GIRIS_ZAMANI * 1000, false, "d", playerid);
  478.         }
  479.         else
  480.         {
  481.                 format(string, sizeof string, "Hosgeldiniz %s, sifrenizi girerek lutfen sisteme hesabinizi kayit ediniz:", Player[playerid][Name]);
  482.                 ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Yasam Online - Kayit/Giris Sekmesi", string, "Kayit", "Cikis");
  483.         }
  484.         return 1;
  485. }
  486.  
  487. forward OnLoginTimeout(playerid);
  488. public OnLoginTimeout(playerid)
  489. {
  490.         Player[playerid][LoginTimer] = 0;
  491.  
  492.         ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Yasam Online - Kayit/Giris Sekmesi", "[SISTEM]: Belirttiginiz hesaba uzun sure giris yapmadiginizdan sunucudan atildiniz.", "Onayla", "");
  493.         DelayedKick(playerid);
  494.         return 1;
  495. }
  496.  
  497. forward OyuncuKayit(playerid);
  498. public OyuncuKayit(playerid)
  499. {
  500.         Player[playerid][ID] = cache_insert_id();
  501.  
  502.         ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Yasam Online - Kayit/Giris Sekmesi", "Basariyla hesabiniz sisteme kayit oldu, otomatik olarak giris yaptiniz.", "Onayla", "");
  503.  
  504.         Player[playerid][IsLoggedIn] = true;
  505.  
  506.         Player[playerid][X_Pos] = DEFAULT_POS_X;
  507.         Player[playerid][Y_Pos] = DEFAULT_POS_Y;
  508.         Player[playerid][Z_Pos] = DEFAULT_POS_Z;
  509.         Player[playerid][A_Pos] = DEFAULT_POS_A;
  510.         Player[playerid][Level] = 1;
  511.         SetPlayerScore(playerid, 1);
  512.  
  513.         SetSpawnInfo(playerid, NO_TEAM, 0, Player[playerid][X_Pos], Player[playerid][Y_Pos], Player[playerid][Z_Pos], Player[playerid][A_Pos], 0, 0, 0, 0, 0, 0);
  514.         SpawnPlayer(playerid);
  515.        
  516.         OyuncuVerileriniGuncelle(playerid, 1);
  517.         return 1;
  518. }
  519.  
  520. forward _KickPlayerDelayed(playerid);
  521. public _KickPlayerDelayed(playerid)
  522. {
  523.         Kick(playerid);
  524.         return 1;
  525. }
  526.  
  527. //-----------------------------------------------------
  528.  
  529. OyuncununVerileriniAktar(playerid)
  530. {
  531.         cache_get_value_int(0, "id", Player[playerid][ID]);
  532.  
  533.         cache_get_value_float(0, "x", Player[playerid][X_Pos]);
  534.         cache_get_value_float(0, "y", Player[playerid][Y_Pos]);
  535.         cache_get_value_float(0, "z", Player[playerid][Z_Pos]);
  536.         cache_get_value_float(0, "angle", Player[playerid][A_Pos]);
  537.         cache_get_value_int(0, "virtualworld",Player[playerid][VirtualWorld]);
  538.         cache_get_value_int(0, "interior", Player[playerid][Interior]);
  539.         cache_get_value_int(0, "level", Player[playerid][Level]);
  540.         cache_get_value_int(0, "skin", Player[playerid][Skin]);
  541.         return 1;
  542. }
  543.  
  544. DelayedKick(playerid, time = 500)
  545. {
  546.         SetTimerEx("_KickPlayerDelayed", time, false, "d", playerid);
  547.         return 1;
  548. }
  549.  
  550. VeritabaniTableEkle()
  551. {
  552.         mysql_tquery(g_SQL, "CREATE TABLE IF NOT EXISTS `hesaplar` (`id` int(11) NOT NULL AUTO_INCREMENT,`isim` varchar(24) NOT NULL,`sifre` char(64) NOT NULL,`salt` char(16) NOT NULL,`x` float NOT NULL DEFAULT '0',`y` float NOT NULL DEFAULT '0',`z` float NOT NULL DEFAULT '0',`angle` float NOT NULL DEFAULT '0',`virtualworld` mediumint(8) NOT NULL DEFAULT '0',`interior` tinyint(3) NOT NULL DEFAULT '0',`level` int(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `username` (`isim`))");
  553.         return 1;
  554. }
  555.  
  556. OyuncuVerileriniGuncelle(playerid, reason)
  557. {
  558.         if (Player[playerid][IsLoggedIn] == false) return 0;
  559.         // oyuncu eger hatali sync. yasayip timed out yerse sunucunun bug`a girmemesi icin oyuncunun posizyonunu default degerine ata.
  560.         if (reason == 1)
  561.         {
  562.                 GetPlayerPos(playerid, Player[playerid][X_Pos], Player[playerid][Y_Pos], Player[playerid][Z_Pos]);
  563.                 GetPlayerFacingAngle(playerid, Player[playerid][A_Pos]);
  564.         }
  565.         new query[512];
  566.         format(query, sizeof query, "UPDATE `hesaplar` SET `x` = %f, `y` = %f, `z` = %f, `angle` = %f,`virtualworld` = %d, `interior` = %d, `level` = %d, `skin` = %d WHERE `id` = %d LIMIT 1", Player[playerid][X_Pos], Player[playerid][Y_Pos], Player[playerid][Z_Pos], Player[playerid][A_Pos], GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid), Player[playerid][Level], Player[playerid][Skin], Player[playerid][ID]);
  567.         mysql_tquery(g_SQL, query);
  568.         return 1;
  569. }
  570. //========================================================================[zcmd]
  571. //=========================================================================[SON]