Avisa Policia quando da comando -
maikons08 - 27.08.2013
Entгo galera estou fazendo um sistema de ataque a DP, mas tem um problema eu queria que toda vez que o comando fosse usado manda-se um aviso para os policias que a DP estб sendo atacada, eu tentei com IF, sou meio novato
Eu fiz assim
if(IsACop(playerid))
{
SendClientMessage(playerid,TEAM_BLUE_COLOR,"Todas as unidades: Ataque a Delegacia Militar!");
format(gstring, sizeof(gstring), "HQ - Todas as unidades: Ataque a Delegacia Militar!");
SendClientMessage(playerid, TEAM_BLUE_COLOR, gstring);
return 1;
}
Mas acho que foi meio inutil isso pq isso sу avisaria se fosse um policial dando o comando, entгo eu queria que um bandido desse o comando e avisa-se a todos os policias
(Obs: Nгo da erro de compilaзгo/define jб q IsACop sгo as orgs policiais)
Quote:
if(strcmp(cmd, "/arrombardp", true) == 0)
{
new org = GetPlayerOrg(playerid);
if(PlayerToPoint(4.0, playerid, 246.4375,71.5205,1003.6406))
{
if(org != 6 && org != 19 && org != 20 && org != 24 && org != 25)
{
SendClientMessage(playerid,COLOR_GREY," Vocк nгo pode Arrombar a DP!");
return 1;
}
if(IsACop(playerid))
{
SendClientMessage(playerid,TEAM_BLUE_COLOR,"Todas as unidades: Ataque a Delegacia Militar!");
format(gstring, sizeof(gstring), "HQ - Todas as unidades: Ataque a Delegacia Militar!");
SendClientMessage(playerid, TEAM_BLUE_COLOR, gstring);
return 1;
}
SendClientMessage(playerid, COLOR_GREY, "Espere 8 Minutos para Arrombar o Portгo da DP.");
dinamit = F_CreateObject(1654,245.32524109,72.28179932,1003. 91412354,0.00000000,0.00000000,0.00000000);
//
F_MoveObject( PDDOORc, 248.142105 , 78.125961 , 1007.248718,3);
SetTimer("pd1", 60000, false);
F_MoveObject( PDDOORb, 250.774871 , 60.822799 , 1006.862670,3);
SetTimer("GaragemDpClosed2", 60000, false);
GameTextForPlayer(playerid, "~w~Portoes ~n~~b~Arrombados!", 5000, 3);
//
SetTimer("destrancandodp", 480000, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s estб arrombando o portгo da DP.", sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
SendClientMessage(playerid, COR_GRO, "Vocк Nгo estб perto do Portгo da DP.");
}
return 1;
}
|
Re: Avisa Policia quando da comando -
PT - 27.08.2013
faltou 1 loop
pawn Код:
if(strcmp(cmd, "/arrombardp", true) == 0)
{
new org = GetPlayerOrg(playerid);
if(PlayerToPoint(4.0, playerid, 246.4375,71.5205,1003.6406))
{
if(org != 6 && org != 19 && org != 20 && org != 24 && org != 25)
{
SendClientMessage(playerid,COLOR_GREY," Vocк nгo pode Arrombar a DP!");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{
SendClientMessage(playerid,TEAM_BLUE_COLOR,"Todas as unidades: Ataque a Delegacia Militar!");
}
}
}
SendClientMessage(playerid, COLOR_GREY, "Espere 8 Minutos para Arrombar o Portгo da DP.");
dinamit = F_CreateObject(1654,245.32524109,72.28179932,1003. 91412354,0.00000000,0.00000000,0.00000000);
//
F_MoveObject( PDDOORc, 248.142105 , 78.125961 , 1007.248718,3);
SetTimer("pd1", 60000, false);
F_MoveObject( PDDOORb, 250.774871 , 60.822799 , 1006.862670,3);
SetTimer("GaragemDpClosed2", 60000, false);
GameTextForPlayer(playerid, "~w~Portoes ~n~~b~Arrombados!", 5000, 3);
//
SetTimer("destrancandodp", 480000, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s estб arrombando o portгo da DP.", sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else SendClientMessage(playerid, COR_GRO, "Vocк Nгo estб perto do Portгo da DP.");
return 1;
}
Re: Avisa Policia quando da comando -
maikons08 - 27.08.2013
Quote:
Originally Posted by PT
faltou 1 loop
pawn Код:
if(strcmp(cmd, "/arrombardp", true) == 0) { new org = GetPlayerOrg(playerid); if(PlayerToPoint(4.0, playerid, 246.4375,71.5205,1003.6406)) { if(org != 6 && org != 19 && org != 20 && org != 24 && org != 25) { SendClientMessage(playerid,COLOR_GREY," Vocк nгo pode Arrombar a DP!"); return 1; } for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsACop(i)) { SendClientMessage(playerid,TEAM_BLUE_COLOR,"Todas as unidades: Ataque a Delegacia Militar!");
} } } SendClientMessage(playerid, COLOR_GREY, "Espere 8 Minutos para Arrombar o Portгo da DP."); dinamit = F_CreateObject(1654,245.32524109,72.28179932,1003. 91412354,0.00000000,0.00000000,0.00000000); // F_MoveObject( PDDOORc, 248.142105 , 78.125961 , 1007.248718,3); SetTimer("pd1", 60000, false); F_MoveObject( PDDOORb, 250.774871 , 60.822799 , 1006.862670,3); SetTimer("GaragemDpClosed2", 60000, false); GameTextForPlayer(playerid, "~w~Portoes ~n~~b~Arrombados!", 5000, 3); // SetTimer("destrancandodp", 480000, 0); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "%s estб arrombando o portгo da DP.", sendername); ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); return 1; } else SendClientMessage(playerid, COR_GRO, "Vocк Nгo estб perto do Portгo da DP."); return 1; }
|
Valeu cara, mas n pegou n, do meu jeito compilou, mas n apareceu nada no jogo pros policiais, do seu jeito n compilou, deu 4 erros
C:\Users\PC\Desktop\BPPF\pawno\ULTRA2.pwn(50630) : error 001: expected token: ",", but found "."
C:\Users\PC\Desktop\BPPF\pawno\ULTRA2.pwn(50630) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\BPPF\pawno\ULTRA2.pwn(50630) : warning 215: expression has no effect
C:\Users\PC\Desktop\BPPF\pawno\ULTRA2.pwn(50630) : warning 215: expression has no effect
C:\Users\PC\Desktop\BPPF\pawno\ULTRA2.pwn(50630) : warning 215: expression has no effect
C:\Users\PC\Desktop\BPPF\pawno\ULTRA2.pwn(50630) : warning 215: expression has no effect
C:\Users\PC\Desktop\BPPF\pawno\ULTRA2.pwn(50630) : error 001: expected token: ";", but found ")"
C:\Users\PC\Desktop\BPPF\pawno\ULTRA2.pwn(50630) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.