[POMOC] Komanda /ajail

Započeo Frile, April 03, 2011, 20:06:18 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim:GTA RP
Detaljan opis problema: napravio sam zatvor preko mta sa posebnim celijama i napravio sam da kada uhapsis nekoga stavlja igraca random u celije, ali onda mi se desio ovaj problem kada sam testirao server sa drugom ja kucam /ajail id vrijeme i razlog da stavim njega u jail a ono pise njemu da je u jail portuje ga negdje u vazduhu a mene ubaci u zatvor, pa dali neko zna do cega je problem evo komanda
Dio skripte:  if(strcmp(cmd, "/ajail", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /ajail [playerid/Nik] [vrijeme(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][pGm] >= 1)
{
    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, "Koriscenje: /ajail [playerid/Nik] [vrijeme(minuti)] [razlog]");
return 1;
}
format(string, sizeof(string), "* Ubacili ste u Jail %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Ubaceni ste u Jail od Admin %s.", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
SafeResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 0);
PlayerInfo[playa][pInt] = 0;
switch(random(24))
                        {
                        case 0: SetPlayerPos(playerid, 1757.7479,-1563.0048,1734.9430);
                        case 1: SetPlayerPos(playerid, 1761.9458,-1562.6422,1734.9430);
                        case 2: SetPlayerPos(playerid, 1766.0544,-1562.1848,1734.9430);
                        case 3: SetPlayerPos(playerid, 1770.6321,-1562.6045,1734.9430);
                        case 4: SetPlayerPos(playerid, 1775.1123,-1562.9954,1734.9430);
                        case 5: SetPlayerPos(playerid, 1779.0582,-1562.4333,1734.9430);
                        case 6: SetPlayerPos(playerid, 1778.7703,-1582.5491,1734.9430);
                        case 7: SetPlayerPos(playerid, 1774.3679,-1582.9398,1734.9430);
                        case 8: SetPlayerPos(playerid, 1770.0060,-1582.8011,1734.9430);
                        case 9: SetPlayerPos(playerid, 1765.8530,-1583.4468,1734.9430);
                        case 10: SetPlayerPos(playerid, 1761.3236,-1582.5583,1734.9430);
                        case 11: SetPlayerPos(playerid, 1757.7047,-1582.9205,1734.9430);
                        case 12: SetPlayerPos(playerid, 1757.8369,-1564.3037,1738.6935);
                        case 13: SetPlayerPos(playerid, 1761.7532,-1564.3408,1738.6935);
                        case 14: SetPlayerPos(playerid, 1765.9097,-1563.0442,1738.6935);
                        case 15: SetPlayerPos(playerid, 1770.0720,-1563.6960,1738.6935);
                        case 16: SetPlayerPos(playerid, 1774.7206,-1563.3007,1738.6935);
                        case 17: SetPlayerPos(playerid, 1778.7098,-1562.4268,1738.6938);
                        case 18: SetPlayerPos(playerid, 1778.8673,-1583.1049,1738.7177);
                        case 19: SetPlayerPos(playerid, 1774.4983,-1582.8956,1738.7173);
                        case 20: SetPlayerPos(playerid, 1770.2850,-1582.7064,1738.7173);
                        case 21: SetPlayerPos(playerid, 1765.9250,-1582.8099,1738.7173);
                        case 22: SetPlayerPos(playerid, 1761.6605,-1583.0819,1738.7173);
                        case 23: SetPlayerPos(playerid, 1757.5471,-1583.0542,1738.7173);
                        }
format(string, sizeof(string), "Ubaceni ste u jail na %d minuta.   Kaucija: Ne", money);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, 256, "AdmCmd: %s je ubacen u Jail od Admin %s [Razlog: %s]", giveplayer, sendername, (result));
BroadCast(COLOR_LIGHTRED,string);
format(string, sizeof(string), "AdmCmd: %s je ubacen u Jail od Admin %s [Razlog: %s]", giveplayer, sendername, (result));
printf("%s",string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste ovlasceni da koristite tu komandu!");
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

Citat: Frile poslato April 03, 2011, 20:06:18 POSLE PODNE
Skripta koju koristim:GTA RP
Detaljan opis problema: napravio sam zatvor preko mta sa posebnim celijama i napravio sam da kada uhapsis nekoga stavlja igraca random u celije, ali onda mi se desio ovaj problem kada sam testirao server sa drugom ja kucam /ajail id vrijeme i razlog da stavim njega u jail a ono pise njemu da je u jail portuje ga negdje u vazduhu a mene ubaci u zatvor, pa dali neko zna do cega je problem evo komanda
Dio skripte:  if(strcmp(cmd, "/ajail", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /ajail [playerid/Nik] [vrijeme(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][pGm] >= 1)
{
    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, "Koriscenje: /ajail [playerid/Nik] [vrijeme(minuti)] [razlog]");
return 1;
}
format(string, sizeof(string), "* Ubacili ste u Jail %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Ubaceni ste u Jail od Admin %s.", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
SafeResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 0);
PlayerInfo[playa][pInt] = 0;
switch(random(24))
                        {
                        case 0: SetPlayerPos(playerid, 1757.7479,-1563.0048,1734.9430);
                        case 1: SetPlayerPos(playerid, 1761.9458,-1562.6422,1734.9430);
                        case 2: SetPlayerPos(playerid, 1766.0544,-1562.1848,1734.9430);
                        case 3: SetPlayerPos(playerid, 1770.6321,-1562.6045,1734.9430);
                        case 4: SetPlayerPos(playerid, 1775.1123,-1562.9954,1734.9430);
                        case 5: SetPlayerPos(playerid, 1779.0582,-1562.4333,1734.9430);
                        case 6: SetPlayerPos(playerid, 1778.7703,-1582.5491,1734.9430);
                        case 7: SetPlayerPos(playerid, 1774.3679,-1582.9398,1734.9430);
                        case 8: SetPlayerPos(playerid, 1770.0060,-1582.8011,1734.9430);
                        case 9: SetPlayerPos(playerid, 1765.8530,-1583.4468,1734.9430);
                        case 10: SetPlayerPos(playerid, 1761.3236,-1582.5583,1734.9430);
                        case 11: SetPlayerPos(playerid, 1757.7047,-1582.9205,1734.9430);
                        case 12: SetPlayerPos(playerid, 1757.8369,-1564.3037,1738.6935);
                        case 13: SetPlayerPos(playerid, 1761.7532,-1564.3408,1738.6935);
                        case 14: SetPlayerPos(playerid, 1765.9097,-1563.0442,1738.6935);
                        case 15: SetPlayerPos(playerid, 1770.0720,-1563.6960,1738.6935);
                        case 16: SetPlayerPos(playerid, 1774.7206,-1563.3007,1738.6935);
                        case 17: SetPlayerPos(playerid, 1778.7098,-1562.4268,1738.6938);
                        case 18: SetPlayerPos(playerid, 1778.8673,-1583.1049,1738.7177);
                        case 19: SetPlayerPos(playerid, 1774.4983,-1582.8956,1738.7173);
                        case 20: SetPlayerPos(playerid, 1770.2850,-1582.7064,1738.7173);
                        case 21: SetPlayerPos(playerid, 1765.9250,-1582.8099,1738.7173);
                        case 22: SetPlayerPos(playerid, 1761.6605,-1583.0819,1738.7173);
                        case 23: SetPlayerPos(playerid, 1757.5471,-1583.0542,1738.7173);
                        }
format(string, sizeof(string), "Ubaceni ste u jail na %d minuta.   Kaucija: Ne", money);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, 256, "AdmCmd: %s je ubacen u Jail od Admin %s [Razlog: %s]", giveplayer, sendername, (result));
BroadCast(COLOR_LIGHTRED,string);
format(string, sizeof(string), "AdmCmd: %s je ubacen u Jail od Admin %s [Razlog: %s]", giveplayer, sendername, (result));
printf("%s",string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste ovlasceni da koristite tu komandu!");
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

Pogresio si oko Kordinata!

JEsi siguran da su ti dobre korde i jesu ti kavezi u nekom intu ili ??

kavez nije u int, a i kordinate su 100 posto tacne, a i nije greska do toga jer ono portuje u celiju onoga koji hoce da jail igraca odnosno admina, a ovaj sto treba da bude u jail pise vi ste ubaceni u jail od tog i tog admina i onda ga port nedje u vazduh

Uzmi klasicnu /ajail komandu i samo ubaci koordinate i probaj da li ce da radi
Poslednja Izmena: April 03, 2011, 20:37:06 POSLE PODNE od Nikola I




uzeo sam iz obicnog GTA RP moda i opet isto dali zna neko do cega je

Citat: Frile poslato April 03, 2011, 20:37:08 POSLE PODNE
uzeo sam iz obicnog GTA RP moda i opet isto dali zna neko do cega je
Code: (c)
if(strcmp(cmd, "/ajail", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
            return 1;
         }
         new playa;
         new money;
         playa = ReturnUser(tmp);
         tmp = strtok(cmdtext, idx);
         money = strval(tmp);
         if (PlayerInfo[playerid][pAdmin] >= 1)
         {
             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: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
                     return 1;
                  }
                  format(string, sizeof(string), "* Zatvorili ste %s.", giveplayer);
                  SendClientMessage(playerid, COLOR_LIGHTRED, string);
                  format(string, sizeof(string), "* Zatvoreni ste od strane Administratora (Razlog Obrazlozen na Ooc Chatu!).", sendername);
                  SendClientMessage(playa, COLOR_LIGHTRED, string);
                  SafeResetPlayerWeapons(playa);
                  WantedPoints[playa] = 0;
                  PlayerInfo[playa][pJailed] = 1;
                  PlayerInfo[playa][pJailTime] = money*60;
                  SetPlayerInterior(playa, 6);
                  PlayerInfo[playa][pInt] = 6;
                  SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
                  format(string, sizeof(string), "Zatvorili ste na %d minuta.   Kaucija: Nedostupna", money);
                  SendClientMessage(playa, COLOR_WHITE, string);
                  format(string, 256, "Admin Jail:admina %s [Razlog: %s]", giveplayer, sendername, (result));
                  BroadCast(COLOR_LIGHTRED,string);
                  format(string, sizeof(string), "Admin Jail:admin zatvor je ubacio igraca %s [Razlog: %s]", giveplayer, sendername, (result));
                  printf("%s",string);
               }
            }
         }
         else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "   Niste autorizovani da bi ste koristili ovu komandu!");
         }
      }
      return 1;
   }

