Jump to content
  • 0

pomoc Admin Vězení


Precechtel

Dotaz

Zdravím, začínám s pawnem a zatím umím jen málo ale už mám na starost server. Chtějí po mě abych jim udělal příkaz /ajail ID hráče Čas (v minutách): Důvod: aby mu to napsalo Byl jsi vlozen adminem (Jméno admina) do admin vězení na (čas v minutách) [Důvod: něco] a aby ho to poslalo na souřadnice které již mám a aby to hráče zmrazilo + aby tam měli odpočet tolik sekund kolik zadám v čase a když to uplyne aby ho to propustilo a napsalo to Byl jsi propuštěn z admin vězení. Vím že mi asi nikdo nepomůžete ale snad se někdo mezi vámi najde mockrát děkuji. 

Link to comment
Share on other sites

Recommended Posts

  • 0
  • Globální moderátor

však v těch errorech je napsané co jsem psal já

 

definuješ "minut" a nikde ho nepoužiješ a pak používáš "minuty" které nejsou definovány ... schválně zkus n to přijít sám kde je problém a nehledej v tom složitosti ;)

Link to comment
Share on other sites

  • 0
  • Globální moderátor

Kdybych věděl co přesně hledat vyhledal bych to

 

no však to píšu - "minut"

 

řádek definice

 

new minut = strval(cmdtext[pos]); 

Link to comment
Share on other sites

  • 0

C:\Users\Rapid-PC\Desktop\AMX & PAWN\Ajail.pwn(105) : error 035: argument type mismatch (argument 4)


Smazal jsem u propustit ty uvozovky a ted mi to háže toto 

 

C:\Users\Rapid-PC\Desktop\AMX & PAWN\Ajail.pwn(105) : error 076: syntax error in the expression, or invalid function call

Link to comment
Share on other sites

  • 0

error 035: argument type mismatch (argument 4)

Smazal jsem u propustit ty uvozovky

POUŽÍVÁŠ U TOHO VŮBEC HLAVU?

 

Máš tam jasně napsaný, že chyba je v argumentu 4, tj. "id".

A kdyby ses aspoň podíval na SAMP wiki, jestli to máš vůbec správně, zjistil bys, že ne.

 

SetTimerEx("Propustit", minut*60000, false, "d", id);
A než sem zas postneš nějakou chybu, tak napřed zapni mozek.
Link to comment
Share on other sites

  • 0

Co mám na tomto špatně? Díky za radu :)

 

 

Errory:  C:\Users\Lukáš\Desktop\pawno\AdminJail.pwn(107) : error 029: invalid expression, assumed zero
C:\Users\Lukáš\Desktop\pawno\AdminJail.pwn(107) : warning 215: expression has no effect
C:\Users\Lukáš\Desktop\pawno\AdminJail.pwn(108) : warning 225: unreachable code
C:\Users\Lukáš\Desktop\pawno\AdminJail.pwn(114) : error 029: invalid expression, assumed zero
C:\Users\Lukáš\Desktop\pawno\AdminJail.pwn(114) : warning 215: expression has no effect
C:\Users\Lukáš\Desktop\pawno\AdminJail.pwn(114) : error 001: expected token: ";", but found ")"
C:\Users\Lukáš\Desktop\pawno\AdminJail.pwn(114) : error 029: invalid expression, assumed zero
C:\Users\Lukáš\Desktop\pawno\AdminJail.pwn(114) : fatal error 107: too many error messages on one line
 5 Errors.
 

 

 

 

 

 

 

if(strcmp(cmdtext," /ajail",true,6) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"*Nejsi prihlaseny na RCON*");
        new pos = chrfind(' ',cmdtext,7)+1;
        new pos2 = chrfind(' ',cmdtext,pos)+1;
        new id = strval(cmdtext[7]);
        new minut = strval(cmdtext[pos]);
        if(pos == 0 || pos2 == 0) return SendClientMessage(playerid,0xFF0000FF,"Použití: /ajail [ID] [MINUTY] [DÙVOD]");
        else if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Hráè není pøipojen");
        else if(minuty < 1; return SendClientMessage(playerid,0xFF0000FF,"Hráèe musíte zatknout na minimálnì jednu minutu");
        {
            SetPlayerPos(id,-1053.9696, 438.3813, 19.8165 );
            TogglePlayerControllable(id,false);
            SetTimerEx("Propustit", minut*60000, false, "d", id);
            new string[128],name[24];
            GetPlayerName(playerid,name,sizeof(name));
            format(string,sizeof(string),"Byl jsi vlozen adminem %s do admin vìzení na %d [Dùvod: %s]",name,minuty,cmdtext[pos2]);
            SendClientMessage(id,0xFF0000FF,string);
        }
        return 1;
    }
    return 0;
}
forward Propustit(playerid);
public Propustit(playerid)
{
    TogglePlayerControllable(playerid,true);
    SetPlayerPos(playerid,-1053.9696, 438.3813, 19.8165 );
    return SendClientMessage(playerid,0xFF0000FF,"Byl jsi propuštìn z admin vìzení.");
}


stock chrfind(n,h[],s=0)
{
    new l = strlen(h);
    while(s < l)
    {
        if(h[s] == n) return s;
        s++;
    }
    return -1;
}
Link to comment
Share on other sites

  • 0

Používej bb cody, prosím :)

if(strcmp(cmdtext," /ajail",true,6) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"*Nejsi prihlaseny na RCON*");
        new pos = chrfind(' ',cmdtext,7)+1;
        new pos2 = chrfind(' ',cmdtext,pos)+1;
        new id = strval(cmdtext[7]);
        new minut = strval(cmdtext[pos]);
        if(pos == 0 || pos2 == 0) return SendClientMessage(playerid,0xFF0000FF,"Použití: /ajail [ID] [MINUTY] [DÙVOD]");
        else if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Hráè není pøipojen");
        else if(minuty < 1) return SendClientMessage(playerid,0xFF0000FF,"Hráèe musíte zatknout na minimálnì jednu minutu");
        else
        {
            SetPlayerPos(id,-1053.9696, 438.3813, 19.8165 );
            TogglePlayerControllable(id,false);
            SetTimerEx("Propustit", minut*60000, false, "d", id);
            new string[128],name[24];
            GetPlayerName(playerid,name,sizeof(name));
            format(string,sizeof(string),"Byl jsi vlozen adminem %s do admin vìzení na %d [Dùvod: %s]",name,minuty,cmdtext[pos2]);
            SendClientMessage(id,0xFF0000FF,string);
        }
        return 1;
    }
    return 0;
}
forward Propustit(playerid);
public Propustit(playerid)
{
    TogglePlayerControllable(playerid,true);
    SetPlayerPos(playerid,-1053.9696, 438.3813, 19.8165 );
    return SendClientMessage(playerid,0xFF0000FF,"Byl jsi propuštìn z admin vìzení.");
}
 
 
stock chrfind(n,h[],s=0)
{
    new l = strlen(h);
    while(s < l)
    {
        if(h[s] == n) return s;
        s++;
    }
    return -1;
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...