08.02.2013, 21:56
Ola a Todos, estou usando uma include que eu modifiquei de gang zones: https://sampforum.blast.hk/showthread.php?tid=292488
bom, ela esta apresentando o seguinte erro, quando estou dentro de uma gangzone e dou /dominar fala que nгo estou nela, segue os codigos:
TOPO DO GAMEMODE
Em um Local Qualquer:
Comando para Dominar:
alguem pode por favor me ajudar? desde ja agradeзo
bom, ela esta apresentando o seguinte erro, quando estou dentro de uma gangzone e dou /dominar fala que nгo estou nela, segue os codigos:
TOPO DO GAMEMODE
pawn Код:
forward DominateGangZone(pid, gzid);
enum gangg
{
Float:gangzoneY2, Name[MAX_GZNAME], Dono[MAX_PLAYER_NAME],
Float:gangzoneX, Float:gangzoneY, Float:gangzoneX2,
Ganha, Cor
};
new
GangZone[MAX_GANGZONES][gangg],
GangZoneID[MAX_GANGZONES] = -1,
MyTIME[32],
gID = 0
;
pawn Код:
// ================================= INCLUDE CAROL'S GANG ZONE ===================================
stock GetGangZoneIDFromName(gangname[])
{
for(new i; i < MAX_GANGZONES; ++i)
{
if(!strcmp(gangname, GangZone[i][Name], true)) return i;
}
return -1;
}
stock CreateGangZone(gangzonename[], Float:x, Float:y, Float:x2, Float:y2, color, lucro)
{
if(gID == MAX_GANGZONES)
{
print("\n\n Limite de GangZones Estourados!\n\n");
return 0;
}
format(GangZone[gID][Name], MAX_GZNAME, gangzonename);
GangZone[gID][gangzoneX] = x;
GangZone[gID][gangzoneY] = y;
GangZone[gID][gangzoneX2] = x2;
GangZone[gID][gangzoneY2] = y2;
GangZone[gID][Cor] = color;
GangZone[gID][Ganha] = lucro;
GangZoneID[gID] = GangZoneCreate(GangZone[gID][gangzoneX], GangZone[gID][gangzoneY], GangZone[gID][gangzoneX2], GangZone[gID][gangzoneY2]);
return gID++;
}
stock LoadGangZones()
{
for(new i; i < gID; ++i)
{
ShowGangZone(i);
}
}
stock PlayerGangZone(pid)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(pid, X, Y, Z);
for(new i; i < MAX_GANGZONES; ++i)
{
if (X > GangZone[i][gangzoneX] && X < GangZone[i][gangzoneX2] && Y > GangZone[i][gangzoneY] && Y < GangZone[i][gangzoneY2])
{
return i;
}
}
return -1;
}
public DominateGangZone(pid, gzid)
{
if(PlayerGangZone(pid) == -1)
return GangZoneStopFlashForAll(gzid);
if(MyTIME[pid] == MAX_TIMEDOMINATE)
{
GameTextForPlayer(pid, "~b~Dominado]", 3000, 1);
MyTIME[pid] = 0;
GangZoneStopFlashForAll(gzid);
GangZone[gzid][Cor] = GetPlayerColor(pid) + LIGHTER_COLOR;
GangZoneShowForAll(gzid,GetPlayerColor(pid) + LIGHTER_COLOR);
format(GangZone[gzid][Dono], strlen(GetNick(pid)), GetNick(pid));
new string[204], orgg[104];
if(PlayerInfo[pid][Boys] >= 1) { orgg = "os Da Nang Boys"; }
if(PlayerInfo[pid][Triads] >= 1) { orgg = "os Triads"; }
if(PlayerInfo[pid][FBI] >= 1) { orgg = "o FBI"; }
if(PlayerInfo[pid][SWAT] >= 1) { orgg = "a SWAT"; }
if(PlayerInfo[pid][Rifa] >= 1) { orgg = "os SF Rifa's"; }
if(PlayerInfo[pid][Mafia] >= 1) { orgg = "a Mafia"; }
format(string, sizeof(string),"[GZ.INFO]O %s e %s conseguiram dominar % | Local: /gps",GetNick(pid), orgg, GetGangZoneName(gzid));
return false;
}
new _st[100];
format(_st, sizeof(_st),"~b~Dominando a gangzone ~w~%s~n~(%d/%d)",GetGangZoneName(gzid), MyTIME[pid], MAX_TIMEDOMINATE);
GameTextForPlayer(pid, _st, 1200, 1);
new striing[204], org[104];
if(PlayerInfo[pid][Boys] >= 1) { org = "os Da Nang Boys"; }
if(PlayerInfo[pid][Triads] >= 1) { org = "os Triads"; }
if(PlayerInfo[pid][FBI] >= 1) { org = "o FBI"; }
if(PlayerInfo[pid][SWAT] >= 1) { org = "a SWAT"; }
if(PlayerInfo[pid][Rifa] >= 1) { org = "os SF Rifa's"; }
if(PlayerInfo[pid][Mafia] >= 1) { org = "a Mafia"; }
format(striing, sizeof(striing),"[GZ.INFO]O %s e %s estгo tentando dominar % | Local: /gps",GetNick(pid), org, GetGangZoneName(gzid));
SendClientMessageToAll(GetPlayerColor(pid), striing);
GangZoneFlashForAll(gzid, GetPlayerColor(pid) + LIGHTER_COLOR);
SetTimerEx("DominateGangZone", 1000, false, "id", pid, gzid);
return MyTIME[pid]++;
}
stock GetNick(playerid)
{
new x[24]; GetPlayerName(playerid, x, 24);
return x;
}
pawn Код:
CMD:dominar(playerid)
{
if(PlayerGangZone(playerid) == -1) return SendClientMessage(playerid, VERMELHO,"* Vocк nгo estб em uma GangZone!");
if(strcmp(GangZone[PlayerGangZone(playerid)][Dono], GetNick(playerid), true)) return SendClientMessage(playerid, VERMELHO,"* Esta GangZona jб й sua!");
DominateGangZone(playerid, PlayerGangZone(playerid));
return 1;
}