[pomoc]Kako da napravim jail

Započeo milos depalov, Jul 06, 2011, 16:04:00 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

skripta koju koristim:Empire-Gaming
detaljnij opis problema: na toj skripti nema jail milim da PD i FBI ubaci igraca u auto i da ga uhapsi ako imate neki tut da mi date ili da mi malo bolje objasnite oko toga ja bi vam bio zahvalam :'( :'( :'(
deo skripte: //
slika: //
nesto da dodate: Prvi put se srecem sa ovim problemom i verujem da nije lak
jer mozete da mi pomognete da mi objasnite , dami date TUT ili mozda znate neku FS.
Poslednja Izmena: Jul 06, 2011, 16:33:44 POSLE PODNE od milos depalov

dali se mozes potruditi? imas FS na samp forumu
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

nema trazio sam ako si video molim te daj mi je molim te  :( :( :( :( :(
bi se ja potrudio ali neznam kako ,trazio sam nisam nasao ,molio bi te ako mozes malo da mi olaksas
Poslednja Izmena: Jul 06, 2011, 16:51:50 POSLE PODNE od milos depalov


if(strcmp(cmd, "/arrest", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(gTeam[playerid] == 2  || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "(greska)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) || 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, "Koristi: /arrest [novcana kazna] [vreme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "(greska)Novcana kazna ne moze biti ispod $1 ni iznad $99999!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /arrest [novcana kazna] [vreme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "(greska) Zatvorska kazna ne moze biti ispod 1 ni iznad 20 minuta!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /arrest [novcana kazna] [vreme (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, "Koristi: /arrest [novcana kazna] [vreme (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, "(greska)Igrac mora imati barem Wanted Level 1!");
    return 1;
}
format(string, sizeof(string), "* Uhapsili ste %s!", 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 = "Desetar"; }
else if(PlayerInfo[playerid][pRank] == 4) { currank = "Vodnik"; }
else if(PlayerInfo[playerid][pRank] == 5) { currank = "Porucnik"; }
        else if(PlayerInfo[playerid][pRank] == 6) { currank = "Kapetan"; }
        else if(PlayerInfo[playerid][pRank] == 7) { currank = "Zamenik"; }
        else if(PlayerInfo[playerid][pRank] == 8) { currank = "Sef"; }
else { currank = "Kadet"; }
//format(string, sizeof(string), "[Policija] %s %s je uhapsio %s", currank ,sendername, giveplayer);
//OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
//{
//format(string, sizeof(string), "[Policija] Agent %s je uhapsio %s", sendername, giveplayer);
//OOCNews(COLOR_BLUE, string);
//}
SetPlayerInterior(suspect, 0);
SetPlayerWorldBounds(suspect,-1052.6142,-1179.6550,-931.2334,-1058.4941)
SetPlayerPos(suspect,-1123.5748,-999.8547,129.2187);
//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, "(greska)Nema nikoga u blizini za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "(greska)Niste na mestu za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "(greska)Niste Policajac/FBI!");
    return 1;
}
}//not connected
return 1;
}


if(strcmp(cmd, "/jail", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /jail [ID/Ime Igraca] [vreme(minuti)] [razlog]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAdmin] >= 3)
{
    if(IsPlayerConnected(playa))
    {
        if(playa != INVALID_PLAYER_ID)
        {
        GetPlayerName(playa, 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, COLOR_GRAD2, "Koristi: /jail [ID/Ime Igraca] [vreme(minuti)] [razlog]");
return 1;
}
format(string, sizeof(string), "* Zatvorio si %s.", giveplayer);
SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "* Zatvoren si od admina %s.", sendername);
SendClientMessage(playa, COLOR_RED, string);
SafeResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 0);
PlayerInfo[playa][pInt] = 0;
SetPlayerWorldBounds(playa,-1052.6142,-1179.6550,-931.2334,-1058.4941)
SetPlayerPos(playa,-1123.5748,-999.8547,129.2187);
format(string, sizeof(string), "Stavljen si u zatvor na %d minuta.Kaucija: Unable", money);
SendClientMessage(playa, COLOR_RED, string);
format(string, 256, "|A|%s je stavljen u zatvor od %s|Razlog:%s|", giveplayer, sendername, (result));
BroadCast(COLOR_RED,string);
format(string, sizeof(string), "|A|%s je stavljen u zatvor od %s|Razlog:%s|", giveplayer, sendername, (result));
printf("%s",string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
}
}
return 1;
}


Ubaci ove komande umesto tvojih pa kazi onda ?

dragan12

Citat: Boki Pro poslato Jul 06, 2011, 17:04:33 POSLE PODNE
if(strcmp(cmd, "/arrest", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(gTeam[playerid] == 2  || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "(greska)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) || 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, "Koristi: /arrest [novcana kazna] [vreme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "(greska)Novcana kazna ne moze biti ispod $1 ni iznad $99999!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /arrest [novcana kazna] [vreme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "(greska) Zatvorska kazna ne moze biti ispod 1 ni iznad 20 minuta!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /arrest [novcana kazna] [vreme (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, "Koristi: /arrest [novcana kazna] [vreme (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, "(greska)Igrac mora imati barem Wanted Level 1!");
    return 1;
}
format(string, sizeof(string), "* Uhapsili ste %s!", 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 = "Desetar"; }
else if(PlayerInfo[playerid][pRank] == 4) { currank = "Vodnik"; }
else if(PlayerInfo[playerid][pRank] == 5) { currank = "Porucnik"; }
        else if(PlayerInfo[playerid][pRank] == 6) { currank = "Kapetan"; }
        else if(PlayerInfo[playerid][pRank] == 7) { currank = "Zamenik"; }
        else if(PlayerInfo[playerid][pRank] == 8) { currank = "Sef"; }
else { currank = "Kadet"; }
//format(string, sizeof(string), "[Policija] %s %s je uhapsio %s", currank ,sendername, giveplayer);
//OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
//{
//format(string, sizeof(string), "[Policija] Agent %s je uhapsio %s", sendername, giveplayer);
//OOCNews(COLOR_BLUE, string);
//}
SetPlayerInterior(suspect, 0);
SetPlayerWorldBounds(suspect,-1052.6142,-1179.6550,-931.2334,-1058.4941)
SetPlayerPos(suspect,-1123.5748,-999.8547,129.2187);
//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, "(greska)Nema nikoga u blizini za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "(greska)Niste na mestu za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "(greska)Niste Policajac/FBI!");
    return 1;
}
}//not connected
return 1;
}


if(strcmp(cmd, "/jail", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /jail [ID/Ime Igraca] [vreme(minuti)] [razlog]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAdmin] >= 3)
{
    if(IsPlayerConnected(playa))
    {
        if(playa != INVALID_PLAYER_ID)
        {
        GetPlayerName(playa, 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, COLOR_GRAD2, "Koristi: /jail [ID/Ime Igraca] [vreme(minuti)] [razlog]");
return 1;
}
format(string, sizeof(string), "* Zatvorio si %s.", giveplayer);
SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "* Zatvoren si od admina %s.", sendername);
SendClientMessage(playa, COLOR_RED, string);
SafeResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 0);
PlayerInfo[playa][pInt] = 0;
SetPlayerWorldBounds(playa,-1052.6142,-1179.6550,-931.2334,-1058.4941)
SetPlayerPos(playa,-1123.5748,-999.8547,129.2187);
format(string, sizeof(string), "Stavljen si u zatvor na %d minuta.Kaucija: Unable", money);
SendClientMessage(playa, COLOR_RED, string);
format(string, 256, "|A|%s je stavljen u zatvor od %s|Razlog:%s|", giveplayer, sendername, (result));
BroadCast(COLOR_RED,string);
format(string, sizeof(string), "|A|%s je stavljen u zatvor od %s|Razlog:%s|", giveplayer, sendername, (result));
printf("%s",string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
}
}
return 1;
}


Ubaci ove komande umesto tvojih pa kazi onda ?
To sve zavisi kako je sta kod njega definisano i treba tu da stavi kordinate gde ce da stavi igraca kada ga uhapsi.