GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: inf - 2014. február 07. - 16:35:13

Cím: count
Írta: inf - 2014. február 07. - 16:35:13
Sziasztok!
Ezzel mi a probléma?
Hiba:
 
error 035: argument type mismatch (argument 2)

 
Sor:
 
GameTextForPlayer(playerid,vcount,3000,4);

 
Teljes script:
 
public timercount(playerid)
{
new vcount = 60;
GameTextForPlayer(playerid,vcount,3000,4);
vcount--;
return 1;
}
Cím: count
Írta: Dfoglalo - 2014. február 07. - 16:47:24
 GameTextForPlayer(playerid,vcount,3000,4);

 
A vcount helyére karakterlánc kéne, nem integer. Pl.:
 
new vcount = \"asd\";

 
vagy
 
 GameTextForPlayer(playerid,\"asd\",3000,4);

 
ugyanis a paraméterek:
 
(playerid, const string[], time, style)
Cím: count
Írta: jana4 - 2014. február 07. - 21:10:13
Karakterláncnak illik adni méretet is! ;)
 
new vcount[4] = \"asd\";
Cím: count
Írta: Dfoglalo - 2014. február 07. - 22:26:16
Idézetet írta: ScreaM date=1391803813\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"46351\" data-ipsquote-contentclass=\"forums_Topic
Karakterláncnak illik adni méretet is! ;)
 
new vcount[4] = \"asd\";

 

Õõõöm :unsure: Nem én voltam :rolleyes: :whistle:
Cím: count
Írta: Pedró - 2014. február 08. - 15:37:32
Annyi hülyeséget összehordtál Dfoglalo.. Meg is értem, hogy 1 hét alatt 100 hsz-ed összejött.. :)
 
Idézetet írta: InFIeL_HuN date=1391787313\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"46351\" data-ipsquote-contentclass=\"forums_Topic

public timercount(playerid)
{
new vcount = 60;
GameTextForPlayer(playerid,vcount,3000,4);
vcount--;
return 1;
}

 

->
GM/FS elejére:
new vcount;
Amikor a Countert elindítod:
vcount = 60;
 
public timercount(playerid)
{
        new str[32];
        if(vcount == 0) format(str, sizeof(str), \"GO GO GO\");
        else format(str, sizeof(str), \"%i\", vcount);
GameTextForAll(str,3000,4);
vcount--;
return 1;
}

 
++
KillTimer se ártana..
Amikor a SetTimer funkciót elindítod, mentsd a SetTimer értékét változóba..
 
timer = SetTimer(...);

 
és akkor


áá meguntam. Írok neked egy FS-t..
 
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
forward CountDown();
new countdown_count = -1;
new countdown_timer;
public CountDown() {
new str[32];
if(countdown_count > 0) format(str, sizeof(str), \"CountDown~n~%i\", countdown_count);
else str = \"CountDown~n~GO GO GO\";
GameTextForAll(str, 3000, 4);
countdown_count--;
if(countdown_count == 0) {
    countdown_count = -1;
    KillTimer(countdown_timer);
}
return 1;
}
CMD:countdown(playerid) {
if(countdown_count != -1) return SendClientMessage(playerid, 0xFF0000FF, \"Hiba, jelenleg már fut egy visszaszámláló!\");
countdown_count = 60;
CountDown(); //Egybõl induljon..
countdown_timer = SetTimer(\"CountDown\", 1000, true);
SendClientMessage(playerid, 0xFFFF00FF, \"Elindítottál egy visszaszámlálót!\");
return 1;
}
Cím: count
Írta: Dfoglalo - 2014. február 08. - 15:46:54
Egyáltalán nem írtam hülyeséget, ugyanis akárhogy is nézem, a GameTextForPlayer függvény 2. paramétere string, õ pedig integert adott meg. :)
Cím: count
Írta: ZyZu. - 2014. február 08. - 15:50:21
[gmod]Kiemelt téma van ilyen kisebb kérdésekért! A témát zárom és szépen írj oda mint a többi fórumozó![/gmod]