Problem oko snijega

Započeo Markoo00, Novembar 27, 2022, 10:28:16 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning):Problem oko snijega nastaje kada komandom /sneg upalim sneg sneg pada ali od te lokacije sto sam ukocao /sneg napravi jedan mali radiu gdje ce padat snijeg snijeg ne pada svugdje samo na tom djelu.
Deo skripte:[pawn]YCMD:sneg(playerid, params[], help)
{
   if( IsPlayerConnected( playerid ) ) {

           if( GetPlayerInterior( playerid ) != 0 || GetPlayerVirtualWorld( playerid ) != 0 ) {

             GRESKA( playerid, "Ne mozes u interijeru!" );
             return true;
         }
           if( !Snow[ playerid ] ) {

               new Float:Pos[ 3 ];
              Snow[ playerid ] = true;
            GetPlayerCameraPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
            SnowObject[ playerid ] = CreatePlayerObject( playerid, 18864, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ]-5, 0.0, 0.0, 0.0, 300.0 );
            SendInfoMessage(playerid, "Ukljucio si sneg! Ako zelis da stavis/skines kapu - /kapa.");

         }
         else if( Snow[ playerid ] ) {

             Snow[ playerid ] = false;
            DestroyPlayerObject( playerid, SnowObject[ playerid ] );
            SendInfoMessage( playerid, "Iskljucio si sneg! Ako zelis da stavis/skines kapu - /kapa." );
         }
   }
   return true;
}[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log)://
Slika/video ingame problema(obavezno ako je ingame problem): https://ibb.co/PQZDCz8


Gdje bi to trebao dodat i mozes mi reci tsta tacno trebam ubacit evo skripta u vezi toga[pawn]#include < YSI\y_commands >
#include < sscanf2 >

#define SendInfoMessage(%0,%1) \
   SendClientMessageEx(%0, -1, "{2e9cd1}[INFO] {FFFFFF} "%1)
#define GRESKA(%0,%1) \
   SendClientMessageEx(%0, -1, "{F5052D}[GRESKA] {FFFFFF} "%1)
#define OBJECT_SLOT_WINTERCAP                                                  9

new SnowObject[ MAX_PLAYERS ];
new bool:Snow[ MAX_PLAYERS ];



