[Pomoc]Arrest

Započeo Sic Macko :D, Oktobar 15, 2011, 09:15:12 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim: Nije bitno
Detaljan opis problema: Ja sam uzeo kordinate, kada netko nekoga uhapsi da se stvori na tim kordinatima. I neznam u kojem dijelu te CMD trebam ubaciti to
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, 1781.8040,-1567.8580,22.9391) || !PlayerToPoint(15.0, playerid, 1781.8040,-1567.8580,22.9391))
{// Jail spot
   SendClientMessage(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest!");
   return 1;
}*/

if(PlayerToPoint(12.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) || PlayerToPoint(15.0, playerid, 224.6911,120.2701,999.0899) || PlayerToPoint(6.0, playerid, 611.2833,-588.0986,17.2266) || PlayerToPoint(6.0, playerid, 1808.4139,-1570.7838,13.4677))
{//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 < 10000 || moneys > 100000) { SendClientMessage(playerid, COLOR_GREY, "   Novcana kazna ne moze biti ispod $10000 ni iznad $10000!"); 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 < 20 || time > 300) { SendClientMessage(playerid, COLOR_GREY, "   Zatvorska kazna ne moze biti ispod 20 ni iznad 300 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 < 15000 || bailprice > 500000) { SendClientMessage(playerid, COLOR_GREY, "   Kaucija ne moze biti ispod $15000 ni iznad $500000!"); 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] < 0)
{
    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);
SafeGivePlayerMoney(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)
{
   new currank[64];
    if(PlayerInfo[playerid][pRank] == 1) { currank = "Kadet"; }
else if(PlayerInfo[playerid][pRank] == 2) { currank = "Policajac"; }
else if(PlayerInfo[playerid][pRank] == 3) { currank = "Agent"; }
else if(PlayerInfo[playerid][pRank] == 4) { currank = "Narednik"; }
else if(PlayerInfo[playerid][pRank] == 5) { currank = "Inspektor"; }
        else if(PlayerInfo[playerid][pRank] == 6) { currank = "Kapetan"; }
        else if(PlayerInfo[playerid][pRank] == 7) { currank = "Zamjenik serifa"; }
        else if(PlayerInfo[playerid][pRank] == 8) { currank = "Serif"; }
else { currank = "Cadet"; }
format(string, sizeof(string), "Vijesti iz policije Dillemore | Policajac %s je uhapsio %s-a ", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "Vijesti iz FBI-a | FBI Agent je uhapsio jednog od najvecih dilera %s-a", giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 10);
//SetPlayerWorldBounds(suspect,-1052.6142,-1179.6550,-931.2334,-1058.4941)
SetPlayerPos(suspect,223.5845,111.5466,999.0156);
//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 %d sekundi.   Kaucija: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
else
{
   JailPrice[suspect] = 0;
format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_WHITE, 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, "   Nisi kod PD-a ili u policiji.");
   return 1;
}
}
else
{
   SendClientMessage(playerid, COLOR_GREY, "   Niste Policajac / FBI!");
   return 1;
}
}//not connected
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): Ja bi kada netko nekoga uhapsi da se spawn u jail na kordinatima 1781.8040,-1567.8580,22.9391


Moderator:
Kode stavljaj u [code]--ovde--[/code]
Poslednja Izmena: Oktobar 15, 2011, 10:11:08 PRE PODNE od MicroD

Ime Servera: Security RolePlay
Server IP: Uskoro !

dragan12

SetPlayerPos(playerid,1781.8040,-1567.8580,22.9391);
Dodas tamo gde npr. kaze igracu uhapseni ste na....

EDIT:
SetPlayerPos(suspect,223.5845,111.5466,999.0156);
Zamenis samo sa tim. Sada sam pogledao komandu
Poslednja Izmena: Oktobar 15, 2011, 09:21:35 PRE PODNE od [BD]Gagi

Citat: [BD]Gagi poslato Oktobar 15, 2011, 09:18:46 PRE PODNE
SetPlayerPos(playerid,1781.8040,-1567.8580,22.9391);
Dodas tamo gde npr. kaze igracu uhapseni ste na....

EDIT:
SetPlayerPos(suspect,223.5845,111.5466,999.0156);
Zamenis samo sa tim. Sada sam pogledao komandu
Kako napraviti daja nekoga uhapsim i on otide off i dode nakon 30 mini spawna se na tim kordinatima, meni se spawna u drugom jailu

Ime Servera: Security RolePlay
Server IP: Uskoro !

dragan12

Citat: Sic Macko :D poslato Oktobar 15, 2011, 09:45:17 PRE PODNE
Citat: [BD]Gagi poslato Oktobar 15, 2011, 09:18:46 PRE PODNE
SetPlayerPos(playerid,1781.8040,-1567.8580,22.9391);
Dodas tamo gde npr. kaze igracu uhapseni ste na....

EDIT:
SetPlayerPos(suspect,223.5845,111.5466,999.0156);
Zamenis samo sa tim. Sada sam pogledao komandu
Kako napraviti daja nekoga uhapsim i on otide off i dode nakon 30 mini spawna se na tim kordinatima, meni se spawna u drugom jailu
Ili da koristis trazilicu ili da potrazis ove kordinate: SetPlayerPos(suspect,223.5845,111.5466,999.0156);
Trebalo bi biti ovako nesto:
if(PlayerInfo[playerid][pJailed] == 1)
Pa da potrazis trebalo bi pod OnPlayerConnect da ispituje da li mu je ta varijabla na 1 pa ako jeste da ga stavi u jail. Potrazi po kordinatama