[Pomoc] Admin Jail

Započeo Schwarz, Decembar 10, 2012, 15:23:56 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Ok opravio sam ga
Sad kako da napravim kad mu postavim 0 minute da ga oslobodi na ove koordinate 1727.2103,-1634.1802,20.2160, kako da napravim kad igrac pise /prisontime da mu da jos kolko vreme ima da odlezi, kako da napravim ako igrac izleze od zonu da ga vrati, i kako da napravim da mu zacuvuje vreme kad se igrac diskonektuje i kad se onda pak conektuje da ga stavi u zatvor ???

za ovo prvo , stavis te koordinate u public gde te spawnuje posle zatvora za prisontime mi daj tvoju varijablu da bi ti napravio

Nemam varijablu samo sam dodao random coordinate i komandu

napravi public gde ce oslobadjati igraca iz zatvora i stavi tamo ovo SetPlayerPos(playerid, 1727.2103,-1634.1802,20.2160); a za ovaj jail napravi novu varijablu, npr pVremeZatvora, i onda napravis komandu CMD:vreme(playerid, params[])
{
new str[128];
foreach(Player, i)
{
        if(PlayerInfo[i][pVremeZatvora] > 0)
        {
            format(str, sizeof(str), "Preostalo vreme~n~U zatvoru:~n~%d", PlayerInfo[i][pVremeZatvora]);
            GameTextForPlayer(i, str, 1000, 4);
    }
}
}
return 1;
}
tako bi trebalo

Kako da napravim public za oslobodjane igraca jel mi mozes napravit i kako da napravim da zacuvje na OnPlayerDissconect i onda kad se connect da ga stavi u zatvor ??

to treba izgleda na ovu foru, znaci trebas napraviti tajmer , i onda uraditi public public UnZatvor(playerid)
{
    SetPlayerInterior(playerid, 0);
    VARIJABLA_ZATVORA[playerid] = false;//to je da mu skida tvorza
    SCM(playerid, -1, " slobodan si ",);
    PlayerInfo[playerid][pVarijabla_Za_Zatvor] = 0;
    // i ovde stavi da ti ubija tajmer zatvora
}

A jel mi mozes uraditi taj tajmer ?? 

pa stavis ovo pod OnPlayerConnect if(PlayerInfo[playerid][pVarijabla_Za_zatvorenog_igraca] > 0)
{
ZatvorTimer[playerid] = SetTimerEx("UnZatvor",1000, PlayerInfo[playerid][pVremeZatvora], "i", playerid);
         SetPlayerPos(playerid, ..//koordiate
SCM(playerid, -1, "Zatvorska kazna nije istekla vracas se u zatvor");
}
i onda unzatvor uradis ovako public UnZatvor(playerid)
{
    SetPlayerPos(playerid...// koordinate
VARIJABLA_ZATVORA[playerid] = false;
    GameTextForPlayer(playerid, "~r~vreme ti je isteklo", 5000, 6);
    PlayerInfo[playerid][pZatvor] = 0;
    KillTimer(JailTimer[playerid]);
}
tako nekako, smuckaj ga

C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1190) : error 028: invalid subscript (not an array or too many subscripts): "pPrison"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1190) : warning 215: expression has no effect
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1190) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1190) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1190) : fatal error 107: too many error messages on one line


public UnZatvor(playerid)
{
    AC_BS_SetPlayerInterior(playerid, 0);
    pPrison[playerid] = false;//tu mi daje erore
    SCM(playerid, -1, " Sloboden ste ",);
    PlayerInfo[playerid][pPrison] = 0;
    KillTimer(ZatvorTimer[playerid]);
}

obrisi tu liniju, visak ti je, posto vidim da si definisao zatvor preko enuma

C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1190) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1190) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1190) : error 001: expected token: ",", but found ";"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1192) : error 017: undefined symbol "ZatvorTimer"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1192) : warning 215: expression has no effect
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1192) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1192) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(1192) : fatal error 107: too many error messages on one line

Sad kad sam obrisao ta liniju baca mi ove erore

na vrh stavi new ZatvorTimer[MAX_PLAYERS];

C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11428) : error 010: invalid function or declaration
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(7232) : error 017: undefined symbol "id"


if(PlayerInfo[playerid][pPrison] > 0)
{
ZatvorTimer[playerid] = SetTimerEx("UnZatvor",1000, PlayerInfo[playerid][pPrisonTime], "i", playerid);
       //tu mi baca  AC_BS_SetPlayerPos(id,JailSpawnovi[rand][0], JailSpawnovi[rand][1], JailSpawnovi[rand][2], JailSpawnovi[rand][3], JailSpawnovi[rand][4], JailSpawnovi[rand][5], JailSpawnovi[rand][6], JailSpawnovi[rand][7], JailSpawnovi[rand][8], JailSpawnovi[rand][9]);
SCM(playerid, -1, "Nedovrsena zatvorska kazna, nazad vo zatvor");
}


CMD:prisoninfo(playerid, params[])
{
new str[128];
foreach(Player, i)
{
        if(PlayerInfo[i][pPrison] > 0)
        {
            format(str, sizeof(str), "Zatvor:~n~%d", PlayerInfo[i][pPrison]);
            GameTextForPlayer(i, str, 1000, 4);
    }
}
}
return 1; //i tu mi baca
}

if(PlayerInfo[playerid][pPrison] > 0)
{
ZatvorTimer[playerid] = SetTimerEx("UnZatvor",1000, PlayerInfo[playerid][pPrisonTime], "i", playerid);
       //tu mi baca  AC_BS_SetPlayerPos(playerid,JailSpawnovi[rand][0], JailSpawnovi[rand][1], JailSpawnovi[rand][2], JailSpawnovi[rand][3], JailSpawnovi[rand][4], JailSpawnovi[rand][5], JailSpawnovi[rand][6], JailSpawnovi[rand][7], JailSpawnovi[rand][8], JailSpawnovi[rand][9]);
SCM(playerid, -1, "Nedovrsena zatvorska kazna, nazad vo zatvor");
}

CMD:prisoninfo(playerid, params[])
{
new str[128];
foreach(Player, i)
{
        if(PlayerInfo[i][pPrison] > 0)
        {
            format(str, sizeof(str), "Zatvor:~n~%d", PlayerInfo[i][pPrison]);
            GameTextForPlayer(i, str, 1000, 4);
    }
    }
}
return 1; //brate tu celo vreme baca neki eror
}

C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11428) : error 010: invalid function or declaration