11.05.2014, 11:48
(
Последний раз редактировалось pedrotvr; 11.05.2014 в 14:32.
)
Nгo to acreditando q uma coisa tгo simples q tem em tantos GFs eu n to conseguindo fazer! O que eu to fazendo de errado nessa porr!@#, meu /prender ta funcionando perfeitamente
/prender (funcionando perfeitamente)
[/spoiler]
Agora o suspeito morto n sei pq nгo vai!
Ao COP matar um cara procurado (NГO funciona o cara sу respawna! PQ SR!?)
public OnPlayerDeath(playerid, killerid, reason)
/prender (funcionando perfeitamente)
pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
new bail = 0;
new bailprice = 0;
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!");
return 1;
}
if(!PlayerToPoint(5.0, playerid, 268.3327,77.8972,1001.0391) && !PlayerToPoint(5.0, playerid, 1545.4073,-1607.9791,13.3828) && !PlayerToPoint(5.0, playerid, 324.3141,-1496.9177,24.9219) && !PlayerToPoint(5.0, playerid, 920.5212,-1184.8267,16.9766) && !PlayerToPoint(5.0, playerid, 218.7284,123.7327,999.0216) && !PlayerToPoint(5.0, playerid, 1545.7220,-1609.4769,13.3828)
&& !PlayerToPoint(5.0, playerid, 1019.6051,-317.6436,73.9922)
&& !PlayerToPoint(5.0, playerid, -1298.8188,490.5014,11.1953) && !PlayerToPoint(5.0, playerid, 264.1557,77.5797,1001.0391) && !PlayerToPoint(5.0, playerid, 1361,175.1075,1003.0234) && !PlayerToPoint(5.0, playerid, 321.8284,315.6733,999.1484))
{// Jail spot
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб perto da cela, nгo pode prender o suspeito !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(PlayerCuffed[giveplayerid])
{
ClearAnimations(giveplayerid);
RemovePlayerAttachedObject(giveplayerid,4);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
PlayerInfo[giveplayerid][pMuted] = 0;
}
if(IsPlayerConnected(giveplayerid))
{
if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 15)
{
if(IsACop(playerid)) // DP LS
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedPoints[giveplayerid] < 0)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no mнnimo 1 nнvel de procurado!");
return 1;
}
if(WantedPoints[giveplayerid] > 15)
{
SendClientMessage(playerid, COLOR_GREY, "Jogadores acima do nivel 15 de procura deve ser preso no carandiru!");
SendClientMessage(playerid, COLOR_GREY, "Este jogador й muito procurado leve o atй o presidio de seguranзa maxima!");
return 1;
}
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(giveplayerid, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(giveplayerid, string, 5000, 5);
ResetPlayerWeaponsEx(giveplayerid);
if(PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1)
{
format(string, sizeof(string), "<< Policial Militar %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
if(bail == 1)
{
JailPrice[giveplayerid] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[giveplayerid][pJailTime], JailPrice[giveplayerid]);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[giveplayerid] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[giveplayerid][pJailTime]);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
}
if(PlayerCuffed[giveplayerid])
{
ClearAnimations(giveplayerid);
RemovePlayerAttachedObject(giveplayerid,4);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
GameTextForPlayer(giveplayerid, "~g~Desalgemado", 2500, 3);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
PlayerInfo[giveplayerid][pMuted] = 0;
}
PlayerInfo[giveplayerid][pJailed] = 1;
SetPlayerInterior(giveplayerid, 6);
SetPlayerPos(giveplayerid,264.6288,77.5742,1001.0391);
PlayerInfo[giveplayerid][pJailTime] = (WantedPoints[giveplayerid] * 60);
SetPlayerFree(giveplayerid,playerid, "Foi Preso");
WantedPoints[giveplayerid] = 0;
SetPlayerWantedLevel(giveplayerid, 0);
WantAdvogado[giveplayerid] = 1;
PlayerInfo[giveplayerid][pMuted] = 0;
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
PlayerInfo[giveplayerid][pDrogas] = 0;
PlayerInfo[giveplayerid][pDrogas2] = 0;
PlayerInfo[giveplayerid][pDrogas3] = 0;
PlayerInfo[giveplayerid][pMats] = 0;
return 1;
}
}//distance
}//not connected
else
{
SendClientMessage(playerid, COLOR_GREY, " Esse nгo й um jogador ativo.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um Oficial !");
return 1;
}
}//not connected
return 1;
}
Agora o suspeito morto n sei pq nгo vai!
Ao COP matar um cara procurado (NГO funciona o cara sу respawna! PQ SR!?)
public OnPlayerDeath(playerid, killerid, reason)
pawn Код:
if(WantedPoints[playerid] >= 1)
{
if(PlayerInfo[killerid][pMembro] == 1 || PlayerInfo[killerid][pLider] == 1)
{
new price = WantedPoints[playerid] * 50;
format(gstring, sizeof(gstring), "~w~Suspeito ~w~Morto~w~Bonus~g~R$%d", price);
GameTextForPlayer(killerid, gstring, 5000, 1);
ConsumingMoney[killerid] = 1;
GivePlayerMoney(killerid, price / 2);
PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid, - price);
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,264.1872,77.7193,1001.0391);
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = 100;
format(gstring, sizeof(gstring), "* Vocк estб preso por %d Segundos na DP, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, gstring);
//WantedPoints[playerid] = 0;
//SetPlayerWantedLevel(playerid, 0);
PlayerInfo[playerid][pDrogas] = 0;
PlayerInfo[playerid][pDrogas2] = 0;
PlayerInfo[playerid][pDrogas3] = 0;
PlayerInfo[playerid][pMats] = 0;
}
}