Szerző Téma: Error 035  (Megtekintve 937 alkalommal)

Error 035
« Dátum: 2016. Május 02. - 18:53:52 »
0 Show voters
Üdv!
A módot amit készitek abba van egy error amit nem tudok ki javitani
 
forward OglasNews(const string[], time, style);
public OglasNews(const string[], time, style)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
65216 ---->          GameTextForPlayer(string, time, style);
}
}
}

 
Error:
 
(65216) : error 035: argument type mismatch (argument 2)

Nem elérhető divkn

  • 3259
    • Profil megtekintése
Error 035
« Válasz #1 Dátum: 2016. Május 02. - 19:03:18 »
0 Show voters
Ha csak ennyiből áll az eljárás akkor nem is kell for ciklus, hanem írd át a GameTextForPlayer-t GameTextForAll-ra.
De egyébként csak egy playerid paraméter (aka \"i\") hiányzik abban a sorban.
 
GameTextForPlayer(i, string, time, style);

Error 035
« Válasz #2 Dátum: 2016. Május 02. - 19:04:20 »
0 Show voters
MegpróbáloM!
 
Idézetet írta: divkn date=1462208598\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"60269\" data-ipsquote-contentclass=\"forums_Topic
Ha csak ennyiből áll az eljárás akkor nem is kell for ciklus, hanem írd át a GameTextForPlayer-t GameTextForAll-ra.
De egyébként csak egy playerid paraméter (aka \"i\") hiányzik abban a sorban.
 
GameTextForPlayer(i, string, time, style);

 

Nem jó!
« Utoljára szerkesztve: 2016. Május 02. - 19:13:18 írta JamesK »

Nem elérhető nyomo

  • 159
    • Profil megtekintése
Error 035
« Válasz #3 Dátum: 2016. Május 03. - 15:34:51 »
0 Show voters
Ez az ékezet/fixchars include miatt van. Kipróbáltam anélkül jó.
Vagy formázod a stringedet és úgy írod ki vagy nem const string-et használsz, hanem simán string-et és a GameText jó lesz.
 
CMD:asd(playerid)
{
    OglasNews(\"aAáÁ123@ Teszt szöveg\", 5000, 3);
return 1;
}
forward OglasNews(const string[], time, style);
public OglasNews(const string[], time, style)
{
new stringGT[32];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
                if(IsPlayerConnected(i))
                {
                    format(stringGT, sizeof stringGT, \"%s\",string);
                GameTextForPlayer(i,stringGT, time, style);
         SendClientMessage(i,-1,string);
         SendClientMessage(i,-1,stringGT);
         printf(string);
         printf(stringGT);
                }
        }
}

 

CMD:asd2(playerid)
{
    OglasNews2(\"aAáÁ123@ Teszt szöveg\", 5000, 3);
return 1;
}
forward OglasNews2(string[], time, style);
public OglasNews2(string[], time, style)
{
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
                if(IsPlayerConnected(i))
                {
                GameTextForPlayer(i,string, time, style);
                SendClientMessage(i,-1,string);
   printf(string);
                }
        }
}
« Utoljára szerkesztve: 2016. Május 03. - 16:14:11 írta nyomo »

Nem elérhető whadez

  • 719
  • DEFEATER
    • Profil megtekintése
Error 035
« Válasz #4 Dátum: 2016. Május 03. - 16:07:47 »
0 Show voters

forward OglasNews(fstr[], time, style);
public OglasNews(fstr[], time, style) {
        for(new i = 0; i < MAX_PLAYERS; i++) {
   if(!IsPlayerConnected(i)) continue;
   GameTextForPlayer(i, fstr, time, style);
        }
}

Error 035
« Válasz #5 Dátum: 2016. Május 03. - 16:44:36 »
0 Show voters
Megpróbálom! Kösszi a segitséget.Ha meg tudom hogy kell adni +-t akkor adok azt is.

ᗩωєѕσмє

  • Vendég
Error 035
« Válasz #6 Dátum: 2016. Május 03. - 16:48:03 »
+1 Show voters
Idézetet írta: JamesK date=1462286676\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"60269\" data-ipsquote-contentclass=\"forums_Topic
Megpróbálom! Kösszi a segitséget.Ha meg tudom hogy kell adni +-t akkor adok azt is.
 
Amint eléred az 50+ hozzászólást, tudsz is tiszteletpontot(+-t.) adni másnak.

Error 035
« Válasz #7 Dátum: 2016. Május 03. - 17:04:09 »
0 Show voters
Rendben! Kösszönöm a segitséget müködött ! Zárom a témát.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal