Ü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)
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);
MegpróbáloM!
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ó!
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);
}
}
}
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);
}
}