Eto ti Probaj sa ovim radi 100 %
Poslednja Izmena: April 03, 2011, 20:58:19 POSLE PODNE od Nikola_Hawks

Citat: Nikola_Hawks poslato April 03, 2011, 20:57:41 POSLE PODNE
Citat: Frile poslato April 03, 2011, 20:37:08 POSLE PODNE
uzeo sam iz obicnog GTA RP moda i opet isto dali zna neko do cega je
Code: (c)
if(strcmp(cmd, "/ajail", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
            return 1;
         }
         new playa;
         new money;
         playa = ReturnUser(tmp);
         tmp = strtok(cmdtext, idx);
         money = strval(tmp);
         if (PlayerInfo[playerid][pAdmin] >= 1)
         {
             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: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
                     return 1;
                  }
                  format(string, sizeof(string), "* Zatvorili ste %s.", giveplayer);
                  SendClientMessage(playerid, COLOR_LIGHTRED, string);
                  format(string, sizeof(string), "* Zatvoreni ste od strane Administratora (Razlog Obrazlozen na Ooc Chatu!).", sendername);
                  SendClientMessage(playa, COLOR_LIGHTRED, string);
                  SafeResetPlayerWeapons(playa);
                  WantedPoints[playa] = 0;
                  PlayerInfo[playa][pJailed] = 1;
                  PlayerInfo[playa][pJailTime] = money*60;
                  SetPlayerInterior(playa, 6);
                  PlayerInfo[playa][pInt] = 6;
                  SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
                  format(string, sizeof(string), "Zatvorili ste na %d minuta.   Kaucija: Nedostupna", money);
                  SendClientMessage(playa, COLOR_WHITE, string);
                  format(string, 256, "Admin Jail:admina %s [Razlog: %s]", giveplayer, sendername, (result));
                  BroadCast(COLOR_LIGHTRED,string);
                  format(string, sizeof(string), "Admin Jail:admin zatvor je ubacio igraca %s [Razlog: %s]", giveplayer, sendername, (result));
                  printf("%s",string);
               }
            }
         }
         else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "   Niste autorizovani da bi ste koristili ovu komandu!");
         }
      }
      return 1;
   }

Eto ti Probaj sa ovim radi 100 %
Ali on hoce sa vise kaveza ne sa jednim :s on je isto tako uradio samo je jos dodao par pozicija Case.

nikola probao sam opet je isto, do cega bi mogao da bude problem