03.09.2011, 18:35
Estou editando um GM base do BSG, e nгo to conseguindo arrumar o BUG das Barreiras. Por exemplo consigu criar a barreira mais nгo consigo retirar a barreira. o mesmo aconteзe com o /bq (Bloqueio)
Porfavor quem me ajudar dou reputaзгo!
Codigo das barreiras:
Cуdigo do /bq(Bloqueio)
Porfavor quem me ajudar dou reputaзгo!
Codigo das barreiras:
Код:
if(strcmp(cmdtext, "/barreira", true)==0 || strcmp(cmdtext, "/br", true)==0)
{
if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um Policial!");
if(PlayerPaintballing[playerid] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode por barreiras no evento!");
return 1;
}
if (pRoadblock[playerid] != 0) return SendClientMessage(playerid, COLOR_GREY, "Vocк sу pode criar 1 barreira por vez, /rbr - para remover sua barreira");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
pRoadblock[playerid] = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180, 300.0);
SetPlayerPos(playerid, X, Y, Z+4);
GameTextForPlayer(playerid, "~w~Barreira ~r~Criada", 5000, 5);
SendClientMessage(playerid, COLOR_GREEN, "Barreira Implantada... Use /rbr Para Remove-la!");
format(string, sizeof(string), "Estado: Uma barreira foi posta por %s.", PlayerName(playerid));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{
SendClientMessage(i, TEAM_BLUE_COLOR, string);
if (PlayerInfo[i][pCargo] >= 5 || PlayerInfo[i][pLider] > 0)
{
SendClientMessage(i, TEAM_BLUE_COLOR, "Vocк pode remover todas as barreiras usando /rbrall");
}
}
}
}
return 1;
}
if(strcmp(cmdtext, "/removerbarreira", true)==0 || strcmp(cmdtext, "/rbr", true)==0)
{
if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um Policial!");
if (pRoadblock[playerid] != 0)
{
RemoveRoadblock(playerid);
SendClientMessage(playerid, COLOR_GREY, "Vocк retirou a sua barreira!");
}
else { return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo criou uma barreira!"); }
format(string, sizeof(string), "Estado: Uma barreira foi destruнda por %s.", PlayerName(playerid));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{
SendClientMessage(i, TEAM_BLUE_COLOR, string);
}
}
}
return 1;
}
if(strcmp(cmdtext, "/removertodasbarreiras", true)==0 || strcmp(cmdtext, "/rbrall", true)==0)
{
if (PlayerInfo[playerid][pCargo] >= 4 && IsACop(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pRoadblock[i] != 0)
{
RemoveRoadblock(i);
}
}
format(string, sizeof(string), "Estado: Todas as barreiras foram retiradas por: %s.", PlayerName(playerid));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{
SendClientMessage(i, TEAM_BLUE_COLOR, string);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ser cargo 4+ ou um lнder de alguma organizaзгo policial para remover todas as barreiras!");
}
return 1;
}
Код:
if(strcmp(cmdtext, "/bloqueio", true)==0 || strcmp(cmdtext, "/bq", true)==0)
{
if(PlayerPaintballing[playerid] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode por bloqueios no evento!");
return 1;
}
if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um policial!");
if (pRoadCones[playerid] != 0) return SendClientMessage(playerid, COLOR_GREY, "Vocк sу pode implantar 1 Bloqueio por vez, /rbq - para remover seu bloqueio.");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
pRoadCones[playerid] = CreateObject(4526, X, Y, Z+1, 0.0, 0.0, A+110, 300.0);
SetPlayerPos(playerid, X, Y, Z+1);
GameTextForPlayer(playerid, "~w~Bloqueio ~r~Criado", 5000, 5);
SendClientMessage(playerid, COLOR_GREEN, "Bloqueio Implantado... Use /rbq Para Remover e Poder Criar Mais!.");
format(string, sizeof(string), "Estado: Um Bloqueio foi posto por %s.", PlayerName(playerid));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{
SendClientMessage(i, TEAM_BLUE_COLOR, string);
if (PlayerInfo[i][pCargo] >= 5 && IsACop(i))
{
SendClientMessage(i, COLOR_YELLOW, "Vocк pode remover todos os Bloqueios usando /rbqall");
}
}
}
}
return 1;
}
if(strcmp(cmdtext, "/removerbloqueio", true)==0 || strcmp(cmdtext, "/rbq", true)==0)
{
if (!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um policial!");
return 1;
}
if (pRoadCones[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo criou nenhum bloqueio Bloqueio!");
return 1;
}
SendClientMessage(playerid, COLOR_GREY, "Vocк retirou o seu Bloqueio!");
RemoveRoadCones(playerid);
format(string, sizeof(string), "Estado: %s removeu seu bloqueio.", PlayerName(playerid));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{
SendClientMessage(i, TEAM_BLUE_COLOR, string);
}
}
}
return 1;
}
if(strcmp(cmdtext, "/removerbloqueioall", true)==0 || strcmp(cmdtext, "/rbqall", true)==0)
{
if (IsACop(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pRoadCones[i] != 0)
{
RemoveRoadCones(i);
}
}
}
format(string, sizeof(string), "Estado: Todos os Bloqueios foram retirados por: %s.", PlayerName(playerid));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{
SendClientMessage(i, TEAM_BLUE_COLOR, string);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ser cargo 4+ ou ser um lнder da polнcia para remover todos os Bloqueios!");
}
return 1;
}

