- เครดิต
- 89
- ความรู้
-
- เงิน $
-
- ความดี
-
|
คือปกติมันจะเซฟใน SQL เวลายึด zone ครับ ไฟล์ SQL คือ gangzones
ส่วนนี้คือค่าตัวแปลทั้งหมดครับ
// SaveZone
SaveZone(id)
{
new
query[128];
format(query, sizeof(query), "UPDATE `gangzones` SET `zoneOwnerID` = '%d', `gZoneAttackDelay` = '%d' WHERE `zoneindex` = '%d'",
GangZoneInfo[id][gZoneOwner],
GangZoneInfo[id][gZoneAttackDelay],
GangZoneInfo[id][gZoneSID]
);
return mysql_tquery(g_iHandle, query);
}
// Server_Load(
Server_Load();
mysql_tquery(g_iHandle, "SELECT * FROM `billboards`", "Billboard_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `houses`", "House_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `businesses`", "Business_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `dropped`", "Dropped_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `entrances`", "Entrance_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `cars` WHERE truncated = 0", "Car_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `jobs`", "Job_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `crates`", "Crate_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `plants`", "Plant_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `factions`", "Faction_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `arrestpoints`", "Arrest_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `gates`", "Gate_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `backpacks`", "Backpack_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `impoundlots`", "Impound_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `atm`", "ATM_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `garbage`", "Garbage_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `vendors`", "Vendor_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `gunracks`", "Rack_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `speedcameras`", "Speed_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `graffiti`", "Graffiti_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `detectors`", "Detector_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `gangzones`", "ZoneLoad", "");
mysql_tquery(g_iHandle, "SELECT * FROM `rp_vehicle_models`", "VehicleModel_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `rp_radio`", "Radio_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `spray`", "Spray_Load", "");
mysql_tquery(g_iHandle, "SELECT * FROM `wood`", "Wood_Load", "");
// public OnPlayerSpawn
GangZoneShowForPlayer(playerid, GangZoneWar[i], GetFactionColor(GangZoneInfo[i][gZoneOwner]));
CMD:editzone(playerid, params[])
{
if(PlayerData[playerid][pAdmin] >= 1) {
new
ans,
i;
if(sscanf(params, "i", ans))
{
SyntaxMsg(playerid, "/editzone [factionid]");
}
else
{
if(ans == -1)
{
i = GetPlayerGZone(playerid);
GangZoneStopFlashForAll(GangZoneWar[i]);
GangZoneInfo[i][gZoneOwner] = -1;
GangZoneInfo[i][gZoneAttackDelay] = 0;
GangZoneShowForAll(GangZoneWar[i], GetFactionColor(-1));
SaveZone(i);
}
else
{
if (FactionData[ans][factionType] != FACTION_GANG)
{
i = GetPlayerGZone(playerid);
GangZoneStopFlashForAll(GangZoneWar[i]);
GangZoneInfo[i][gZoneOwner] = ans;
GangZoneInfo[i][gZoneAttackDelay] = 0;
GangZoneShowForAll(GangZoneWar[i], GetFactionColor(ans));
SaveZone(i);
}
else ErrorMsg(playerid, "äÍ´Õ¡ÅØèÁ/á¡ê§¤ì·ÕèÃкØäÁèãªèá¡ê§¤ì");
}
}
}
return 1;
}
พระเอกของเราคำสั่ง takezone
CMD:takezone(playerid, params[]) {//AddGang
new gang = PlayerData[playerid][pFaction];
if (PlayerData[playerid][pFactionRank] < FactionData[gang][factionRanks] - 1)
return ErrorMsg(playerid, "¤Ø³µéͧÁÕÂÈÍÂèÒ§µèÓ %d", FactionData[gang][factionRanks] - 1);
if(FactionData[gang][factionType] == FACTION_GANG && gang != -1)
{
new stillzone;
if((stillzone = GetPlayerGZone(playerid)) != -1)
{
new eminem = GangZoneInfo[stillzone][gZoneOwner];
if(gang != eminem)
{
if(GangZoneInfo[stillzone][gZoneAttackDelay] <= 0)
{
if(eminem == -1)
{
SendFactionMessage(gang, COLOR_RADIO, "RADIO: %s ä´éÂִ⫹·ÕèäÁèÁÕà¨éҢͧ", ReturnName(playerid, 0));
GangZoneInfo[stillzone][gZoneOwner] = gang;
GangZoneShowForAll(GangZoneWar[stillzone], GetFactionColor(gang));
GangZoneInfo[stillzone][gZoneAttack] = -1;
SaveZone(stillzone);
}
else
{
if(!IsGangAttack(gang) && !IsGangAttack(eminem))
{
new alleminem = GangOnline(eminem), allfriendly = GangOnlineInSameZone(gang, stillzone);
/*foreach(new x: Player)
{
if(IsPlayerConnected(x) && PlayerData[x][pFaction] == gang && IsPlayerInGZone(x, stillzone))
{
allfriendly++;
}
if(IsPlayerConnected(x) && PlayerData[x][pFaction] == eminem)
{
alleminem++;
}
}*/
if(allfriendly >= 3)
{
if(alleminem >= 3)
{
SendClientMessageToAllEx(-1, "DEBUG: ½èÒ·éÒ (/takezone) ÁÕ¾Ãä¾Ç¡ %d ªÕÇÔµáÅÐÈѵÃÙ¡ÇèÒ %d ªÕÇÔµ", allfriendly, alleminem);
GangZoneInfo[stillzone][gZoneAttack] = gang;
GangZoneInfo[stillzone][gZoneAttackTime] = 0;
GangZoneInfo[stillzone][gZoneAttackNon] = 0;
GangZoneFlashForAll(GangZoneWar[stillzone], GetFactionColor(gang));
SendFactionMessage(gang, COLOR_RADIO, "RADIO: ࢵ⫹¢Í§ %s ¡ÓÅѧ¶Ù¡ %s ÂÖ´¾×é¹·Õè", GetFactionName(eminem), GetFactionName(gang));
SendFactionMessage(eminem, COLOR_RADIO, "RADIO: %s ¾ÂÒÂÒÁ·Õè¨ÐÂÖ´¾×é¹·Õè¢Í§ %s", GetFactionName(gang), GetFactionName(eminem));
}
else
{
SendClientMessage(playerid, COLOR_GREY, " µéͧÁÕÈѵÃÙ·Õèà»ç¹à¨éҢͧ⫹¹ÕéÍ͹äŹìÁÒ¡¡ÇèÒ 10 ¤¹¢Öé¹ä»");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " µéͧÁÕÊÁÒªÔ¡ÍÂÙèã¹â«¹à´ÕÂǡѺ¤Ø³ÁÒ¡¡ÇèÒ 6 ¤¹¢Öé¹ä»");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " ÁÕ⫹Í×蹢ͧ¤Ø³ËÃ×ͧ͢ÈѵÃÙ¡ÓÅѧ¡ÃоÃÔºÍÂÙè");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " ⫹¹ÕéÍÂÙè㹪èǧ Cooldown");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " ⫹¹Õéà»ç¹¢Í§¤Ø³ÍÂÙèáÅéÇ");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " ¤Ø³äÁèãªè¼Ùé¹Ó¡ÅØèÁ/á¡ê§¤ì");
}
return 1;
}
|
|