Sunday - 09. 08. 2026 •  Ucitavanje...
Link #1 Link #2 Link #3 Link #4 Link #5

!!

Registruj se i otključaj pun sadržaj

Kao gost imaš ograničen pristup forumu.
Registracijom dobijaš pristup svim temama, možeš pisati poruke, učestvovati u diskusijama i biti dio naše zajednice.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - teynr

Pages: [1]
1
Filterscipts | Includes | Plugins / Re: Winter Update
« on: November 28, 2024, 02:56:47 PM »
You are not allowed to view links. Register or Login
ajmo nesto unikatnijee ovo svi i napamet znamo vec  ;D ;D
Da bar ovo znamo...

2
Filterscipts | Includes | Plugins / Re: Winter Update
« on: November 26, 2024, 09:21:06 PM »
You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login
"nece napraviti neku DRASTICNU razliku", U PRAVU SI


OnPlayerUpdate

This callback is called, on average, 30 times per second, per player; only use it when you know what it's meant for (or more importantly what it's NOT meant for). The frequency with which this callback is called for each player varies, depending on what the player is doing. Driving or shooting will trigger a lot more updates than idling.


Da, nece napraviti bog zna koliko drasticnu razliku, radite SAMP server, ne pravite sistem za NASU....
Nece, nece, u pravu si

3
Filterscipts | Includes | Plugins / Re: Winter Update
« on: November 26, 2024, 09:05:29 PM »
You are not allowed to view links. Register or Login
Okej par stvari koje mi nemaju smisla :

Promenljive za Jelke :

Code: You are not allowed to view links. Register or Login
Text3D:label[sizeof(JelkaInfo)], NapravljenaJelka;
Nemaju potrebu da postoje xD

Label nigde konkretno ne koristis, ne brises, ne pomeras tako da nema neke potrebe da ga cuvas u promenljivu

Sto se objekta tice, imalo bi smisla da si koristi NapravljenaJelka[MAX_JELKI], tako da taj kreirani objekat cuvas u promenljivu, posto je globalna promenljiva, gubice staru vrednost i ostace samo ona koja je zadnja ucitana ili kreirana. U prevodu jedini nacin da obrises objekat je da obrises fajl. Pritom ovako kako je napravljeno ne mozes da napravis da funkcionise brisanje preko komande kako treba, zato sto gubis vrednost objekta.

Cuvanje je takodje problem, zato sto ce dobiti ID objekta koji si kreirao.

Pravilnije bi bilo da se odradi ovako :

Code: You are not allowed to view links. Register or Login
stock getNextTreeID(const len) { //uzima prvi slobodan ID za kreiranje jelke
    new id = (-1);
    for( new loop = ( 0 ), provjera = ( -1 ), Data_[ 64 ] = "\0"; loop != len; ++ loop ) {
       provjera = ( loop+1 );
       format( Data_, ( sizeof Data_ ), JelkeFile, provjera );
       if(!fexist(Data_)) {
          id = ( provjera );
          break; } }
    return ( id );
}

YCMD:kreirajjelku( playerid, params[], help ) {
    if(!IsPlayerAdmin(playerid)) return SendClientMessage( playerid, -1, "{0070D0}VaporG - {FFFFFF}Morate biti ulogovani na rcon." ); {
        new Float:X,Float:Y,Float:Z,Float:A;
        GetPlayerPos(playerid, X,Y,Z);
        GetPlayerFacingAngle(playerid, A);

        new id = getNextTreeID(MAX_JELKI); //uzimamo id
        if(id == -1) return SendClientMessage(playerid, -1, "Imas max broj kreiranih jelki!"); //ukoliko vrati -1 znaci da je svaki fajl zauzet

        NapravljenaJelka[id] = CreateObject(19076, X-1,Y,Z-1.5, 0.0, 0.0, A, 300.0); //kreiramo objekat ali stavljamo da bude array(niz), tako da mozemo objekat da koristimo
        label[id] = Create3DTextLabel("{0070D0}[ VaporG JELKA ]\n{0070D0}- {FFFFFF}SRECNA NOVA 2019. GODINA {0070D0}-", 0xFFFFFFFF, X,Y,Z+1, 10.0, 0, 0); //kreiramo label na osnovu ID-a
        JelkaInfo[ id ][ jX ] = X; //postavljamo promenljive
        JelkaInfo[ id ][ jY ] = Y;
        JelkaInfo[ id ][ jZ ] = Z-1.5;
        JelkaInfo[ id ][ jA ] = A;
        save_xmastree( id ); //cuvamo drvo u prvi slobodan ID
    }
    return 1;
}

Uglavnom, cuvamo ID kako treba, tako da ce krenuti od 1 pa nadalje, takodje stavljamo NapravljenaJelka da bude niz, koji je vezan za ID drveta ( fajl )

