Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-03-15, 23:43


bali15







Wiek: 30
Na forum: 4880 dni
Posty: 123

Piwa: 1

Respekt: 50

Witam. Mam pewne errory zwi?zane z Tachografem. Kod na moje wygl?da okej ale jednak program m?wi co innego ;
Kod:


(2640) : error 010: invalid function or declaration
(2643) : error 010: invalid function or declaration
(2653) : warning 203: symbol is never used: "str"

A linijka to (Podam ca?? funkcje)

Kod:

new str[12];
function Tachograf(playerid)
{
sekundy[playerid]++;
if(sekundy[playerid] == 60)
{
minuty[playerid]++;
sekundy[playerid] = 00;
}
format(str, sizeof(str), "%d:%d", minuty, sekundy);
TextDrawSetString(CzasTacho[playerid], str);
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-16, 00:44


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Kod:

function Tachograf(playerid)
{
new str[12];
sekundy[playerid]++;
if(sekundy[playerid] == 60)
{
minuty[playerid]++;
sekundy[playerid] = 00;
}
format(str, sizeof(str), "%d:%d", minuty[playerid], sekundy[playerid]);
TextDrawSetString(CzasTacho[playerid], str);
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-16, 10:02


bali15







Wiek: 30
Na forum: 4880 dni
Posty: 123

Piwa: 1

Respekt: 50

Jedne usta?y, pojawi?y si? drugie ;

Kod:


(2639) : error 010: invalid function or declaration
(2642) : error 010: invalid function or declaration
(2643) : error 010: invalid function or declaration
(2650) : error 010: invalid function or declaration


Linijka to;

Kod:

function Tachograf(playerid)// Tutaj error
{
new str[12];
sekundy[playerid]++;//Tu te?
if(sekundy[playerid] == 60)//Tutaj
{
minuty[playerid]++;
sekundy[playerid] = 00;
}
format(str, sizeof(str), "%d:%d", minuty[playerid], sekundy[playerid]);
TextDrawSetString(CzasTacho[playerid], str);
return 1;//I tutaj
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-16, 12:18


Sillence







Wiek: 26
Na forum: 5157 dni
Posty: 1514
Nick w MP: Sillence

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

Kod:

function Tachograf(playerid)
{
sekundy[playerid]++;
if(sekundy[playerid] == 60)//Tutaj
{
minuty[playerid]++;
sekundy[playerid] = 00;
}
new str[20];
format(str, sizeof(str), "%d:%d", minuty[playerid], sekundy[playerid]);
TextDrawSetString(CzasTacho[playerid], str);
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-16, 12:42


bali15







Wiek: 30
Na forum: 4880 dni
Posty: 123

Piwa: 1

Respekt: 50

Kopcioo, ehh dalej te errory..

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-16, 13:31


Sillence







Wiek: 26
Na forum: 5157 dni
Posty: 1514
Nick w MP: Sillence

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

A jak definiujesz sekundy i minuty ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-16, 16:39


bali15







Wiek: 30
Na forum: 4880 dni
Posty: 123

Piwa: 1

Respekt: 50

nie definiuje bo nie wymaga?o tego ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-16, 18:28


Sillence







Wiek: 26
Na forum: 5157 dni
Posty: 1514
Nick w MP: Sillence

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

Dodaj na g?rze mapki:
Kod:

new sekundy[MAX_PLAYERS];
new minuty[MAX_PLAYERS];


Pozdrawiam :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-17, 00:58


bali15







Wiek: 30
Na forum: 4880 dni
Posty: 123

Piwa: 1

Respekt: 50

Kopcioo, dalej nic ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-17, 12:35


Kapec232







Wiek: 28
Na forum: 4828 dni
Posty: 7
Nick w MP: Kapec

Piwa: 2

Respekt: 50

Zmie? function na stock powinno dzia?ac masz tu kod:
Kod:

stock Tachograf(playerid)
{
sekundy[playerid]++;
if(sekundy[playerid] == 60)//Tutaj
{
minuty[playerid]++;
sekundy[playerid] = 00;
}
new str[20];
format(str, sizeof(str), "%d:%d", minuty[playerid], sekundy[playerid]);
TextDrawSetString(CzasTacho[playerid], str);
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-17, 14:58


bali15







Wiek: 30
Na forum: 4880 dni
Posty: 123

Piwa: 1

Respekt: 50

Gdy dam stock'a to mi nie nalicza czasu.. Wi?c trzeba to jako? inaczej zrobi?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-17, 15:19


Wafelowski







Wiek: 29
Na forum: 5347 dni
Posty: 428

Piwa: 100

Respekt: 232
Respekt: 232Respekt: 232

Opisz co chcesz dok?adnie zrobi?, mo?e da si? to zrobi? w inny spos?b.

Poka? jak korzystasz jeszcze z funkcji
Kod:

function Tachograf(playerid)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-17, 15:41


bali15







Wiek: 30
Na forum: 4880 dni
Posty: 123

Piwa: 1

Respekt: 50

No wi?c tak ;
W OnPlayerExitVehicle(playerid, vehicleid) daj? tak ;
Kod:

TextDrawHideForPlayer(playerid, Tacho);
TextDrawHideForPlayer(playerid, CzasTacho[playerid]);
minuty[playerid] = 0;
sekundy[playerid] = 0;
TextDrawColor(CzasTacho[playerid], 0xffffffff);
KillTimer(TachoGraf[playerid]);

A w ;
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) mam tak ;
Kod:


TachoGraf[playerid] = SetTimerEx("Tachograf", 1000, true, "d", playerid);
TextDrawShowForPlayer(playerid, Tacho);
TextDrawShowForPlayer(playerid, CzasTacho[playerid]);


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-17, 19:30


Kapec232







Wiek: 28
Na forum: 4828 dni
Posty: 7
Nick w MP: Kapec

Piwa: 2

Respekt: 50

Hmm mo?e inaczej to zrobimy :)
zamiast stock zrobimy public :)
Kod:


forward Tachograf(playerid);
public Tachograf(playerid)
{
sekundy[playerid]++;
if(sekundy[playerid] == 60)//Tutaj
{
minuty[playerid]++;
sekundy[playerid] = 00;
}
new str[20];
format(str, sizeof(str), "%d:%d", minuty[playerid], sekundy[playerid]);
TextDrawSetString(CzasTacho[playerid], str);
return 1;
}

:) Zobacz czy tera bedzie dzia?ac

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-17, 19:33


Wafelowski







Wiek: 29
Na forum: 5347 dni
Posty: 428

Piwa: 100

Respekt: 232
Respekt: 232Respekt: 232

Tworzysz tzw. makro definicje? Mo?e to akurat w niej znajduje si? ?w problem. Hm, a spr?buj tak zrobi?:
Kod:


forward Tachograf(playerid);
public Tachograf(playerid)
{
new str[12];

sekundy[playerid]++;
if(sekundy[playerid] == 60)
{
minuty[playerid]++;
sekundy[playerid] = 0;
}

format(str, sizeof(str), "%d:%d", minuty[playerid], sekundy[playerid]);
TextDrawSetString(CzasTacho[playerid], str);
return 1;
}



@UP: By?e? szybszy, co wida?.

Postaw piwo autorowi tego posta
 

 
Tagi: tachograf
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku