Mysql İçin Soyekle komutu lazım
CMD:Soyekle Gibi Mysql ile Nasıl Yapabilirim? :allaalla:
Alıntı yapılan: ByJoKeR - 14 Eylül 2017, 22:03:34
Mysql İçin Soyekle komutu lazım
CMD:Soyekle Gibi Mysql ile Nasıl Yapabilirim? :allaalla:
enum soygunData
{
soyGirisCP,
soyCikisCP,
soygunCP,
Text3D: girisLabel,
Text3D: cikisLabel,
Text3D: soyLabel,
SoygunIsim[MAX_SOYGUN_ISIM],
Float: girisCP[3],
Float: soygunGirisPos[4],
Float: cikisCP[3],
Float: soygunCikisPos[4],
Float: soygunCP_[3],
soygunInterior,
soygunVirtualWorld,
soygunSure,
soygunDurum,
soygunSehir
};
//____________________________________________________________________________//
//___________________________________New's____________________________________//
new SoygunIslem[MAX_SOYGUN][soygunData];
new Iterator: Soygunlar<MAX_SOYGUN>;public OnGameModeInit()
{
mysql_tquery(mysqlnewinburayagelecek, "SELECT * FROM `soygunlar`", "SoygunYukle", "");
return 1;
}Modun en sonuna
function:SoygunYukle()
{
new rows;
cache_get_row_count(rows);
if(rows)
{
new id, yukle, label[100];
while(yukle < rows)
{
cache_get_value_name_int(yukle, "sID", id);
cache_get_value_name(yukle, "soygunIsim", SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM);
cache_get_value_name_float(yukle, "SoygunPosX", SoygunIslem[id][soygunCP_][0]);
cache_get_value_name_float(yukle, "SoygunPosY", SoygunIslem[id][soygunCP_][1]);
cache_get_value_name_float(yukle, "SoygunPosZ", SoygunIslem[id][soygunCP_][2]);
cache_get_value_name_int(yukle, "SoygunVW", SoygunIslem[id][soygunVirtualWorld]);
format(label, sizeof(label), "{FFC02E}%s(%d)\n{5CFF8F}Durum: {FFFFFF}Soyulabilir", SoygunIslem[id][SoygunIsim], id);
SoygunIslem[id][soyLabel] = Create3DTextLabel(label, -1, SoygunIslem[id][soygunCP_][0], SoygunIslem[id][soygunCP_][1], SoygunIslem[id][soygunCP_][2], 25.0, SoygunIslem[id][soygunVirtualWorld], 0);
SoygunIslem[id][soygunCP] = CreateDynamicCP(SoygunIslem[id][soygunCP_][0], SoygunIslem[id][soygunCP_][1], SoygunIslem[id][soygunCP_][2],1.0, SoygunIslem[id][soygunVirtualWorld],-1,-1,50.0);
Iter_Add(Soygunlar, id);
yukle++;
}
printf("\n -----> [SOYGUN] Toplam yuklenen soygun mekan sayisi: %d\n", yukle);
}
else
{
printf("\n -----> [SOYGUN] Veritabaninda soygun mekani olmadigi icin soygunlar yuklenmedi !\n");
}
return 1;
}CMD:soyekle(playerid, params[])
{
if(OyuncuBilgi[playerid][oAdmin] < 6) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu Komutu Kullanmak İçin Sahip Olmalısınız.");
new id = Iter_Free(Soygunlar), i[MAX_SOYGUN_ISIM], Float: pos[3];
if(sscanf(params, "s[56]", i)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Kullanımı: {FFFFFF}/Soyekle [SOYGUN ISIM]");
format(SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM, i);
new wv2 = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SoygunIslem[id][soygunCP_][0] = pos[0];
SoygunIslem[id][soygunCP_][1] = pos[1];
SoygunIslem[id][soygunCP_][2] = pos[2];
new query[250], label[100];
mysql_format(Mert, query, sizeof(query),"INSERT INTO `soygunlar`(`sID`, `SoygunIsim`, `SoygunPosX`, `SoygunPosY`, `SoygunPosZ`, `SoygunVW`) VALUES ('%d', '%e', '%f', '%f', '%f', '%d')", id, i, pos[0], pos[1], pos[2], wv2);
mysql_tquery(Mert, query, "","");
Iter_Add(Soygunlar, id);
format(label, sizeof(label), "{FFC02E}%s(%d)\n{5CFF8F}Durum: {FFFFFF}Soyulabilir", i, id);
SoygunIslem[id][soyLabel] = Create3DTextLabel(label, -1, pos[0], pos[1], pos[2], 25.0, wv2, 0);
SoygunIslem[id][soygunCP] = CreateDynamicCP(pos[0], pos[1], pos[2], 1.0, wv2,-1,-1,50.0);
format(query,sizeof(query),"<< SYSTEM >> {FFFFFF}Sunucuya %s Adlı Soygun Noktası Eklendi.",i);
SendClientMessageToAll(COLOR_GENEL, query);
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Adlı Soygun Noktası Oluşturuldu, ID: %d", i, id);
SendClientMessage(playerid, COLOR_GENEL, query);
return 1;
}
CMD:soysil(playerid, params[])
{
if(OyuncuBilgi[playerid][oAdmin] < 6) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu Komutu Kullanmak İçin Sahip Olmalısınız.");
new id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Kullanım: {FFFFFF}/Soysil [ID]");
if(!Iter_Contains(Soygunlar, id)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu ID'de Bir Soygun Noktası Bulunmamakta!");
format(SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM, "");
SoygunIslem[id][soygunCP_][0] = 0.0;
SoygunIslem[id][soygunCP_][1] = 0.0;
SoygunIslem[id][soygunCP_][2] = 0.0;
Delete3DTextLabel(SoygunIslem[id][soyLabel]);
DestroyDynamicCP(SoygunIslem[id][soygunCP]);
new query[64];
mysql_format(Mert, query, sizeof(query), "DELETE FROM soygunlar WHERE sid=%d", id);
mysql_tquery(Mert, query, "", "");
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Adlı Yetkili %s Isimli Soygun Mekanını Sildi.",GetName(playerid), SoygunIslem[id][SoygunIsim]);
SendClientMessageToAll(COLOR_GENEL, query);
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Isimli Soygun Mekanını Silindi, ID:%d.",SoygunIslem[id][SoygunIsim], id);
SendClientMessageToAll(COLOR_GENEL, query);
Iter_Remove(Soygunlar, id);
return 1;
}Pottus420 Benim için hediye mod yapmıştı onda bunlar vardı.
Hata olursa söyle.
Alıntı yapılan: STaRDuST10 - 14 Eylül 2017, 22:10:52
Hata olursa söyle.
Mysql Tablosunda Neleri Oluşturacağım ??
Alıntı yapılan: ByJoKeR - 14 Eylül 2017, 22:43:18
Alıntı yapılan: STaRDuST10 - 14 Eylül 2017, 22:10:52
Hata olursa söyle.
Mysql Tablosunda Neleri Oluşturacağım ??
Tabloları otomatik oluşturması gerek ama bi dene öyleyken. Oluşturur galiba
Alıntı yapılan: STaRDuST10 - 14 Eylül 2017, 22:10:21
Alıntı yapılan: ByJoKeR - 14 Eylül 2017, 22:03:34
Mysql İçin Soyekle komutu lazım
CMD:Soyekle Gibi Mysql ile Nasıl Yapabilirim? :allaalla:
enum soygunData
{
soyGirisCP,
soyCikisCP,
soygunCP,
Text3D: girisLabel,
Text3D: cikisLabel,
Text3D: soyLabel,
SoygunIsim[MAX_SOYGUN_ISIM],
Float: girisCP[3],
Float: soygunGirisPos[4],
Float: cikisCP[3],
Float: soygunCikisPos[4],
Float: soygunCP_[3],
soygunInterior,
soygunVirtualWorld,
soygunSure,
soygunDurum,
soygunSehir
};
//____________________________________________________________________________//
//___________________________________New's____________________________________//
new SoygunIslem[MAX_SOYGUN][soygunData];
new Iterator: Soygunlar<MAX_SOYGUN>;
public OnGameModeInit()
{
mysql_tquery(mysqlnewinburayagelecek, "SELECT * FROM `soygunlar`", "SoygunYukle", "");
return 1;
}
Modun en sonuna
function:SoygunYukle()
{
new rows;
cache_get_row_count(rows);
if(rows)
{
new id, yukle, label[100];
while(yukle < rows)
{
cache_get_value_name_int(yukle, "sID", id);
cache_get_value_name(yukle, "soygunIsim", SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM);
cache_get_value_name_float(yukle, "SoygunPosX", SoygunIslem[id][soygunCP_][0]);
cache_get_value_name_float(yukle, "SoygunPosY", SoygunIslem[id][soygunCP_][1]);
cache_get_value_name_float(yukle, "SoygunPosZ", SoygunIslem[id][soygunCP_][2]);
cache_get_value_name_int(yukle, "SoygunVW", SoygunIslem[id][soygunVirtualWorld]);
format(label, sizeof(label), "{FFC02E}%s(%d)\n{5CFF8F}Durum: {FFFFFF}Soyulabilir", SoygunIslem[id][SoygunIsim], id);
SoygunIslem[id][soyLabel] = Create3DTextLabel(label, -1, SoygunIslem[id][soygunCP_][0], SoygunIslem[id][soygunCP_][1], SoygunIslem[id][soygunCP_][2], 25.0, SoygunIslem[id][soygunVirtualWorld], 0);
SoygunIslem[id][soygunCP] = CreateDynamicCP(SoygunIslem[id][soygunCP_][0], SoygunIslem[id][soygunCP_][1], SoygunIslem[id][soygunCP_][2],1.0, SoygunIslem[id][soygunVirtualWorld],-1,-1,50.0);
Iter_Add(Soygunlar, id);
yukle++;
}
printf("\n -----> [SOYGUN] Toplam yuklenen soygun mekan sayisi: %d\n", yukle);
}
else
{
printf("\n -----> [SOYGUN] Veritabaninda soygun mekani olmadigi icin soygunlar yuklenmedi !\n");
}
return 1;
}
CMD:soyekle(playerid, params[])
{
if(OyuncuBilgi[playerid][oAdmin] < 6) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu Komutu Kullanmak İçin Sahip Olmalısınız.");
new id = Iter_Free(Soygunlar), i[MAX_SOYGUN_ISIM], Float: pos[3];
if(sscanf(params, "s[56]", i)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Kullanımı: {FFFFFF}/Soyekle [SOYGUN ISIM]");
format(SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM, i);
new wv2 = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SoygunIslem[id][soygunCP_][0] = pos[0];
SoygunIslem[id][soygunCP_][1] = pos[1];
SoygunIslem[id][soygunCP_][2] = pos[2];
new query[250], label[100];
mysql_format(Mert, query, sizeof(query),"INSERT INTO `soygunlar`(`sID`, `SoygunIsim`, `SoygunPosX`, `SoygunPosY`, `SoygunPosZ`, `SoygunVW`) VALUES ('%d', '%e', '%f', '%f', '%f', '%d')", id, i, pos[0], pos[1], pos[2], wv2);
mysql_tquery(Mert, query, "","");
Iter_Add(Soygunlar, id);
format(label, sizeof(label), "{FFC02E}%s(%d)\n{5CFF8F}Durum: {FFFFFF}Soyulabilir", i, id);
SoygunIslem[id][soyLabel] = Create3DTextLabel(label, -1, pos[0], pos[1], pos[2], 25.0, wv2, 0);
SoygunIslem[id][soygunCP] = CreateDynamicCP(pos[0], pos[1], pos[2], 1.0, wv2,-1,-1,50.0);
format(query,sizeof(query),"<< SYSTEM >> {FFFFFF}Sunucuya %s Adlı Soygun Noktası Eklendi.",i);
SendClientMessageToAll(COLOR_GENEL, query);
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Adlı Soygun Noktası Oluşturuldu, ID: %d", i, id);
SendClientMessage(playerid, COLOR_GENEL, query);
return 1;
}
CMD:soysil(playerid, params[])
{
if(OyuncuBilgi[playerid][oAdmin] < 6) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu Komutu Kullanmak İçin Sahip Olmalısınız.");
new id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Kullanım: {FFFFFF}/Soysil [ID]");
if(!Iter_Contains(Soygunlar, id)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu ID'de Bir Soygun Noktası Bulunmamakta!");
format(SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM, "");
SoygunIslem[id][soygunCP_][0] = 0.0;
SoygunIslem[id][soygunCP_][1] = 0.0;
SoygunIslem[id][soygunCP_][2] = 0.0;
Delete3DTextLabel(SoygunIslem[id][soyLabel]);
DestroyDynamicCP(SoygunIslem[id][soygunCP]);
new query[64];
mysql_format(Mert, query, sizeof(query), "DELETE FROM soygunlar WHERE sid=%d", id);
mysql_tquery(Mert, query, "", "");
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Adlı Yetkili %s Isimli Soygun Mekanını Sildi.",GetName(playerid), SoygunIslem[id][SoygunIsim]);
SendClientMessageToAll(COLOR_GENEL, query);
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Isimli Soygun Mekanını Silindi, ID:%d.",SoygunIslem[id][SoygunIsim], id);
SendClientMessageToAll(COLOR_GENEL, query);
Iter_Remove(Soygunlar, id);
return 1;
}
Pottus420 Benim için hediye mod yapmıştı onda bunlar vardı.
O modun orjinal yapımcısı benim, bu kod eksik. Tam hali bende mevcut :)
Alıntı yapılan: NexoR - 14 Eylül 2017, 23:16:02
Alıntı yapılan: STaRDuST10 - 14 Eylül 2017, 22:10:21
Alıntı yapılan: ByJoKeR - 14 Eylül 2017, 22:03:34
Mysql İçin Soyekle komutu lazım
CMD:Soyekle Gibi Mysql ile Nasıl Yapabilirim? :allaalla:
enum soygunData
{
soyGirisCP,
soyCikisCP,
soygunCP,
Text3D: girisLabel,
Text3D: cikisLabel,
Text3D: soyLabel,
SoygunIsim[MAX_SOYGUN_ISIM],
Float: girisCP[3],
Float: soygunGirisPos[4],
Float: cikisCP[3],
Float: soygunCikisPos[4],
Float: soygunCP_[3],
soygunInterior,
soygunVirtualWorld,
soygunSure,
soygunDurum,
soygunSehir
};
//____________________________________________________________________________//
//___________________________________New's____________________________________//
new SoygunIslem[MAX_SOYGUN][soygunData];
new Iterator: Soygunlar<MAX_SOYGUN>;
public OnGameModeInit()
{
mysql_tquery(mysqlnewinburayagelecek, "SELECT * FROM `soygunlar`", "SoygunYukle", "");
return 1;
}
Modun en sonuna
function:SoygunYukle()
{
new rows;
cache_get_row_count(rows);
if(rows)
{
new id, yukle, label[100];
while(yukle < rows)
{
cache_get_value_name_int(yukle, "sID", id);
cache_get_value_name(yukle, "soygunIsim", SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM);
cache_get_value_name_float(yukle, "SoygunPosX", SoygunIslem[id][soygunCP_][0]);
cache_get_value_name_float(yukle, "SoygunPosY", SoygunIslem[id][soygunCP_][1]);
cache_get_value_name_float(yukle, "SoygunPosZ", SoygunIslem[id][soygunCP_][2]);
cache_get_value_name_int(yukle, "SoygunVW", SoygunIslem[id][soygunVirtualWorld]);
format(label, sizeof(label), "{FFC02E}%s(%d)\n{5CFF8F}Durum: {FFFFFF}Soyulabilir", SoygunIslem[id][SoygunIsim], id);
SoygunIslem[id][soyLabel] = Create3DTextLabel(label, -1, SoygunIslem[id][soygunCP_][0], SoygunIslem[id][soygunCP_][1], SoygunIslem[id][soygunCP_][2], 25.0, SoygunIslem[id][soygunVirtualWorld], 0);
SoygunIslem[id][soygunCP] = CreateDynamicCP(SoygunIslem[id][soygunCP_][0], SoygunIslem[id][soygunCP_][1], SoygunIslem[id][soygunCP_][2],1.0, SoygunIslem[id][soygunVirtualWorld],-1,-1,50.0);
Iter_Add(Soygunlar, id);
yukle++;
}
printf("\n -----> [SOYGUN] Toplam yuklenen soygun mekan sayisi: %d\n", yukle);
}
else
{
printf("\n -----> [SOYGUN] Veritabaninda soygun mekani olmadigi icin soygunlar yuklenmedi !\n");
}
return 1;
}
CMD:soyekle(playerid, params[])
{
if(OyuncuBilgi[playerid][oAdmin] < 6) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu Komutu Kullanmak İçin Sahip Olmalısınız.");
new id = Iter_Free(Soygunlar), i[MAX_SOYGUN_ISIM], Float: pos[3];
if(sscanf(params, "s[56]", i)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Kullanımı: {FFFFFF}/Soyekle [SOYGUN ISIM]");
format(SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM, i);
new wv2 = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SoygunIslem[id][soygunCP_][0] = pos[0];
SoygunIslem[id][soygunCP_][1] = pos[1];
SoygunIslem[id][soygunCP_][2] = pos[2];
new query[250], label[100];
mysql_format(Mert, query, sizeof(query),"INSERT INTO `soygunlar`(`sID`, `SoygunIsim`, `SoygunPosX`, `SoygunPosY`, `SoygunPosZ`, `SoygunVW`) VALUES ('%d', '%e', '%f', '%f', '%f', '%d')", id, i, pos[0], pos[1], pos[2], wv2);
mysql_tquery(Mert, query, "","");
Iter_Add(Soygunlar, id);
format(label, sizeof(label), "{FFC02E}%s(%d)\n{5CFF8F}Durum: {FFFFFF}Soyulabilir", i, id);
SoygunIslem[id][soyLabel] = Create3DTextLabel(label, -1, pos[0], pos[1], pos[2], 25.0, wv2, 0);
SoygunIslem[id][soygunCP] = CreateDynamicCP(pos[0], pos[1], pos[2], 1.0, wv2,-1,-1,50.0);
format(query,sizeof(query),"<< SYSTEM >> {FFFFFF}Sunucuya %s Adlı Soygun Noktası Eklendi.",i);
SendClientMessageToAll(COLOR_GENEL, query);
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Adlı Soygun Noktası Oluşturuldu, ID: %d", i, id);
SendClientMessage(playerid, COLOR_GENEL, query);
return 1;
}
CMD:soysil(playerid, params[])
{
if(OyuncuBilgi[playerid][oAdmin] < 6) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu Komutu Kullanmak İçin Sahip Olmalısınız.");
new id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Kullanım: {FFFFFF}/Soysil [ID]");
if(!Iter_Contains(Soygunlar, id)) return SendClientMessage(playerid, COLOR_GENEL, "<< ! >> Bu ID'de Bir Soygun Noktası Bulunmamakta!");
format(SoygunIslem[id][SoygunIsim], MAX_SOYGUN_ISIM, "");
SoygunIslem[id][soygunCP_][0] = 0.0;
SoygunIslem[id][soygunCP_][1] = 0.0;
SoygunIslem[id][soygunCP_][2] = 0.0;
Delete3DTextLabel(SoygunIslem[id][soyLabel]);
DestroyDynamicCP(SoygunIslem[id][soygunCP]);
new query[64];
mysql_format(Mert, query, sizeof(query), "DELETE FROM soygunlar WHERE sid=%d", id);
mysql_tquery(Mert, query, "", "");
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Adlı Yetkili %s Isimli Soygun Mekanını Sildi.",GetName(playerid), SoygunIslem[id][SoygunIsim]);
SendClientMessageToAll(COLOR_GENEL, query);
format(query, sizeof(query), "<< SYSTEM >> {FFFFFF}%s Isimli Soygun Mekanını Silindi, ID:%d.",SoygunIslem[id][SoygunIsim], id);
SendClientMessageToAll(COLOR_GENEL, query);
Iter_Remove(Soygunlar, id);
return 1;
}
Pottus420 Benim için hediye mod yapmıştı onda bunlar vardı.
O modun orjinal yapımcısı benim, bu kod eksik. Tam hali bende mevcut :)
Pottus bana ben yaptım demişti ama :(
https://xpdevil.wordpress.com/2017/04/09/fs-xrobbery-kasa-soyma-sistemi/
(Selam olsun buradan kendisine. :D)