Pomoc oko komande

Započeo Mujkic, Novembar 18, 2021, 15:58:24 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Cao, prijatelj mi je napravio komandu /portaj, da portas igraca do neke lokacije preko admin dialoga, eh kada portam nekog npr /portaj 5 (ID) ne porta tog igraca koji je id 5 vec mene... Pomoc ako moze i evo komanda :)

[pawn]CMD:portaj( playerid, params[] ) {
    new ID;
      if( PlayerInfo[ playerid ][ xAdmin ] >= 1 || PlayerInfo[ playerid ][ xHelper ] >= 1 ) {
        if( !AdminDuty[ playerid ] ) return GRESKA( playerid, "Da bi koristili ovu komandu morate biti Admin na duznosti." );
        if( sscanf( params, "d", ID ) ) return KORISCENJE( playerid, "/portigraca [ ID/Deo imena ]");
        if( !IsPlayerConnected( ID ) ) return GRESKA( playerid, "Nepravilni ID");
        if(  PlayerInfo[ ID ][ xAdmin ] >= 1 || PlayerInfo[ ID ][ xHelper ] >= 1 ) return GRESKA(playerid, "Ne mozete portati clanove Staff Team-a!");
        if( PlayerInfo[ playerid ][ xAdmin ] < 7 ) {
            if( UzeoOpremu[ ID ] == true ) return GRESKA( playerid, "Igrac radi posao, ne mozete ga portati!" );
            if( PlayerInfo[ ID ][ xWanted ] != 0 ) return GRESKA( playerid, "Igrac ima wanted level, ne mozete ga portati" );
            if( PlayerInfo[ ID ][ xZatvor ] != 0 ) return GRESKA( playerid, "Igrac je u zatvoru, ne mozete ga portati!" );
        }
        strdel( DialogStrgEx, 0, sizeof( DialogStrgEx ) );
        for( new i = 0; i < MAX_APORTS; i++ ) {
            if( aportInfo[ i ][ aportCreated ] == 1 ) {
                format( DialogStrgEx, sizeof( DialogStrgEx ), "%s%s\n", DialogStrgEx, aportInfo[ i ][ aportName ] );
            }
        }
        SPD( playerid, dialog_SELECTAPORT, DSL, D_NASLOV, DialogStrgEx, D_ODABERI, D_ODUSTANI );
    }
    else return GRESKA( playerid, "Niste u mogucnosti koristiti ovu komandu." );
    return true;
}[/pawn]
:)

pronadji u skripti pod OnDialogResponse ovo dialog_SELECTAPORT
Poslednja Izmena: Novembar 18, 2021, 16:01:48 POSLE PODNE od not

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Citat: not poslato Novembar 18, 2021, 15:59:50 POSLE PODNE
pronadji u skripti pod OnDialogResponse ovo dialog_SELECTAPORT

[pawn]else if( dialogid == dialog_SELECTAPORT ) {
       if( !response ) return 1;
      if( response ) {
            new tmpcar = GetPlayerVehicleID( playerid );
         if( GetPlayerState( playerid ) == 2 ) {
             Mujkic_SetVehiclePos( tmpcar, aportInfo[ listitem ][ aportPos ][ 0 ], aportInfo[ listitem ][ aportPos ][ 1 ], aportInfo[ listitem ][ aportPos ][ 2 ] );
          }
         else {
            Mujkic_SetPlayerPos( playerid, aportInfo[ listitem ][ aportPos ][ 0 ], aportInfo[ listitem ][ aportPos ][ 1 ], aportInfo[ listitem ][ aportPos ][ 2 ] );
         }
         SetPlayerInterior( playerid, 0 );
         SetPlayerVirtualWorld( playerid, 0 );
         Info( playerid, "Uspesno ste se teleportovali do lokacije '%s'.", aportInfo[ listitem ][ aportName ] );
      }
   }[/pawn]

eto, to je aport za admine ali preko tog zelim da se mogu igraci portat :D
:)

Treba ti varijabla koja cuva id igraca kojeg portas.
new idigraca[MAX_PLAYERS];
i onda u komandi na kraju dodaj
idigraca[playerid] = ID;