Sada ce ti cuvati jelka_1.ini pa jelka_2.ini pa jelka_3.ini itd do 500...

Sada mozes da radis i brisanje kako treba, ucitavanje itd...

Dalje...

Ovo :

Code: You are not allowed to view links. Register or Login
task dah_system[2500]() {
    for( new i = 0; i < MAX_PLAYERS; i++ ) {
        if( IsPlayerConnected( i )) {
            if( GetPlayerInterior( i ) == 0 && GetPlayerVirtualWorld( i ) == 0 ) {
                RemovePlayerAttachedObject( i, OBJECT_SLOT_FREE );
                PlayerEffect[ i ] = SetPlayerAttachedObject( i, OBJECT_SLOT_FREE, 18696, 2,0.0,0.1,-0.2,-25.5000,0.0,0.0,0.10,0.3,0.15);
}
}
}
return 1;
}

Tutnuti u :

Code: You are not allowed to view links. Register or Login
ptask dah_system[2500](i) {
   
    if( IsPlayerConnected( i )) {
        if( GetPlayerInterior( i ) == 0 && GetPlayerVirtualWorld( i ) == 0 ) {
            RemovePlayerAttachedObject( i, OBJECT_SLOT_FREE );
            PlayerEffect[ i ] = SetPlayerAttachedObject( i, OBJECT_SLOT_FREE, 18696, 2,0.0,0.1,-0.2,-25.5000,0.0,0.0,0.10,0.3,0.15);
}
}
return 1;
}

Kada vec postoji xDD

Za jelke umesto CreateObject koristiti dinamicne objekta, takodje bilo bi dobro dodati EditObject ( da ga moze pomeriti pri kreiranju )

Ovo :

Code: You are not allowed to view links. Register or Login
public OnPlayerUpdate( playerid ) {
    if( Snow[ playerid ] ) {
  if( GetPlayerInterior( playerid ) == 0 && GetPlayerVirtualWorld( playerid ) == 0 ) {
new Float:Pos[ 3 ];
        GetPlayerCameraPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
        MovePlayerObject( playerid, SnowObject[ playerid ], Pos[ 0 ], Pos[ 1 ], Pos[ 2 ]-2.5, 4000.0 );
  }
}
return true;
}

Takodje moze u ptask mada manje vise isti kurac, nece napraviti neku DRASTICNU razliku

Uglavnom ima par stvari koje treba doraditi, ali ako si ti sve pravio, nije lose. Poraditi na ucitavanju i cuvanju ovih jelki. Ne znam da li si testao da ucitas u nekom malo vecem modu ovu FS? Po ovome kako jeste jelke ne bi trebalo da ucitavanju kako treba

Sve u svemu, pohvale za trud

Ovo :

Code: You are not allowed to view links. Register or Login
public OnPlayerUpdate( playerid ) {
    if( Snow[ playerid ] ) {
  if( GetPlayerInterior( playerid ) == 0 && GetPlayerVirtualWorld( playerid ) == 0 ) {
new Float:Pos[ 3 ];
        GetPlayerCameraPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
        MovePlayerObject( playerid, SnowObject[ playerid ], Pos[ 0 ], Pos[ 1 ], Pos[ 2 ]-2.5, 4000.0 );
  }
}
return true;
}


"nece napraviti neku DRASTICNU razliku", U PRAVU SI


OnPlayerUpdate

This callback is called, on average, 30 times per second, per player; only use it when you know what it's meant for (or more importantly what it's NOT meant for). The frequency with which this callback is called for each player varies, depending on what the player is doing. Driving or shooting will trigger a lot more updates than idling.

4
Filterscipts | Includes | Plugins / Re: Winter Update
« on: November 26, 2024, 01:11:43 PM »
Code: You are not allowed to view links. Register or Login
task dah_system[2500]() {
    for( new i = 0; i < MAX_PLAYERS; i++ ) {
        if( IsPlayerConnected( i )) {
            if( GetPlayerInterior( i ) == 0 && GetPlayerVirtualWorld( i ) == 0 ) {
                RemovePlayerAttachedObject( i, OBJECT_SLOT_FREE );
                PlayerEffect[ i ] = SetPlayerAttachedObject( i, OBJECT_SLOT_FREE, 18696, 2,0.0,0.1,-0.2,-25.5000,0.0,0.0,0.10,0.3,0.15);
}
}
}
return 1;
}

 :-\  :-X :-[

Pages: [1]

Vrati se na pocetak
SMF 2.0.19 | SMF © 2021, Simple Machines
Page created in 0.085 seconds with 17 queries.
ZBS © 2011 - 2024, Zapadni Balkan SA:MP
Weiss X 10.2 © 2014, Jade Works Studio
Footer background belongs to GTA Forums
SimplePortal 2.3.7 © 2008-2026, SimplePortal