Problem

Započeo PetarVG, April 01, 2020, 00:15:49 PRE PODNE

prethodna tema - sledeća tema

0 članova i 7 gostiju pregledaju ovu temu.

Problem(error/warning): Imam problem kad nesto igrac ukuca izbaci svima ono kako je po deafulta kako do popraviti??
Dio skripte: [ pawn ]//[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]//[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): //

Citat: PetarVG poslato April 01, 2020, 00:15:49 PRE PODNE
Problem(error/warning): Imam problem kad nesto igrac ukuca izbaci svima ono kako je po deafulta kako do popraviti??
Dio skripte: [ pawn ]//[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]//[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): //
OnPlayerText.....

[pawn]public OnPlayerText(playerid, text[]) {
   if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Morate biti ulogovani!");
   if(realchat) {
      new tekst1 = strlen(text), string[256];
      format(string, sizeof(string), "%s kaze: %s", GetName(playerid), text);
      ProxDetector(20.0, playerid, string, BELA2,BELA2,BELA2,BELA2,BELA2);
      return 0;
   }
   return 1;
}[/pawn]

Naravno treba ti varijabla realchat, GetName i ProxDetector funkcija.
Nisam pro, samo pokušavam da pomognem :)




Citat: ShomyTKD poslato April 01, 2020, 02:46:52 PRE PODNE
[pawn]public OnPlayerText(playerid, text[]) {
   if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Morate biti ulogovani!");
   if(realchat) {
      new tekst1 = strlen(text), string[256];
      format(string, sizeof(string), "%s kaze: %s", GetName(playerid), text);
      ProxDetector(20.0, playerid, string, BELA2,BELA2,BELA2,BELA2,BELA2);
      return 0;
   }
   return 1;
}[/pawn]
Imam ovaj error
[pawn]symbol is assigned a value that is never used: "tekst1"[/pawn]

Naravno treba ti varijabla realchat, GetName i ProxDetector funkcija.

Citat: ShomyTKD poslato April 01, 2020, 02:46:52 PRE PODNE
[pawn]public OnPlayerText(playerid, text[]) {
   if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Morate biti ulogovani!");
   if(realchat) {
      new tekst1 = strlen(text), string[256];
      format(string, sizeof(string), "%s kaze: %s", GetName(playerid), text);
      ProxDetector(20.0, playerid, string, BELA2,BELA2,BELA2,BELA2,BELA2);
      return 0;
   }
   return 1;
}[/pawn]
Naravno treba ti varijabla realchat, GetName i ProxDetector funkcija.



[pawn]
public OnPlayerText(playerid, text[])
{
   ProxDetector(playerid, 15.0, 0xFFFFFFAA, "(%d) %s: %s", playerid, GetName(playerid), text);
   return 0;
}

stock ProxDetector(playerid, Float:max_range, color, const string[], GLOBAL_TAG_TYPES:...)
{
   new
      Float:pos_x,
      Float:pos_y,
      Float:pos_z,
      Float:range,
      Float:range_ratio,
      Float:range_with_ratio,
      clr_r, clr_g, clr_b,
      Float:color_r, Float:color_g, Float:color_b;

   if (!GetPlayerPos(playerid, pos_x, pos_y, pos_z))
   {
      return 0;
   }

   color_r = float(color >> 24 & 0xFF);
   color_g = float(color >> 16 & 0xFF);
   color_b = float(color >> 8 & 0xFF);
   range_with_ratio = max_range * 1.6;

   if(numargs() > 4)
   {
      new out[145];
      va_format(out, 145, string, ___(4));

      foreach (new i : Player)
      {
         if (!IsPlayerStreamedIn(i, playerid))
         {
            continue;
         }

         range = GetPlayerDistanceFromPoint(i, pos_x, pos_y, pos_z);
         if (range > max_range)
         {
            continue;
         }

         range_ratio = (range_with_ratio - range) / range_with_ratio;
         clr_r = floatround(range_ratio * color_r);
         clr_g = floatround(range_ratio * color_g);
         clr_b = floatround(range_ratio * color_b);

         SendClientMessage(i, (color & 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24), out);
      }
      SendClientMessage(playerid, color, out);
   }
   else
   {
      foreach (new i : Player)
      {
         if (!IsPlayerStreamedIn(i, playerid))
         {
            continue;
         }

         range = GetPlayerDistanceFromPoint(i, pos_x, pos_y, pos_z);
         if (range > max_range)
         {
            continue;
         }

         range_ratio = (range_with_ratio - range) / range_with_ratio;
         clr_r = floatround(range_ratio * color_r);
         clr_g = floatround(range_ratio * color_g);
         clr_b = floatround(range_ratio * color_b);

         SendClientMessage(i, (color & 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24), string);
      }
      SendClientMessage(playerid, color, string);
   }
   return 1;
}[/pawn]

?

Citat: Emmett poslato April 02, 2020, 01:16:05 PRE PODNE


[pawn]
public OnPlayerText(playerid, text[])
{
   ProxDetector(playerid, 15.0, 0xFFFFFFAA, "(%d) %s: %s", playerid, GetName(playerid), text);
   return 0;
}

stock ProxDetector(playerid, Float:max_range, color, const string[], GLOBAL_TAG_TYPES:...)
{
   new
      Float:pos_x,
      Float:pos_y,
      Float:pos_z,
      Float:range,
      Float:range_ratio,
      Float:range_with_ratio,
      clr_r, clr_g, clr_b,
      Float:color_r, Float:color_g, Float:color_b;

   if (!GetPlayerPos(playerid, pos_x, pos_y, pos_z))
   {
      return 0;
   }

   color_r = float(color >> 24 & 0xFF);
   color_g = float(color >> 16 & 0xFF);
   color_b = float(color >> 8 & 0xFF);
   range_with_ratio = max_range * 1.6;

   if(numargs() > 4)
   {
      new out[145];
      va_format(out, 145, string, ___(4));

      foreach (new i : Player)
      {
         if (!IsPlayerStreamedIn(i, playerid))
         {
            continue;
         }

         range = GetPlayerDistanceFromPoint(i, pos_x, pos_y, pos_z);
         if (range > max_range)
         {
            continue;
         }

         range_ratio = (range_with_ratio - range) / range_with_ratio;
         clr_r = floatround(range_ratio * color_r);
         clr_g = floatround(range_ratio * color_g);
         clr_b = floatround(range_ratio * color_b);

         SendClientMessage(i, (color & 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24), out);
      }
      SendClientMessage(playerid, color, out);
   }
   else
   {
      foreach (new i : Player)
      {
         if (!IsPlayerStreamedIn(i, playerid))
         {
            continue;
         }

         range = GetPlayerDistanceFromPoint(i, pos_x, pos_y, pos_z);
         if (range > max_range)
         {
            continue;
         }

         range_ratio = (range_with_ratio - range) / range_with_ratio;
         clr_r = floatround(range_ratio * color_r);
         clr_g = floatround(range_ratio * color_g);
         clr_b = floatround(range_ratio * color_b);

         SendClientMessage(i, (color & 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24), string);
      }
      SendClientMessage(playerid, color, string);
   }
   return 1;
}[/pawn]

?
Imam prox detector ako ti pitas


Ne imam ovaj error
[pawn]symbol is assigned a value that is never used: "tekst1"[/pawn]


new string[256];
umesto
new tekst1 = strlen(text), string[256];

Citat: PetarVG poslato April 02, 2020, 09:52:38 PRE PODNE
Ne imam ovaj error
[pawn]symbol is assigned a value that is never used: "tekst1"[/pawn]

To nije error, već samo warning, a skripta radi i kada imaš warning. Samo odradi ovo što ti je Vedran rekao i trebalo bi da radi :)
Nisam pro, samo pokušavam da pomognem :)