pod ondialogresponse tamo stavi umjesto SetPlayerPos(playerid,....) SetPlayerPos(idigraca[playerid],.......) isto tako i za vozilo tmpcar = GetPlayerVehicleID(idigraca[playerid]);

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Citat: not poslato Novembar 18, 2021, 16:05:01 POSLE PODNE
Treba ti varijabla koja cuva id igraca kojeg portas.
new idigraca[MAX_PLAYERS];
i onda u komandi na kraju dodaj
idigraca[playerid] = ID;

pod ondialogresponse tamo stavi umjesto SetPlayerPos(playerid,....) SetPlayerPos(idigraca[playerid],.......) isto tako i za vozilo tmpcar = GetPlayerVehicleID(idigraca[playerid]);

Ja sam malo smotan za to a i nisam skripter, pa eto ako mozes ti da mi popises to i posaljes imas komandu et :D
:)

ovde ce ti se sve zbugati ako ovako stavis. Isti dialog koristis i za port sebe i za port igraca.
dodaj novi dialog tipa dialog_SELECTAPORT2

[pawn]else if( dialogid == dialog_SELECTAPORT2 ) {
       if( !response ) return 1;
      if( response ) {
            new tmpcar = GetPlayerVehicleID( idigraca[playerid] );
         if( GetPlayerState( playerid ) == 2 ) {
             Mujkic_SetVehiclePos( tmpcar, aportInfo[ listitem ][ aportPos ][ 0 ], aportInfo[ listitem ][ aportPos ][ 1 ], aportInfo[ listitem ][ aportPos ][ 2 ] );
          }
         else {
            Mujkic_SetPlayerPos( idigraca[playerid], aportInfo[ listitem ][ aportPos ][ 0 ], aportInfo[ listitem ][ aportPos ][ 1 ], aportInfo[ listitem ][ aportPos ][ 2 ] );
         }
         SetPlayerInterior( idigraca[playerid], 0 );
         SetPlayerVirtualWorld( idigraca[playerid], 0 );
         Info( playerid, "Uspesno ste teleportovali %s do lokacije `%s`.", GetName(idigraca[playerid]), aportInfo[ listitem ][ aportName ] );
Info(idigraca[playerid],"Admin %s vas je teleportovao do lokacije %s",GetName(playerid), aportInfo[ listitem ][ aportName ] );
idigraca[playerid] = 0;
      }
   }[/pawn]

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

[pawn]CMD:portaj( playerid, params[] ) {
    new ID;
      if( PlayerInfo[ playerid ][ xAdmin ] >= 1 || PlayerInfo[ playerid ][ xHelper ] >= 1 ) {
        if( !AdminDuty[ playerid ] ) return GRESKA( playerid, "Da bi koristili ovu komandu morate biti Admin na duznosti." );
        if( sscanf( params, "d", ID ) ) return KORISCENJE( playerid, "/portigraca [ ID/Deo imena ]");
        if( !IsPlayerConnected( ID ) ) return GRESKA( playerid, "Nepravilni ID");
        if(  PlayerInfo[ ID ][ xAdmin ] >= 1 || PlayerInfo[ ID ][ xHelper ] >= 1 ) return GRESKA(playerid, "Ne mozete portati clanove Staff Team-a!");
        if( PlayerInfo[ playerid ][ xAdmin ] < 7 ) {
            if( UzeoOpremu[ ID ] == true ) return GRESKA( playerid, "Igrac radi posao, ne mozete ga portati!" );
            if( PlayerInfo[ ID ][ xWanted ] != 0 ) return GRESKA( playerid, "Igrac ima wanted level, ne mozete ga portati" );
            if( PlayerInfo[ ID ][ xZatvor ] != 0 ) return GRESKA( playerid, "Igrac je u zatvoru, ne mozete ga portati!" );
        }
idigraca[ playerid ] = id;
        strdel( DialogStrgEx, 0, sizeof( DialogStrgEx ) );
        for( new i = 0; i < MAX_APORTS; i++ ) {
            if( aportInfo[ i ][ aportCreated ] == 1 ) {
                format( DialogStrgEx, sizeof( DialogStrgEx ), "%s%s\n", DialogStrgEx, aportInfo[ i ][ aportName ] );
            }
        }
        SPD( playerid, dialog_SELECTAPORT, DSL, D_NASLOV, DialogStrgEx, D_ODABERI, D_ODUSTANI );
    }
    else return GRESKA( playerid, "Niste u mogucnosti koristiti ovu komandu." );
    return true;
}[/pawn]

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Citat: not poslato Novembar 18, 2021, 16:08:37 POSLE PODNE
ovde ce ti se sve zbugati ako ovako stavis. Isti dialog koristis i za port sebe i za port igraca.
dodaj novi dialog tipa dialog_SELECTAPORT2

