[Pomoc] Arrest

Započeo ozzy, Februar 25, 2012, 16:27:11 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim: CLRP
Detaljan opis problema: Znaci mene samo zanima di da ja tu dodam arrest za FBI-a i za SWAT,stavio sam onaj pickup ali ocu kad doÄ'em tamo da mogu /arrest
Dio skripte: if(strcmp(cmd, "/arrest", true) == 0 || strcmp(cmd, "/uhapsi", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(gTeam[playerid] == 2  || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
        /*if(!PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) || !PlayerToPoint(15.0, playerid,1537.2515,-1674.9572,13.3828))
{// Jail spot
    SendClientMessage(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest!");
    return 1;
}*/

if(PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) || PlayerToPoint(15.0, playerid,1537.2515,-1674.9572,13.3828) || PlayerToPoint(6.0, playerid, 1528.9080,-1678.0759,5.8906) || PlayerToPoint(6.0, playerid, -1606.9096,677.2825,-5.2421))
{//New arrest system

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Novcana kazna ne moze biti ispod $1 ni iznad $99999!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "   Zatvorska kazna ne moze biti ispod 1 ni iznad 20 minuta!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Da se dozvoli ili ponisti kaucija, kucajte 0 ili 1!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Kaucija ne moze biti ispod $0 ni iznad $3000000!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Igrac mora imati barem Wanted Level 1!");
    return 1;
}
format(string, sizeof(string), "* Uhapsili ste %s-a!", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
GivePlayerCash(suspect, -moneys);
format(string, sizeof(string), "uhapsio vas je %s ~n~    za $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
SafeResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{

format(string, sizeof(string), "Vijesti | {FFFFFF}%s {FF6347}je uhiti trazenog zlocinca {FFFFFF}%s", sendername, giveplayer);
OOCNews(LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "Vijesti | {FFFFFF}%s {FF6347}je uhiti trazenog zlocinca {FFFFFF}%s ", sendername, giveplayer);
OOCNews(LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "Vijesti | {FFFFFF}%s {FF6347}je uhiti trazenog zlocinca {FFFFFF}%s ", sendername, giveplayer);
OOCNews(LIGHTRED, string);
}
new rand = random(sizeof(gRandomJailSpawns));
SetPlayerPos(suspect, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
//SetPlayerHealth(suspect,0)
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "* Uhapseni ste na {FFFFFF}%d {FF6347}sekundi. Kaucija: {FFFFFF}$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, LIGHTRED, string);
}
else
{
    JailPrice[suspect] = 0;
format(string, sizeof(string), "* Uhapseni ste na {FFFFFF}%d {FF6347}sekundi. Kaucija: {FFFFFF}Nedostupna", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, LIGHTRED, string);
}
PlayerInfo[suspect][pJailed] = 1;
          PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Uhapsen");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
}//distance
}//not connected
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Nema nikoga u blizini za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na mjestu za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste Policajac / FBI!");
    return 1;
}
}//not connected
return 1;


Neke slike/video za lakse dobivanje pomoci(neobavezno): /
Poslednja Izmena: Februar 25, 2012, 16:27:51 POSLE PODNE od ozzy

ricken

Pa uzmi kordinate gdje bi bolio da u FBI bude arrest i samo ih ubacis u gm

da da,ali di da ubacim??


evo ti kordinate


AddPlayerClass(165,1664.6925,-1698.7271,15.6094,316.9925,0,0,0,0,0,0); // Arrest Place FBI
AddPlayerClass(166,1242.5808,-1656.5070,11.8013,262.7866,0,0,0,0,0,0); // Arrest Place SWAT

AJd sredi mi to pliz,kako da to napravim...

Ovako
    if(PlayerToPoint(3,playerid,tvoji koordinati))
Ako zelis da ima /arrest s vise mjesta, stavljaj ovako
    if(PlayerToPoint(3,playerid,tvoji koordinati) || PlayerToPoint(3,playerid,tvoji koordinati))
Ako imas jos pitanja, postaj
Koja carina!
Citat: Fâ,¬nsQ poslato Jun 06, 2012, 15:27:14 POSLE PODNE
mozemi netko reci kada se sper.a dobiva imam 13 i pol godine, a nisam je dobio, moji drugari su to vec dobili, moze pomoc
nov sam pa neznam gdje trebam pitati

ricken

Probaj stavi ovako.
if(strcmp(cmd, "/arrest", true) == 0 || strcmp(cmd, "/uhapsi", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(gTeam[playerid] == 2  || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
        /*if(!PlayerToPoint(6.0, playerid, 1664.6925,-1698.7271,15.6094) || !PlayerToPoint(15.0, playerid,1242.5808,-1656.5070,11.8013))
{// Jail spot
    SendClientMessage(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest!");
    return 1;
}*/

if(PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) || PlayerToPoint(15.0, playerid,1537.2515,-1674.9572,13.3828) || PlayerToPoint(6.0, playerid, 1528.9080,-1678.0759,5.8906) || PlayerToPoint(6.0, playerid, -1606.9096,677.2825,-5.2421))
{//New arrest system

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Novcana kazna ne moze biti ispod $1 ni iznad $99999!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "   Zatvorska kazna ne moze biti ispod 1 ni iznad 20 minuta!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Da se dozvoli ili ponisti kaucija, kucajte 0 ili 1!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Kaucija ne moze biti ispod $0 ni iznad $3000000!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Igrac mora imati barem Wanted Level 1!");
    return 1;
}
format(string, sizeof(string), "* Uhapsili ste %s-a!", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
GivePlayerCash(suspect, -moneys);
format(string, sizeof(string), "uhapsio vas je %s ~n~    za $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
SafeResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{

format(string, sizeof(string), "Vijesti | {FFFFFF}%s {FF6347}je uhiti trazenog zlocinca {FFFFFF}%s", sendername, giveplayer);
OOCNews(LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "Vijesti | {FFFFFF}%s {FF6347}je uhiti trazenog zlocinca {FFFFFF}%s ", sendername, giveplayer);
OOCNews(LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "Vijesti | {FFFFFF}%s {FF6347}je uhiti trazenog zlocinca {FFFFFF}%s ", sendername, giveplayer);
OOCNews(LIGHTRED, string);
}
new rand = random(sizeof(gRandomJailSpawns));
SetPlayerPos(suspect, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
//SetPlayerHealth(suspect,0)
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "* Uhapseni ste na {FFFFFF}%d {FF6347}sekundi. Kaucija: {FFFFFF}$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, LIGHTRED, string);
}
else
{
    JailPrice[suspect] = 0;
format(string, sizeof(string), "* Uhapseni ste na {FFFFFF}%d {FF6347}sekundi. Kaucija: {FFFFFF}Nedostupna", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, LIGHTRED, string);
}
PlayerInfo[suspect][pJailed] = 1;
          PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Uhapsen");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
}//distance
}//not connected
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Nema nikoga u blizini za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na mjestu za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste Policajac / FBI!");
    return 1;
}
}//not connected
return 1;

E decki hvala vam jakooo puno.Nisam to mogao skuzit al zato imam vas tu.. :)