if(!strcmp(cmd, "/su", true))
{
if(PlayerInfo[playerid][BOPE] >= 1 || PlayerInfo[playerid][CHQ] >= 1) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "use /suspeito id");
new suspeito = strval(tmp);
if(!IsPlayerConnected(suspeito) || suspeito == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "O ID Digitado й um ID Invбlido!");
new nome[MAX_PLAYER_NAME];
GetPlayerName(suspeito, nome, sizeof(nome));
format(string, sizeof(string), "*ATENЗГO: O Suspeito %s(%d) estб foragido, cerquem a favela e prendгo-no!",nome,playerid);
SendClientMessageToAll(0xFF80808B,string);
return 1;
}
else SendClientMessage(playerid, 0xFF0000D4, "Vocк nгo й um Ofнcial para usar este comando!");
if(strcmp(cmd, "/suspeito", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!BOPE(playerid))
{
SendClientMessage(playerid, 0xAFAFAFAA, " Vocк nгo й um policial!");
return true;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xBFC0C2FF, "USE: (/su)speito [id] [Descriзгo do Crime]");
return true;
}
giveplayerid = ReturnUser(tmp);
if (BOPE(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
if(BOPE(giveplayerid))
{
SendClientMessage(playerid, 0xB4B5B7FF, "Vocк nгo pode dar su em Policiais!");
return true;
}
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, 0xBFC0C2FF, "USE: (/su)speito [id] [Descriзгo do Crime]");
return true;
}
SetPlayerCriminal(giveplayerid,playerid, result);
return true;
}
}
else
{
SendClientMessage(playerid, 0xB4B5B7FF, " Esse jogador nгo estб conectado.");
return true;
}
}
else
{
SendClientMessage(playerid, 0xBFC0C2FF, " Vocк nгo й um Policial !");
}
}
return true;
}
pawn Код:
|
forward SetPlayerCriminal(playerid,declare,reason[]);
forward SetPlayerFree(playerid,declare,reason[]);
enum pCrime{pBplayer[32],pAccusing[32],pAccusedof[32],pVictim[32],};
public ClearCrime(playerid)
{
if(IsPlayerConnected(playerid))
{
new string[MAX_PLAYER_NAME];
format(string, sizeof(string), "********");
strmid(PlayerCrime[playerid][pBplayer], string, 0, strlen(string), 255);
strmid(PlayerCrime[playerid][pVictim], string, 0, strlen(string), 255);
strmid(PlayerCrime[playerid][pAccusing], string, 0, strlen(string), 255);
strmid(PlayerCrime[playerid][pAccusedof], string, 0, strlen(string), 255);
}
return true;
}
public SetPlayerCriminal(playerid,declare,reason[])
{
if(IsPlayerConnected(playerid) && !BOPE(playerid))
{
if(WantedPoints[playerid] < 10) WantedPoints[playerid] += 1;
PlayerInfo[playerid][pCrimes] += 1;
new turned[MAX_PLAYER_NAME];
new turner[MAX_PLAYER_NAME];
new location[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
strmid(PlayerCrime[playerid][pAccusedof], reason, 0, strlen(reason), 255);
GetPlayerName(playerid, turned, sizeof(turned));
if (declare == 255)
{
format(turner, sizeof(turner), "desconhecido");
strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
}
else
{
if(IsPlayerConnected(declare))
{
GetPlayerName(declare, turner, sizeof(turner));
strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
strmid(PlayerCrime[declare][pBplayer], turned, 0, strlen(turned), 255);
strmid(PlayerCrime[declare][pAccusing], reason, 0, strlen(reason), 255);
}
}
format(gstring, sizeof(gstring), "Vocк cometeu um crime ( %s ). Relatado por: %s.",reason,turner);
SendClientMessage(playerid, 0xFF6347AA, gstring);
SetPlayerWantedLevel(playerid, WantedPoints[playerid]);
format(gstring, sizeof(gstring), "Nнvel de procurado: %d", WantedPoints[playerid]);
SendClientMessage(playerid, 0xFFFF00AA, gstring);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(BOPE(i))
{
format(gstring, sizeof(gstring), "HQ - Todas as unidades: Relato: %s",turner);
SendClientMessage(i, 0x8D8DFF00, gstring);
format(gstring, sizeof(gstring), "HQ - Crime: %s, Suspeito: %s",reason,turned);
SendClientMessage(i, 0x8D8DFF00, gstring);
if(GetPlayerInterior(playerid) == 0)
{
format(gstring, sizeof(gstring), "Local: %s, Em Interior: Nгo",location);
SendClientMessage(i, 0x8D8DFF00, gstring);
}
else
{
format(gstring, sizeof(gstring), "Local: %s, Em Interior: Sim",location);
SendClientMessage(i, 0x8D8DFF00, gstring);
}
}
}
}
}//Nгo conectado
}
if(PlayerInfo[killerid][pMembro] == 1 || PlayerInfo[killerid][pLider] == 1 && GetPlayerWantedLevel(playerid) >= 1) { if(PlayerInfo[playerid][pjailed] == 1) { SetPlayerInterior(playerid, 6); SetPlayerPos(playerid,CORDENADAS); ResetPlayerWeapons(playerid); return 1; } |
public OnPlayerDeath(playerid, killerid, reason)
{
if(WantedPoints[playerid] >= 1)
{
if(!BOPE(playerid))
{
new price = WantedPoints[playerid] * 100;
if(PlayerInfo[killerid][pMembro] == BOPE || PlayerInfo[killerid][pLider] == BOPE)
{
ConsumingMoney[killerid] = 1;
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(180);
format(gstring, sizeof(gstring), "* Vocк estб preso por %d Segundos na Policia Militar, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, 0xFF6347AA, gstring);
WantedPoints[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
}
if(BOPE(killerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && BOPE(i))
{
if(JaEstaRoubando[playerid] == 1)
{
new Nome[MAX_PLAYER_NAME];
GetPlayerName(killerid, Nome, sizeof(Nome));
if(GetPlayerState(i) == 2)
{
PlayerPlaySound(i, 2134, 0.0, 0.0, 0.0);
}
else
{
PlayerPlaySound(i, 1039, 0.0, 0.0, 0.0);
}
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$1000");
GameTextForPlayer(i, gstring, 5000, 1);
format(gstring, sizeof(gstring), "* %s impediu ao roubo da prefeitura.", Nome);
SendFamilyMessage(BOPE, 0x8D8DFF00, gstring);
GivePlayerMoney(i, 1000);
}
else
{
if(GetPlayerState(i) == 2)
{
PlayerPlaySound(i, 2134, 0.0, 0.0, 0.0);
}
else
{
PlayerPlaySound(i, 1039, 0.0, 0.0, 0.0);
}
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$500");
GameTextForPlayer(i, gstring, 5000, 1);
GivePlayerMoney(i, 500);
}
}
}
}
}
}