[pawn]else if( dialogid == dialog_SELECTAPORT2 ) {
       if( !response ) return 1;
      if( response ) {
            new tmpcar = GetPlayerVehicleID( idigraca[playerid] );
         if( GetPlayerState( playerid ) == 2 ) {
             Mujkic_SetVehiclePos( tmpcar, aportInfo[ listitem ][ aportPos ][ 0 ], aportInfo[ listitem ][ aportPos ][ 1 ], aportInfo[ listitem ][ aportPos ][ 2 ] );
          }
         else {
            Mujkic_SetPlayerPos( idigraca[playerid], aportInfo[ listitem ][ aportPos ][ 0 ], aportInfo[ listitem ][ aportPos ][ 1 ], aportInfo[ listitem ][ aportPos ][ 2 ] );
         }
         SetPlayerInterior( idigraca[playerid], 0 );
         SetPlayerVirtualWorld( idigraca[playerid], 0 );
         Info( playerid, "Uspesno ste teleportovali %s do lokacije `%s`.", GetName(idigraca[playerid]), aportInfo[ listitem ][ aportName ] );
Info(idigraca[playerid],"Admin %s vas je teleportovao do lokacije %s",GetName(playerid), aportInfo[ listitem ][ aportName ] );
idigraca[playerid] = 0;
      }
   }[/pawn]


[pawn]C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47838) : error 017: undefined symbol "dialog_SELECTAPORT2"
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47841) : error 017: undefined symbol "idigraca"
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47841) : warning 215: expression has no effect
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47841) : error 001: expected token: ";", but found "]"
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47841) : error 029: invalid expression, assumed zero
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47841) : fatal error 107: too many error messages on one line[/pawn]

defineo sam "dialog_SELECTAPORT2" al idalje imaju ostali erori
:)

pronadji u skripti
dialog_SELECTAPORT kod ostalih dialoga i dodaj tu i dialog_SELECTAPORT2,
nadji gdje su ti ostali newovi i dodaj new idigraca[ MAX_PLAYES ];
druze to su osnove....

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Citat: not poslato Novembar 18, 2021, 16:39:27 POSLE PODNE
pronadji u skripti
dialog_SELECTAPORT kod ostalih dialoga i dodaj tu i dialog_SELECTAPORT2,
nadji gdje su ti ostali newovi i dodaj new idigraca[ MAX_PLAYES ];
druze to su osnove....


[pawn]C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(42784) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(46113) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47092) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47842) : error 033: array must be indexed (variable "idigraca")
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47851) : error 017: undefined symbol "GetName"
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47852) : error 017: undefined symbol "GetName"
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(48272) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(48894) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(49299) : warning 219: local variable "idigraca" shadows a variable at a preceding level[/pawn]
:)

Citat: Vatrenii poslato Novembar 18, 2021, 16:51:40 POSLE PODNE

[pawn]C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(42784) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(46113) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47092) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47842) : error 033: array must be indexed (variable "idigraca")
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47851) : error 017: undefined symbol "GetName"
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47852) : error 017: undefined symbol "GetName"
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(48272) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(48894) : warning 219: local variable "idigraca" shadows a variable at a preceding level
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(49299) : warning 219: local variable "idigraca" shadows a variable at a preceding level[/pawn]

Fixao sam par erora, ostalo je jos ovo. "idigraca" je vec postojalo prije u skripti vec definisano i koristeno pa sam ja samo dodao jos 1 a "idigracaa"

[pawn]C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47842) : error 033: array must be indexed (variable "idigracaa")
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47851) : error 017: undefined symbol "GetName"
C:\Users\adinm\Desktop\Balkan Infinity RolePlay v1.1\gamemodes\BInfinity.pwn(47852) : error 017: undefined symbol "GetName"
Pawn compiler 3.10.4           Copyright (c) 1997-2006, ITB CompuPhase[/pawn]
:)

Zasto hocete sve na gotovo da vam neko da celu komandu ,bozee, a vidi se da ti ni prijatelj ne zna skritptati