Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: skriptergodine poslato Avgust 19, 2021, 21:30:51 POSLE PODNE

Naslov: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 19, 2021, 21:30:51 POSLE PODNE
Detaljan opis problema:Ja kad upisem chat buble u skripti imate dole kako sam ja to ispisao izbacuje error C: \ Users \ pogan \ OneDrive \ Desktop \ Server \ Skripta-Mod \ gamemodes \ pcrp.pvn (209): greška 010: nevažeća funkcija ili deklaracija


Dio skripte:

else if( PlayerInfo [ playerid ][pVIP] == 1)
                {
                    SetPlayerChatBubble( i, "[BRONZE VIP]", 0x33CCFFAA, 35.0, 10000);
                }
Naslov: Odg: SetChatBubble Pomocc
Poruka od: Ognjenn poslato Avgust 19, 2021, 21:38:27 POSLE PODNE
Sta ti je to i kod SetPlayerChatBubble(I, ...)
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 19, 2021, 21:50:20 POSLE PODNE
To je kad ti pise iznad glave tipa BOT ili MUDJAOVDE to ti je ChatBubble
Naslov: Odg: SetChatBubble Pomocc
Poruka od: _tayloR poslato Avgust 19, 2021, 22:05:04 POSLE PODNE
Na kojoj ti liniji tacno izbacuje error

I nisam siguran da zelis provjeriti playerida i za ' i ' dati ChatBubble

Pokusaj promjeniti to i sa playerid
Naslov: Odg: SetChatBubble Pomocc
Poruka od: Fergosonn poslato Avgust 19, 2021, 23:36:24 POSLE PODNE
Citat: skriptergodine poslato Avgust 19, 2021, 21:30:51 POSLE PODNE
Detaljan opis problema:Ja kad upisem chat buble u skripti imate dole kako sam ja to ispisao izbacuje error C: \ Users \ pogan \ OneDrive \ Desktop \ Server \ Skripta-Mod \ gamemodes \ pcrp.pvn (209): greška 010: nevažeća funkcija ili deklaracija


Dio skripte:

else if( PlayerInfo [ playerid ][pVIP] == 1)
                {
                    SetPlayerChatBubble( i, "[BRONZE VIP]", 0x33CCFFAA, 35.0, 10000);
                }
Proveravas dali je vip playerid ev ti ispravno
[pawn]else if( PlayerInfo [pVIP] == 1)// umesto i si stavio playerid
                {
                    SetPlayerChatBubble( i, "[BRONZE VIP]", 0x33CCFFAA, 35.0, 10000);
                }[/pawn]Mislim da je do ovoga
Naslov: Odg: SetChatBubble Pomocc
Poruka od: №Grella poslato Avgust 20, 2021, 00:37:48 PRE PODNE
[pawn]else if( PlayerInfo [ playerid ][pVIP] == 1)
                {
                    SetPlayerChatBubble( i, "[BRONZE VIP]", 0x33CCFFAA, 35.0, 10000);
                }[/pawn]

Provjera ti vrsi posao za igraca, a buuble seta buubble svima a nije definisano da se kroz foreach protjera radnja za sve igrace koji posjeduju enum pvip na 1.
Tako da trebao bi samo umjesto dole i staviti samo playerid jer i ti vrsi provjeru za sve igrace koji imaju taj enum na 1, a playerid vrsi skripta za pojedinacnog igraca


Nadam se da sam pomogao

Lijep Pozrav
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 08:29:30 PRE PODNE
Aha dobro ali ja neam plugin foreach ddacu ga pa cu probati
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 11:38:41 PRE PODNE
idalje ima KRVAVI EROR DEKLARACIJA ILI FUNKCIJA NIJE ISPRAVNA
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(193) : error 010: invalid function or declaration
Pawn compiler 3.10.4           Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Naslov: Odg: SetChatBubble Pomocc
Poruka od: _tayloR poslato Avgust 20, 2021, 12:03:24 POSLE PODNE
Citat: skriptergodine poslato Avgust 20, 2021, 11:38:41 PRE PODNE
idalje ima KRVAVI EROR DEKLARACIJA ILI FUNKCIJA NIJE ISPRAVNA
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(193) : error 010: invalid function or declaration
Pawn compiler 3.10.4           Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
daj liniju
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 13:02:35 POSLE PODNE
312 red ilitiga tvoja linija
Naslov: Odg: SetChatBubble Pomocc
Poruka od: Fergosonn poslato Avgust 20, 2021, 14:20:10 POSLE PODNE
Citat: skriptergodine poslato Avgust 20, 2021, 13:02:35 POSLE PODNE
312 red ilitiga tvoja linija
Daj kod de ti daje error niko nemoze da zna sta si ti pisao
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 14:56:14 POSLE PODNE
Prvi je tamo kad sam kacio sam nalepio
Naslov: Odg: SetChatBubble Pomocc
Poruka od: №Grella poslato Avgust 20, 2021, 15:09:35 POSLE PODNE
Gledaj da li ti je naprimjer preko forwarda napravljena funkcija i posle  for(new i = 0; i < MAX_PLAYERS; i++)  da bi proslo kroz sve igrace i onda taj isti tajmer je preko settimer pozvan u ongamemodeinit na odredjeno sekundi da se refresha

