[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.

Skripta koju koristim: moja iz 0
Detaljan opis problema: Kako da napravim /jail command za admini i kad nekoga zatvoram da se random spawna na ove coordinate.
[AddPlayerClass(223,358.2131,2025.1234,-11.8211,182.0483,0,0,0,0,0,0); // kelija 1
AddPlayerClass(223,350.9724,2025.4629,-11.8677,215.4549,0,0,0,0,0,0); // kelija 2
AddPlayerClass(223,351.2983,2045.5486,-11.8802,329.2930,0,0,0,0,0,0); // kelija 3
AddPlayerClass(223,358.1645,2045.0725,-11.8663,17.8601,0,0,0,0,0,0); // kelija 4
AddPlayerClass(223,354.2760,2046.6738,-15.8942,359.6866,0,0,0,0,0,0); // kelija 5
AddPlayerClass(223,354.8276,2024.4840,-15.8942,182.0250,0,0,0,0,0,0); // kelija 6
/code]
[b]Dio skripte[/b]://
[b]Neke slike/video za lakse dobivanje pomoci(neobavezno)[/b]://

Stavi na vrh new Float:JailSpawnovi[3][3] = {
{358.2131,2025.1234,-11.8211},
{350.9724,2025.4629,-11.8677},
{351.2983,2045.5486,-11.8802},
{358.1645,2045.0725,-11.8663},
{354.2760,2046.6738,-15.8942},
{354.8276,2024.4840,-15.8942},
};
i onda u komandu jail stavi ovo rand = random(sizeof(JailSpawnovi));
SetPlayerPos(playerid, JailSpawnovi[rand][0], JailSpawnovi[rand][1], JailSpawnovi[rand][2], JailSpawnovi[rand][3], JailSpawnovi[rand][4], JailSpawnovi[rand][5]); // to ce odrediti random spawn


Citat: Child poslato Decembar 10, 2012, 15:32:11 POSLE PODNE
Jel mozes da mi das celu komandu??
Pa nemam je xD, pa pazi ovo rand = random(sizeof(JailSpawnovi));
SetPlayerPos(giveplayerid, JailSpawnovi[rand][0], JailSpawnovi[rand][1], JailSpawnovi[rand][2], JailSpawnovi[rand][3], JailSpawnovi[rand][4], JailSpawnovi[rand][5]); // to ce odrediti random spawn
samo ovo stavis u sredinu komande, nije ti valjda toliko tesko to, i on ce ga spawnati na mestu koje server izabere :)

Aj molim te izvadi je od negde daj mi je  :-*

CMD:jail(playerid, params[])
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
    {
new
id,
razlog[126];
//time[48];
new string[128];
if(sscanf(params, "us[128]", id, razlog /*time*/ )) return SendClientMessage(playerid,COLOR_WHITE,"Koristenje: /jail [ID] [Razlog] [Vrijeme]");
rand = random(sizeof(JailSpawnovi));
SetPlayerPos(id, JailSpawnovi[rand][0], JailSpawnovi[rand][1], JailSpawnovi[rand][2], JailSpawnovi[rand][3], JailSpawnovi[rand][4], JailSpawnovi[rand][5]); // to ce odrediti random spawn
InJailZone[playerid]=1;
    new pName[MAX_PLAYER_NAME];
    new vName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,32);
GetPlayerName(id,vName,32);
    format(string,sizeof string,"Administrator %s vas je stavio u zatvor! Razlog: %s", pName, razlog);
    SendClientMessage(id, COLOR_LIME,string);
    format(string,sizeof string,"Stavili ste igraca %s u zatvor!",vName);
    SendClientMessage(playerid, COLOR_YELLOW,string);
    }
    else SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
    return 1;
}

Brate stavio sam sve ovo i mi baca sledece erore

C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11804) : error 017: undefined symbol "rand"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11805) : error 017: undefined symbol "rand"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11806) : error 017: undefined symbol "InJailZone"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11806) : warning 215: expression has no effect
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11806) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11806) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11806) : fatal error 107: too many error messages on one line
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(304) : error 018: initialization data exceeds declared size
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(308) : error 010: invalid function or declaration

