[POMOC] komanda /ajail

Započeo Frile, April 14, 2011, 17:36:20 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: GTA RP
Detaljan opis problema: kada hocu da dam nekom jail kucam /ajail id razlog i onda treba da ubaci igraca u zatvor, ali posto je u osnovnom gta rp modu samo jedna celija a ja sam napravio zatvor sa vise njih i stavio sam da random ubaca igrace u celiju, ali sada imam problem kada admin dadne igracu jail ono portuje admina u zatvor a igraca koji je trebao da dobije jail portuje negdje u vazduhu, dali neko zna u cemu je problem
Dio skripte:

if(strcmp(cmd, "/ajail", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /ajail [ID Igraca/Dio Imena] [time(minutes)] [reason]");
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 [ID Igraca/Dio Imena] [time(minutes)] [reason]");
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 strane Admina %s.", 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;
new rand;
rand = random(sizeof(ZatvorSpawns));
            SetPlayerPos(playerid, ZatvorSpawns[rand][0], ZatvorSpawns[rand][1], ZatvorSpawns[rand][2]);
format(string, sizeof(string), "U zatvor ste na %d minutes.   Kaucija: Ne", money);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, 256, "AdmCmd: %s je ubacen u jail od strane Admina %s [Razlog: %s]", giveplayer, sendername, (result));
BroadCast(COLOR_LIGHTRED,string);
format(string, sizeof(string), "AdmCmd: %s je ubacen u jail od strane Admina %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):

SetPlayerPos(playerid, ZatvorSpawns[rand][0], ZatvorSpawns[rand][1], ZatvorSpawns[rand][2]);

Probaj stavit

SetPlayerPos(playa, ZatvorSpawns[rand][0], ZatvorSpawns[rand][1], ZatvorSpawns[rand][2]);