[Pomoc]Kako napraviti random spawn u jailu

Započeo Orion, Septembar 13, 2011, 21:32:32 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:larp edit
Detaljan opis problema:mene zanima kako da napravim random spawn u jailu tj. kada policajac uhiti prvi out igraca on se stvoru npr u celiji br.1 i kada policajac uhiti drugog igraca on se spawna u celiji br. 5 jel to ikako moguce
i jos nesto da nemorma otvarat novu temu kako napravit pocetni spawn u intu hvala unaprijed
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):

moze se uraditi za zatvor trebas dati kordinate i komanud za uhicenje...

if(strcmp(cmd, "/arrest", true) == 0)
{
   if(IsPlayerConnected(playerid))
  {
if(IsACop(playerid) || IsAFreecop(playerid))
{
if(PlayerInfo[playerid][pDuty] == 0)
{
   SendClientMessage(playerid, COLOR_GREY, "** Nisi na duznosti!");
   return 1;
}
if(PlayerInfo[playerid][pDBanned] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "** Banan si sa duznosti!");
    return 1;
}

if(IsPlayerInRangeOfPoint(playerid, 6, 255.4480,85.8236,1002.4453))
{

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 20000) { SendClientMessage(playerid, COLOR_GREY, "   Jail Price can't be below $1 or above $20000!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 5) { SendClientMessage(playerid, COLOR_GREY, "   Jail Time Minutes can't be below 1 or above 5 (Take the person to prison then)!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Jail Bailing can't be below 0 or above 1!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 2000000) { SendClientMessage(playerid, COLOR_GREY, "** Jail Bailing can't be below $0 or above $2000000!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));

if(WantedLevel[suspect] < 1)
{
    SendClientMessage(playerid, COLOR_GREY, "** Igrac moram imati wanted level!");
    return 1;
}
format(string, sizeof(string), "* Uhapsio si %s!", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
SafeGivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Uhapsen od %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 = "Cadet"; }
else if(PlayerInfo[playerid][pRank] == 2) { currank = "Officer"; }
else if(PlayerInfo[playerid][pRank] == 3) { currank = "Senior Officer"; }
else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
        else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; }
        else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; }
        else if(PlayerInfo[playerid][pRank] == 8) { currank = "Chief"; }
else { currank = "Cadet"; }
format(string, sizeof(string), "[Police] %s %s has just arrested %s", currank ,sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "[Police] Agent %s has just arrested %s", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "[Police] Soldier %s has just arrested %s", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(IsAFreecop(playerid))
{
   format(string, sizeof(string), "[Police] Dobrovoljni policajac %s has just arrested %s", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
SafeSetPlayerInterior(suspect, 0);
SafeSetPlayerPos(suspect,1760.1761,-1540.7734,9.3299);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "You are jailed for %d seconds.   Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
else
{
   JailPrice[suspect] = 0;
format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
PlayerInfo[suspect][pJailed] = 1;
      PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
TextDrawShowForPlayer(suspect, Textdraw1[suspect]);
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
PlayerCuffed[suspect] = 0;
GaveUp[suspect] = 0;
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Arrested %s for %s Seconds. Bail: $%d, Price: $%d",d,m,y,h,mi,s,sendername,giveplayer, PlayerInfo[suspect][pJailTime],JailPrice[suspect],moneys);
JailLog(string);
}//distance
}//not connected
}
}
else
{
   SendClientMessage(playerid, COLOR_GREY, "** You are not an FBI!");
   return 1;
}
}//not connected
return 1;
}

if(strcmp(cmd, "/farrest", true) == 0)
{
   if(IsPlayerConnected(playerid))
  {
if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
if(PlayerInfo[playerid][pDuty] != 1 && PlayerInfo[playerid][pMember] == 2)
{
   SendClientMessage(playerid, COLOR_GREY, "** Nisi na duznosti!");
   return 1;
}
if(PlayerInfo[playerid][pDuty] != 1 && PlayerInfo[playerid][pMember] == 2)
{
   SendClientMessage(playerid, COLOR_GREY, "** Nisi na duznosti!");
   return 1;
}
if(PlayerInfo[playerid][pDBanned] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "** Banan si sa duznosti!");
    return 1;
}

if(IsPlayerInRangeOfPoint(playerid, 6, 201.0256,168.3393,1003.0234))
{//New arrest system FBI

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /farrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 35000) { SendClientMessage(playerid, COLOR_GREY, "   Jail Price can't be below $1 or above $35000!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /farrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 5) { SendClientMessage(playerid, COLOR_GREY, "   Jail Time Minutes can't be below 1 or above 5 (Take the person to prison then)!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /farrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Jail Bailing can't be below 0 or above 1!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /farrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "** Jail Bailing can't be below $0 or above $3000000!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));

if(WantedLevel[suspect] < 1)
{
    SendClientMessage(playerid, COLOR_GREY, "** Player must be at least Wanted Level 1!");
    return 1;
}
format(string, sizeof(string), "* You arrested %s!", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
SafeGivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "arrested by %s ~n~    for $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
SafeResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
   new currank[64];
    if(PlayerInfo[playerid][pRank] == 1) { currank = "FBI Cadet"; }
else if(PlayerInfo[playerid][pRank] == 2) { currank = "Agent"; }
else if(PlayerInfo[playerid][pRank] == 3) { currank = "Special Agent"; }
else if(PlayerInfo[playerid][pRank] == 4) { currank = "Special Agent in Charge"; }
else if(PlayerInfo[playerid][pRank] == 5) { currank = "Division Chief"; }
        else if(PlayerInfo[playerid][pRank] == 6) { currank = "Assistant of Director"; }
        else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Director"; }
        else if(PlayerInfo[playerid][pRank] == 8) { currank = "Director"; }
else { currank = "Cadet"; }
format(string, sizeof(string), "[Police] %s %s has just arrested %s", currank ,sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
format(string, sizeof(string), "[Police] Officer %s has just arrested %s", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
SafeSetPlayerInterior(suspect, 3);
SafeSetPlayerPos(suspect,197.7956,175.0676,1003.0234);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "You are jailed for %d seconds.   Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
else
{
   JailPrice[suspect] = 0;
format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
PlayerInfo[suspect][pJailed] = 3;
      PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
TextDrawShowForPlayer(suspect, Textdraw1[suspect]);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Arrested %s for %s Seconds. Bail: $%d, Price: $%d",d,m,y,h,mi,s,sendername,giveplayer, PlayerInfo[suspect][pJailTime],JailPrice[suspect],moneys);
JailLog(string);
}//distance
}//not connected
}
}
else
{
   SendClientMessage(playerid, COLOR_GREY, "** You are not an FBI!");
   return 1;
}
}//not connected
return 1;
}


evo i kordinata
AddPlayerClass(288,377.8574,180.1865,889.5491,13.9316,0,0,0,0,0,0); // 1
AddPlayerClass(288,383.7631,181.7297,889.5491,347.2980,0,0,0,0,0,0); // 2
AddPlayerClass(288,388.6397,180.9308,889.5491,0.1448,0,0,0,0,0,0); // 3
AddPlayerClass(288,394.2425,162.0390,889.5491,229.0498,0,0,0,0,0,0); // 4
AddPlayerClass(288,389.0109,162.1713,889.5491,176.2164,0,0,0,0,0,0); // 5
AddPlayerClass(288,383.2647,161.0841,894.7219,149.5828,0,0,0,0,0,0); // 6
AddPlayerClass(288,387.3955,163.3350,894.7202,205.9834,0,0,0,0,0,0); // 7
AddPlayerClass(288,394.3862,161.0705,894.7219,206.6101,0,0,0,0,0,0); // 8
AddPlayerClass(288,394.0984,179.2156,894.7069,8.2916,0,0,0,0,0,0); // 9
AddPlayerClass(288,387.4977,181.3366,894.6715,40.8786,0,0,0,0,0,0); // 10
AddPlayerClass(288,382.9664,179.6991,894.6988,11.7383,0,0,0,0,0,0); // 11
AddPlayerClass(288,377.6569,180.2000,894.6905,354.8182,0,0,0,0,0,0); // 12
Poslednja Izmena: Septembar 14, 2011, 18:49:59 POSLE PODNE od Jethro_Gibbs