Arrumar meu /prender -
pedrotvr - 14.12.2013
Alguem arruma meu /prender pra sу da /prender [id] ai tipo pra cada nivel de su fica preso por 5 mim, n sei como fazer isso, tem mt pm abusando no meu server, sу /prender [id] e jб era, vlw se alguem fizer vai ajudar mt, abз
pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
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) && !PlayerToPoint(5.0, playerid, 916.9683,-1203.0712,16.9832))
{// 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] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, " O Tempo nгo pode ser menor que 1 nem maior que 20 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Fianзa Tem Que ser 0=Nгo ou 1=Sim !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 300000) { SendClientMessage(playerid, COLOR_GREY, " O Preзo nгo pode ser menor que 0 nem maior que R$300000 !"); return 1; }
new suspect = giveplayerid;
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(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 15)
{
if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedPoints[suspect] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no mнnimo 1 nнvel de procurado!");
return 1;
}
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
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);
}
SetPlayerInterior(suspect, 6);
SetPlayerPos(suspect,227.5300,114.2930,999.0156);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 1;
SetPlayerFree(suspect,playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
PlayerInfo[suspect][pMuted] = 0;
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedPoints[suspect] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
return 1;
}
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if(PlayerInfo[playerid][pMembro]==2||PlayerInfo[playerid][pLider]==2)
{
format(string, sizeof(string), "<< Brigada Militar %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 10);
SetPlayerPos(suspect,227.5300,114.2930,999.0156);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 3;
SetPlayerFree(suspect,playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
SetPlayerHealth(playerid, 0);
return 1;
}
if(PlayerInfo[playerid][pMembro] == 11 || PlayerInfo[playerid][pLider] == 11)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedPoints[suspect] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
return 1;
}
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if(PlayerInfo[playerid][pMembro]==11||PlayerInfo[playerid][pLider]==11)
{
format(string, sizeof(string), "<< Policial Federal %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 5);
SetPlayerPos(suspect,319.0175,317.0517,999.1484);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 5;
SetPlayerFree(suspect,playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 29 || PlayerInfo[playerid][pLider] == 29)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedPoints[suspect] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
return 1;
}
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "O Suspeito foi preso, nas celas do DEPARTAMENTO DE POLICIA.");
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if(PlayerInfo[playerid][pMembro]==11||PlayerInfo[playerid][pLider]==11)
{
format(string, sizeof(string), "<< Policial Rodoviaria Federal %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 6);
SetPlayerPos(suspect,227.5300,114.2930,999.0156);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 18;
SetPlayerFree(suspect,playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedPoints[suspect] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
return 1;
}
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if(PlayerInfo[playerid][pMembro]==3||PlayerInfo[playerid][pLider]==3)
{
format(string, sizeof(string), "<< Exercito %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 0);
SetPlayerPos(suspect,-1293.2203,490.5885,11.1953);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 7;
SetPlayerFree(suspect,playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 16 || PlayerInfo[playerid][pLider] == 16)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedPoints[suspect] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
return 1;
}
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if(PlayerInfo[playerid][pMembro]==16||PlayerInfo[playerid][pLider]==16)
{
format(string, sizeof(string), "<< Policial Civil %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 3);
SetPlayerPos(suspect,198.9762,178.5702,1003.0307);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 4;
SetPlayerFree(suspect,playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
WantAdvogado[suspect] = 1;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][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;
}
Re: Arrumar meu /prender -
NurbWill - 14.12.2013
https://sampwiki.blast.hk/wiki/GetPlayerSpecialAction
pawn Код:
if(!strcmp(cmd, "/assaltar", true))
{
if(PlayerInfo[playerid][pLider] == 19 || PlayerInfo[playerid][pMembro] == 19 || PlayerInfo[playerid][pLider] == 20 || PlayerInfo[playerid][pMembro] == 20 || PlayerInfo[playerid][pLider] == 24 || PlayerInfo[playerid][pMembro] == 24 || PlayerInfo[playerid][pLider] == 25 || PlayerInfo[playerid][pMembro] == 25)
{
Assaltou[playerid] = gettime() + 55;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USO: /assaltar [ID]");
new id = strval(tmp);
if(Assaltou[playerid] < gettime()) return SendClientMessage(playerid, -1, "Vocк usou este comando recentemente. Aguarde algum tempo para usб-lo novamente.");
if(GetPlayerSpecialAction(id) == SPECIAL_ACTION_HANDSUP)
{
new Float:Pos[3];
GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 5.0, Pos[0], Pos[1], Pos[2]))
{
new money = GetPlayerMoneyEx(id);
GivePlayerMoneyEx(id, -money / 1);
GivePlayerMoneyEx(playerid, money/1);
SendClientMessage(playerid, 0xFFFF00FF, "Vocк assaltou alguem ! Agora corrra !");
SendClientMessage(id, 0xFFFF00FF, "Vocк foi assaltado !");
SetPlayerCriminal(playerid,255, "Assalto");
WantedPoints[playerid]-=1;
}
if(PlayerInfo[playerid][pLider] != 19 || PlayerInfo[playerid][pMembro] != 19 || PlayerInfo[playerid][pLider] != 20 || PlayerInfo[playerid][pMembro] != 20 || PlayerInfo[playerid][pLider] != 24 || PlayerInfo[playerid][pMembro] != 24 || PlayerInfo[playerid][pLider] != 25 || PlayerInfo[playerid][pMembro] != 25){
SendClientMessage(playerid,COLOR_RED,"Vocк nгo й um traficante.");
return 1;
}
} else return SendClientMessage(playerid, -1, "Essa pessoa nгo estб com '/handsup'.");
}
}
Re: Arrumar meu /prender -
pedrotvr - 14.12.2013
uppp?
Re: Arrumar meu /prender -
pedrotvr - 16.12.2013
upppp
Re: Arrumar meu /prender -
pedrotvr - 16.12.2013
uppppp
Re: Arrumar meu /prender -
dPlaYer_ - 16.12.2013
pawn Код:
if (strcmp(cmd, "/prender", true) == 0) {
if (IsPlayerConnected(playerid)) {
if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um Oficial !");
if (!IsPlayerConnected(suspect)) return SendClientMessage(playerid, COLOR_GREY, " Esse nгo й um jogador ativo.");
if (!OnDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!");
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) && !PlayerToPoint(5.0, playerid, 916.9683, -1203.0712, 16.9832)) { // 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)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
new time = strval(tmp);
if (time < 1 || time > 20) return SendClientMessage(playerid, COLOR_GREY, " O Tempo nгo pode ser menor que 1 nem maior que 20 !");
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
new bail = strval(tmp);
if (bail < 0 || bail > 1) return SendClientMessage(playerid, COLOR_GREY, " Fianзa Tem Que ser 0=Nгo ou 1=Sim !");
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
new bailprice = strval(tmp);
if (bailprice < 0 || bailprice > 300000) return SendClientMessage(playerid, COLOR_GREY, " O Preзo nгo pode ser menor que 0 nem maior que R$300000 !");
new suspect = giveplayerid;
if (PlayerCuffed[giveplayerid]) {
ClearAnimations(giveplayerid);
RemovePlayerAttachedObject(giveplayerid, 4);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
PlayerInfo[giveplayerid][pMuted] = 0;
}
if (GetDistanceBetweenPlayers(playerid, suspect) < 15) {
if (PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (WantedPoints[suspect] < 1) return SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no mнnimo 1 nнvel de procurado!");
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
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);
}
SetPlayerInterior(suspect, 6);
SetPlayerPos(suspect, 227.5300, 114.2930, 999.0156);
PlayerInfo[suspect][pJailTime] = GetPlayerWantedLevel(suspect) * 60;
if (bail == 1) {
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
} else {
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 1;
SetPlayerFree(suspect, playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
PlayerInfo[suspect][pMuted] = 0;
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
if (PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2) {
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (WantedPoints[suspect] < 1) return SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if (PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2) {
format(string, sizeof(string), "<< Brigada Militar %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 10);
SetPlayerPos(suspect, 227.5300, 114.2930, 999.0156);
PlayerInfo[suspect][pJailTime] = GetPlayerWantedLevel(suspect) * 60;
if (bail == 1) {
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
} else {
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 3;
SetPlayerFree(suspect, playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
SetPlayerHealth(playerid, 0);
return 1;
}
if (PlayerInfo[playerid][pMembro] == 11 || PlayerInfo[playerid][pLider] == 11) {
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (WantedPoints[suspect] < 1) return SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if (PlayerInfo[playerid][pMembro] == 11 || PlayerInfo[playerid][pLider] == 11) {
format(string, sizeof(string), "<< Policial Federal %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 5);
SetPlayerPos(suspect, 319.0175, 317.0517, 999.1484);
PlayerInfo[suspect][pJailTime] = GetPlayerWantedLevel(suspect) * 60;
if (bail == 1) {
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
} else {
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 5;
SetPlayerFree(suspect, playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
if (PlayerInfo[playerid][pMembro] == 29 || PlayerInfo[playerid][pLider] == 29) {
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (WantedPoints[suspect] < 1) return SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "O Suspeito foi preso, nas celas do DEPARTAMENTO DE POLICIA.");
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if (PlayerInfo[playerid][pMembro] == 11 || PlayerInfo[playerid][pLider] == 11) {
format(string, sizeof(string), "<< Policial Rodoviaria Federal %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 6);
SetPlayerPos(suspect, 227.5300, 114.2930, 999.0156);
PlayerInfo[suspect][pJailTime] = GetPlayerWantedLevel(suspect) * 60;
if (bail == 1) {
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
} else {
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 18;
SetPlayerFree(suspect, playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
if (PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3) {
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (WantedPoints[suspect] < 1) return SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if (PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3) {
format(string, sizeof(string), "<< Exercito %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 0);
SetPlayerPos(suspect, -1293.2203, 490.5885, 11.1953);
PlayerInfo[suspect][pJailTime] = GetPlayerWantedLevel(suspect) * 60;
if (bail == 1) {
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
} else {
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 7;
SetPlayerFree(suspect, playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
if (PlayerInfo[playerid][pMembro] == 16 || PlayerInfo[playerid][pLider] == 16) {
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (WantedPoints[suspect] < 1) return SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nнvel de procura!");
format(string, sizeof(string), "* Vocк Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Preso por %s", sendername);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeaponsEx(suspect);
if (PlayerInfo[playerid][pMembro] == 16 || PlayerInfo[playerid][pLider] == 16) {
format(string, sizeof(string), "<< Policial Civil %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 3);
SetPlayerPos(suspect, 198.9762, 178.5702, 1003.0307);
PlayerInfo[suspect][pJailTime] = GetPlayerWantedLevel(suspect) * 60;
if (bail == 1) {
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
} else {
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Desativada", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, 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[suspect][pJailed] = 4;
SetPlayerFree(suspect, playerid, "Foi Preso");
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pMuted] = 0;
PlayerCuffed[suspect] = 0;
WantAdvogado[suspect] = 1;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
return 1;
}
}
}
return 1;
}
testa ai fera
Re: Arrumar meu /prender -
gmstrikker - 17.12.2013
@dPLayer
ele pediu que qnd desse /prender checa-se a qntidade de su e pra cada 1 de su ficava 5 minutos preso, pra n ter problema dos policias darem mais tempo q o necessario pros presos
Re: Arrumar meu /prender -
pedrotvr - 17.12.2013
upppppp