Kako da gi fixam u cemu je problem ??


Sad su ostale ove erore ispod ti se i linje gde su erore

C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11806) : error 032: array index out of bounds (variable "JailSpawnovi")
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : error 017: undefined symbol "InJailZone"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : warning 215: expression has no effect
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : fatal error 107: too many error messages on one line
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(305) : error 018: initialization data exceeds declared size
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(309) : error 010: invalid function or declaration



new Float:JailSpawnovi[3][3] = {
{358.2131,2025.1234,-11.8211},
{350.9724,2025.4629,-11.8677},
{351.2983,2045.5486,-11.8802}, //tu je eror u liniju 305
{358.1645,2045.0725,-11.8663},
{354.2760,2046.6738,-15.8942},
{354.8276,2024.4840,-15.8942},
}; //tu je eror u liniju 309

CMD:jail(playerid, params[])
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
    {
new
id,
razlog[126];
//time[48];
new string[128];
if(sscanf(params, "us[128]", id, razlog /*time*/ )) return SendClientMessage(playerid,COLOR_WHITE,"Koristenje: /jail [ID] [Razlog] [Vrijeme]");
rand = random(sizeof(JailSpawnovi));
SetPlayerPos(id, JailSpawnovi[rand][0], JailSpawnovi[rand][1], JailSpawnovi[rand][2], JailSpawnovi[rand][3], JailSpawnovi[rand][4], JailSpawnovi[rand][5]); // to ce odrediti random spawn //tu mi baca eror na liniju 11806
InJailZone[playerid]=1; //ostale erore tu mi baca na liniju 11807
    new pName[MAX_PLAYER_NAME];
    new vName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,32);
GetPlayerName(id,vName,32);
    format(string,sizeof string,"Administrator %s vas je stavio u zatvor! Razlog: %s", pName, razlog);
    SendClientMessage(id, COLOR_LIME,string);
    format(string,sizeof string,"Stavili ste igraca %s u zatvor!",vName);
    SendClientMessage(playerid, COLOR_YELLOW,string);
    }
    else SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
    return 1;
}

stavi ovo na vrhu ovako new Float:JailSpawnovi[6][6] = {
{358.2131,2025.1234,-11.8211},
{350.9724,2025.4629,-11.8677},
{351.2983,2045.5486,-11.8802}, //tu je eror u liniju 305
{358.1645,2045.0725,-11.8663},
{354.2760,2046.6738,-15.8942},
{354.8276,2024.4840,-15.8942},
};
i javi dali errorise :D

Baca brate opet
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : error 017: undefined symbol "InJailZone"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : warning 215: expression has no effect
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(11807) : fatal error 107: too many error messages on one line
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(308) : error 018: initialization data exceeds declared size


new Float:JailSpawnovi[6][6] = {
{358.2131,2025.1234,-11.8211},
{350.9724,2025.4629,-11.8677},
{351.2983,2045.5486,-11.8802},
{358.1645,2045.0725,-11.8663},
{354.2760,2046.6738,-15.8942},
{354.8276,2024.4840,-15.8942}, //tu baca eror
};


InJailZone[playerid]=1; i ovde baca ostale erore

stavi ga ovako new Float:JailSpawnovi[6][6] = {
{358.2131,2025.1234,-11.8211},
{350.9724,2025.4629,-11.8677},
{351.2983,2045.5486,-11.8802},
{358.1645,2045.0725,-11.8663},
{354.2760,2046.6738,-15.8942},
{354.8276,2024.4840,-15.8942}
};
a ovo za jailzonu, nisi definisao, definisi ga

Kako ovo da definiram InJailZone[playerid]=1; ???


Child, ajde molim te pročitaj malo koje ti errore baca, pa ćeš vidjet gdje su greške zapravo. :)

Citat: Child poslato Decembar 10, 2012, 23:02:40 POSLE PODNE
error 017: undefined symbol "InJailZone"
error 001: expected token: ";", but found "]"

jel vidiš ovaj prvi ?
nisi definirao InJailZone
kod ovog drugog, umjesto ; , postavljeno je ]
to zamijeni i trebalo bi valjat :)