YCMD:sneg(playerid, params[], help)
{
   if( IsPlayerConnected( playerid ) ) {

           if( GetPlayerInterior( playerid ) != 0 || GetPlayerVirtualWorld( playerid ) != 0 ) {

             GRESKA( playerid, "Ne mozes u interijeru!" );
             return true;
         }
           if( !Snow[ playerid ] ) {

               new Float:Pos[ 3 ];
              Snow[ playerid ] = true;
            GetPlayerCameraPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
            SnowObject[ playerid ] = CreatePlayerObject( playerid, 18864, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ]-5, 0.0, 0.0, 0.0, 300.0 );
            SendInfoMessage(playerid, "Ukljucio si sneg! Ako zelis da stavis/skines kapu - /kapa.");

         }
         else if( Snow[ playerid ] ) {

             Snow[ playerid ] = false;
            if(IsValidPlayerObject(playerid, SnowObject[ playerid ])) DestroyPlayerObject( playerid, SnowObject[ playerid ] );
            SendInfoMessage( playerid, "Iskljucio si sneg! Ako zelis da stavis/skines kapu - /kapa." );
         }
   }
   return true;
}
YCMD:kapa(playerid, params[], help)
{
   if( IsPlayerConnected( playerid ) )
   {

           if( !IsPlayerAttachedObjectSlotUsed( playerid, OBJECT_SLOT_WINTERCAP ) ) {

             SetPlayerAttachedObject(playerid, OBJECT_SLOT_WINTERCAP, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
             SendInfoMessage( playerid, "Stavili ste novogodisnju kapicu na glavu.");
             return true;
         }
         else if( IsPlayerAttachedObjectSlotUsed( playerid, OBJECT_SLOT_WINTERCAP ) ) {

               RemovePlayerAttachedObject( playerid, OBJECT_SLOT_WINTERCAP );
               SendInfoMessage( playerid, "Skinuli ste novogodisnju kapicu sa glave.");
         }
   }
   return true;
}

stock SendClientMessageEx(playerid, color, const str[], {Float,_}:...) {
   static
       args,
       start,
       end,
       string[144]
   ;
   #emit LOAD.S.pri 8
   #emit STOR.pri args

   if(args > 12)
   {
      #emit ADDR.pri str
      #emit STOR.pri start

       for (end = start + (args - 12); end > start; end -= 4)
      {
           #emit LREF.pri end
           #emit PUSH.pri
      }
      #emit PUSH.S str
      #emit PUSH.C 144
      #emit PUSH.C string
      #emit PUSH.C args
      #emit SYSREQ.C format

      SendClientMessage(playerid, color, string);

      #emit LCTRL 5
      #emit SCTRL 4
      #emit RETN
   }
   return SendClientMessage(playerid, color, str);
}[/pawn]

Citat: Markoo00 poslato Novembar 27, 2022, 13:31:18 POSLE PODNE
Gdje bi to trebao dodat i mozes mi reci tsta tacno trebam ubacit evo skripta u vezi toga[pawn]#include < YSI\y_commands >
#include < sscanf2 >

#define SendInfoMessage(%0,%1) \
   SendClientMessageEx(%0, -1, "{2e9cd1}[INFO] {FFFFFF} "%1)
#define GRESKA(%0,%1) \
   SendClientMessageEx(%0, -1, "{F5052D}[GRESKA] {FFFFFF} "%1)
#define OBJECT_SLOT_WINTERCAP                                                  9

new SnowObject[ MAX_PLAYERS ];
new bool:Snow[ MAX_PLAYERS ];



YCMD:sneg(playerid, params[], help)
{
   if( IsPlayerConnected( playerid ) ) {

           if( GetPlayerInterior( playerid ) != 0 || GetPlayerVirtualWorld( playerid ) != 0 ) {

             GRESKA( playerid, "Ne mozes u interijeru!" );
             return true;
         }
           if( !Snow[ playerid ] ) {

               new Float:Pos[ 3 ];
              Snow[ playerid ] = true;
            GetPlayerCameraPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
            SnowObject[ playerid ] = CreatePlayerObject( playerid, 18864, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ]-5, 0.0, 0.0, 0.0, 300.0 );
            SendInfoMessage(playerid, "Ukljucio si sneg! Ako zelis da stavis/skines kapu - /kapa.");

         }
         else if( Snow[ playerid ] ) {

             Snow[ playerid ] = false;
            if(IsValidPlayerObject(playerid, SnowObject[ playerid ])) DestroyPlayerObject( playerid, SnowObject[ playerid ] );
            SendInfoMessage( playerid, "Iskljucio si sneg! Ako zelis da stavis/skines kapu - /kapa." );
         }
   }
   return true;
}
YCMD:kapa(playerid, params[], help)
{
   if( IsPlayerConnected( playerid ) )
   {

           if( !IsPlayerAttachedObjectSlotUsed( playerid, OBJECT_SLOT_WINTERCAP ) ) {

             SetPlayerAttachedObject(playerid, OBJECT_SLOT_WINTERCAP, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
             SendInfoMessage( playerid, "Stavili ste novogodisnju kapicu na glavu.");
             return true;
         }
         else if( IsPlayerAttachedObjectSlotUsed( playerid, OBJECT_SLOT_WINTERCAP ) ) {

               RemovePlayerAttachedObject( playerid, OBJECT_SLOT_WINTERCAP );
               SendInfoMessage( playerid, "Skinuli ste novogodisnju kapicu sa glave.");
         }
   }
   return true;
}

stock SendClientMessageEx(playerid, color, const str[], {Float,_}:...) {
   static
       args,
       start,
       end,
       string[144]
   ;
   #emit LOAD.S.pri 8
   #emit STOR.pri args

   if(args > 12)
   {
      #emit ADDR.pri str
      #emit STOR.pri start

       for (end = start + (args - 12); end > start; end -= 4)
      {
           #emit LREF.pri end
           #emit PUSH.pri
      }
      #emit PUSH.S str
      #emit PUSH.C 144
      #emit PUSH.C string
      #emit PUSH.C args
      #emit SYSREQ.C format

      SendClientMessage(playerid, color, string);

      #emit LCTRL 5
      #emit SCTRL 4
      #emit RETN
   }
   return SendClientMessage(playerid, color, str);
}[/pawn]

Reče ti čiko iznad samo da prikvačiš snijeg da prati igrača

AttachObjectToPlayer(snowobject, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);


eto ti primjer samo prilagodi sebi
2k18 - Underworld Developer
2k22 - RedRose Developer / Mapper