Posalji nam cijelu funkciju ukoliko je odvojena ili posalji nam ispred tih linija kodove bar 10 linija ispred gdje se moze vidjeti kako zapocinje posao i postupak
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 15:19:27 POSLE PODNE
Brt ja imam samo Te ChatBuble neam te forward funkcije i to for new i Max players
Naslov: Odg: SetChatBubble Pomocc
Poruka od: Goku ^ poslato Avgust 20, 2021, 15:26:02 POSLE PODNE
Citat: skriptergodine poslato Avgust 20, 2021, 15:19:27 POSLE PODNE
Brt ja imam samo Te ChatBuble neam te forward funkcije i to for new i Max players
Aj probaj ovako primer.
[pawn]
if(PlayerInfo[pVip] == 1)
{
         SetPlayerChatBubble( i, "[BRONZE VIP]", 0x33CCFFAA, 35.0, 10000);
}
if(PlayerInfo[pVip] == 2)
{
         SetPlayerChatBubble( i, "[SILVER VIP]", 0x33CCFFAA, 35.0, 10000);
}
[/pawn]
Naslov: Odg: SetChatBubble Pomocc
Poruka od: Fergosonn poslato Avgust 20, 2021, 15:39:33 POSLE PODNE
[pawn]task ChatDouble[3000]()
{
   foreach(Player,i)
   {
      if(PlayerInfo[pVip] == 1)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 1 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 2)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 2 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 3)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 3 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 4)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 4 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 5)
      {
         SetPlayerChatBubble(i, "[ Master Donator ]", 0xAA3333AA, 30.0,60000);
      }
   }
   return 1;
}[/pawn]
Probaj ovo
Naslov: Odg: SetChatBubble Pomocc
Poruka od: Goku ^ poslato Avgust 20, 2021, 15:45:58 POSLE PODNE
Citat: Fergosonn poslato Avgust 20, 2021, 15:39:33 POSLE PODNE
[pawn]task ChatDouble[3000]()
{
   foreach(Player,i)
   {
      if(PlayerInfo[pVip] == 1)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 1 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 2)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 2 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 3)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 3 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 4)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 4 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 5)
      {
         SetPlayerChatBubble(i, "[ Master Donator ]", 0xAA3333AA, 30.0,60000);
      }
   }
   return 1;
}[/pawn]
Probaj ovo
To sam mu i ja reko bez ELSE da uradi zato mu izbacuje gresku
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 16:07:08 POSLE PODNE
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1011) : error 010: invalid function or declaration
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1013) : error 010: invalid function or declaration
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1015) : error 010: invalid function or declaration
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1019) : error 010: invalid function or declaration
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1023) : error 010: invalid function or declaration
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1027) : error 010: invalid function or declaration
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1031) : error 010: invalid function or declaration
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1036) : error 010: invalid function or declaration
Pawn compiler 3.10.4           Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
IDALJE IZBACUJE JEBENU DEKLARACAIJU JEBEM TI SKRIPTU I FAMILIJU ONOME KO JE NAPRAVI
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 16:08:45 POSLE PODNE
a kad probam preko Forward-a i Publica izbacuje error nedefinisano I a upisao for(new i = 0; i < MAX_PLAYERS; i++); ali kad upisem foreach(Player, i) izbacuje errore neke YSI kurcevi palcevi itd
Naslov: Odg: SetChatBubble Pomocc
Poruka od: Fergosonn poslato Avgust 20, 2021, 16:10:46 POSLE PODNE
Citat: skriptergodine poslato Avgust 20, 2021, 16:08:45 POSLE PODNE
a kad probam preko Forward-a i Publica izbacuje error nedefinisano I a upisao for(new i = 0; i < MAX_PLAYERS; i++); ali kad upisem foreach(Player, i) izbacuje errore neke YSI kurcevi palcevi itd
Daj ceo kod od pocetka do kraja i erore
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 16:13:37 POSLE PODNE
forward ChatBubble();
public ChatBubble()
{
   new i = 0; i < MAX_PLAYERS; i++

   foreach(Player,i)
   {
      if(PlayerInfo[pVip] == 1)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 1 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 2)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 2 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 3)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 3 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 4)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 4 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 5)
      {
         SetPlayerChatBubble(i, "[ Master Donator ]", 0xAA3333AA, 30.0,60000);
      }
   }
   return 1;
}


C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1014) : warning 215: expression has no effect
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1016) : error 001: expected token: ";", but found "for"
C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1016) : warning 219: local variable "i" shadows a variable at a preceding level
Pawn compiler 3.10.4           Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 16:15:22 POSLE PODNE
Fixao sam sve errore ostao je ovaj warning


C:\Users\pogan\OneDrive\Desktop\Server\Skripta-Mod\gamemodes\pcrp.pwn(1016) : warning 219: local variable "i" shadows a variable at a preceding level
Pawn compiler 3.10.4           Copyright (c) 1997-2006, ITB CompuPhase

Header size:           5364 bytes
Code size:           166752 bytes
Data size:         16940480 bytes
Stack/heap size:      16384 bytes; estimated max. usage=1065 cells (4260 bytes)
Total requirements:17128980 bytes

1 Warning.             

Tu je inace foreach(Player, i)
Naslov: Odg: SetChatBubble Pomocc
Poruka od: Fergosonn poslato Avgust 20, 2021, 16:17:21 POSLE PODNE
[pawn]forward ChatBubble();
public ChatBubble()
{
   foreach(Player,i)
   {
      if(PlayerInfo[pVip] == 1)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 1 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip])
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 2 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 3)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 3 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 4)
      {
         SetPlayerChatBubble(i, "[ VIP LEVEL 4 ]", 0xAA3333AA, 30.0,60000);
      }
      if(PlayerInfo[pVip] == 5)
      {
         SetPlayerChatBubble(i, "[ Master Donator ]", 0xAA3333AA, 30.0,60000);
      }
   }
   return 1;
}[/pawn]
evo ispravno nije mi dalo nit warninge nit ista
Naslov: Odg: SetChatBubble Pomocc
Poruka od: skriptergodine poslato Avgust 20, 2021, 16:36:11 POSLE PODNE
tjt HVALA VAAAAAAAAAAAAAAAAAM LOCK