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

Wysłany: 2013-05-01, 12:16


GoldMan







Wiek: 28
Na forum: 5270 dni
Posty: 14



Respekt: 50

Witam, mam pewien problem:
Kod:

F:\Serwer 0.3x\gamemodes\mapa.pwn(1253) : error 017: undefined symbol "strtok"
F:\test.pwn(1253) : error 017: undefined symbol "strtok"
F:\test.pwn(1253) : error 017: undefined symbol "strtok"
F:\test.pwn(1255) : error 017: undefined symbol "strtok"
F:\test.pwn(1255) : error 017: undefined symbol "strtok"
F:\test.pwn(1254) : warning 204: symbol is assigned a value that is never used: "idx"
F:\test.pwn(1642) : error 017: undefined symbol "strtok"
F:\test.pwn(1642) : error 033: array must be indexed (variable "cmd")
F:\test.pwn(1944) : error 017: undefined symbol "strtok"
F:\test.pwn(1944) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(1952) : error 017: undefined symbol "strtok"
F:\test.pwn(1952) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(2008) : error 017: undefined symbol "strtok"
F:\test.pwn(2008) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(2048) : error 017: undefined symbol "strtok"
F:\test.pwn(2048) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(2147) : error 017: undefined symbol "strtok"
F:\test.pwn(2147) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(2155) : error 017: undefined symbol "strtok"
F:\test.pwn(2155) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(2163) : error 017: undefined symbol "strtok"
F:\test.pwn(2163) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(2171) : error 017: undefined symbol "strtok"
F:\test.pwn(2171) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(3404) : error 017: undefined symbol "strtok"
F:\test.pwn(3404) : error 033: array must be indexed (variable "tmp")
F:\test.pwn(3456) : error 017: undefined symbol "strtok"
F:\test.pwn(3456) : error 033: array must be indexed (variable "tmp")

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.

To jest dziwne, bo mapa by?a wiele razy otwierana i kompilowana i nei by?o ?adnych b??d?w, teraz po paru miesi?cach rozpakowa?em paczk? bez zmieniania include ani kodu mapy i jest ten b??d. Czemu on si? pojawi? bez zmieniania czegokolwiek? Wiem, ?e dodaje si? #include <strtok> albo na ko?cu mapy definicj? strtoka, ale kiedy? by?o bez tego i kompilowa?o bez b??d?w. Prosz? o wyja?nienie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-01, 12:28


xqz

otaku desu!






Wiek: 32
Na forum: 6407 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

"GoldMan" napisał/a:

ale kiedy? by?o bez tego i kompilowa?o bez b??d?w

to nie mo?liwe :D

Pewnie mia?e? jakie? include kt?re zawiera?o ju? t? funkcj?. Czasem si? skleja do jednego include r??ne funkcje.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-01, 12:35


GoldMan







Wiek: 28
Na forum: 5270 dni
Posty: 14



Respekt: 50

:D No to teraz tak:
Kod:

F:\test.pwn(1254) : warning 202: number of arguments does not match definition
F:\test.pwn(1254) : warning 202: number of arguments does not match definition
F:\test.pwn(1256) : warning 202: number of arguments does not match definition
F:\test.pwn(1256) : warning 202: number of arguments does not match definition
F:\test.pwn(5934) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Warnings.


1251-1257:
Kod:


tmp = dini_Get(FILE_SETTINGS, "blacklist");
if (strval(tmp) == 1) {
tmp = dini_Get(FILE_BLACKLIST, playername);
if (strval(strtok(tmp, idx, ',')) == 1) KickMsg(playerid, "Blacklist", strtok(tmp, idx, ','));
idx = 0;
if (strval(strtok(tmp, idx, ',')) == 2) BanMsg(playerid, "Blacklist", strtok(tmp, idx, ','));
}


5934-5939:
Kod:

for (new i=0;i<47 && detected != 1;i++)
if (reason == strval(strtok(tmp, idx, ',')) && reason != 0 && !IsPlayerAdmin(playerid)) {
if (strval(tmp2) == 1) KickMsg(killerid, "AntiCheat", "Forbidden weapon detected!");
if (strval(tmp2) == 2) BanMsg(killerid, "AntiCheat", "Forbidden weapon detected!");
detected = 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-01, 12:40


xqz

otaku desu!






Wiek: 32
Na forum: 6407 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

Kod:

stock strtok(const string[],&index,seperator[2])
{
new length = strlen(string);
while ((index < length) && (string[index] <= seperator[0])) index++;
new offset = index, result[20];
while ((index < length) && (string[index] > seperator[0]) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

Spr?buj tej wersji.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-01, 12:55


GoldMan







Wiek: 28
Na forum: 5270 dni
Posty: 14



Respekt: 50

Kod:

F:\test.pwn(1253) : error 035: argument type mismatch (argument 3)
F:\test.pwn(1253) : error 035: argument type mismatch (argument 3)
F:\test.pwn(1255) : error 035: argument type mismatch (argument 3)
F:\test.pwn(1255) : error 035: argument type mismatch (argument 3)
F:\test.pwn(1642) : warning 202: number of arguments does not match definition
F:\test.pwn(1944) : warning 202: number of arguments does not match definition
F:\test.pwn(1952) : warning 202: number of arguments does not match definition
F:\test.pwn(2008) : warning 202: number of arguments does not match definition
F:\test.pwn(2048) : warning 202: number of arguments does not match definition
F:\test.pwn(2147) : warning 202: number of arguments does not match definition
F:\test.pwn(2155) : warning 202: number of arguments does not match definition
F:\test.pwn(2163) : warning 202: number of arguments does not match definition
F:\test.pwn(2171) : warning 202: number of arguments does not match definition
F:\test.pwn(3404) : warning 202: number of arguments does not match definition
F:\test.pwn(3456) : warning 202: number of arguments does not match definition
F:\test.pwn(3499) : warning 202: number of arguments does not match definition
F:\test.pwn(3538) : warning 202: number of arguments does not match definition
F:\test.pwn(3621) : warning 202: number of arguments does not match definition
F:\test.pwn(3685) : warning 202: number of arguments does not match definition
F:\test.pwn(3716) : warning 202: number of arguments does not match definition
F:\test.pwn(3944) : warning 202: number of arguments does not match definition
F:\test.pwn(3973) : warning 202: number of arguments does not match definition
F:\test.pwn(4001) : warning 202: number of arguments does not match definition
F:\test.pwn(4064) : warning 202: number of arguments does not match definition
F:\test.pwn(4132) : warning 202: number of arguments does not match definition
F:\test.pwn(4134) : warning 202: number of arguments does not match definition
F:\test.pwn(4164) : warning 202: number of arguments does not match definition
F:\test.pwn(4169) : warning 202: number of arguments does not match definition
F:\test.pwn(4189) : warning 202: number of arguments does not match definition
F:\test.pwn(4207) : warning 202: number of arguments does not match definition
F:\test.pwn(4214) : warning 202: number of arguments does not match definition
F:\test.pwn(4220) : warning 202: number of arguments does not match definition
F:\test.pwn(4245) : warning 202: number of arguments does not match definition
F:\test.pwn(4251) : warning 202: number of arguments does not match definition
F:\test.pwn(4275) : warning 202: number of arguments does not match definition
F:\test.pwn(4294) : warning 202: number of arguments does not match definition
F:\test.pwn(4302) : warning 202: number of arguments does not match definition
F:\test.pwn(4392) : warning 202: number of arguments does not match definition
F:\test.pwn(4400) : warning 202: number of arguments does not match definition
F:\test.pwn(4442) : warning 202: number of arguments does not match definition
F:\test.pwn(4466) : warning 202: number of arguments does not match definition
F:\test.pwn(4490) : warning 202: number of arguments does not match definition
F:\test.pwn(4532) : warning 202: number of arguments does not match definition
F:\test.pwn(4573) : warning 202: number of arguments does not match definition
F:\test.pwn(4617) : warning 202: number of arguments does not match definition
F:\test.pwn(4674) : warning 202: number of arguments does not match definition
F:\test.pwn(4689) : warning 202: number of arguments does not match definition
F:\test.pwn(4792) : warning 202: number of arguments does not match definition
F:\test.pwn(4846) : warning 202: number of arguments does not match definition
F:\test.pwn(4915) : warning 202: number of arguments does not match definition
F:\test.pwn(4923) : warning 202: number of arguments does not match definition
F:\test.pwn(4961) : warning 202: number of arguments does not match definition
F:\test.pwn(4969) : warning 202: number of arguments does not match definition
F:\test.pwn(5011) : warning 202: number of arguments does not match definition
F:\test.pwn(5158) : warning 202: number of arguments does not match definition
F:\test.pwn(5206) : warning 202: number of arguments does not match definition
F:\test.pwn(5223) : warning 202: number of arguments does not match definition
F:\test.pwn(5349) : warning 202: number of arguments does not match definition
F:\test.pwn(5412) : warning 202: number of arguments does not match definition
F:\test.pwn(5418) : warning 202: number of arguments does not match definition
F:\test.pwn(5424) : warning 202: number of arguments does not match definition
F:\test.pwn(5454) : warning 202: number of arguments does not match definition
F:\test.pwn(5460) : warning 202: number of arguments does not match definition
F:\test.pwn(5466) : warning 202: number of arguments does not match definition
F:\test.pwn(5497) : warning 202: number of arguments does not match definition
F:\test.pwn(5503) : warning 202: number of arguments does not match definition
F:\test.pwn(5509) : warning 202: number of arguments does not match definition
F:\test.pwn(5538) : warning 202: number of arguments does not match definition
F:\test.pwn(5544) : warning 202: number of arguments does not match definition
F:\test.pwn(5576) : warning 202: number of arguments does not match definition
F:\test.pwn(5582) : warning 202: number of arguments does not match definition
F:\test.pwn(5624) : warning 202: number of arguments does not match definition
F:\test.pwn(5933) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-01, 13:01


xqz

otaku desu!






Wiek: 32
Na forum: 6407 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

Kod:

tmp = dini_Get(FILE_SETTINGS, "blacklist");
if (strval(tmp) == 1) {
tmp = dini_Get(FILE_BLACKLIST, playername);
if (strval(strtok(tmp, idx)) == 1) KickMsg(playerid, "Blacklist", strtok(tmp, idx));
idx = 0;
if (strval(strtok(tmp, idx)) == 2) BanMsg(playerid, "Blacklist", strtok(tmp, idx));
}

Kod:


for (new i=0;i<47 && detected != 1;i++)
if (reason == strval(strtok(tmp, idx)) && reason != 0 && !IsPlayerAdmin(playerid)) {
if (strval(tmp2) == 1) KickMsg(killerid, "AntiCheat", "Forbidden weapon detected!");
if (strval(tmp2) == 2) BanMsg(killerid, "AntiCheat", "Forbidden weapon detected!");
detected = 1;
}



+ twoj stary strtok.

Sprawdz czy bedzie dzialac ta funkcja w grze (blacklist i antycheat)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-01, 13:43


GoldMan







Wiek: 28
Na forum: 5270 dni
Posty: 14



Respekt: 50

Wszystko dzia?a bez zarzutu, tylko jak jest si? na czarnej li?cie i wyrzuci gracza nie ma powodu kt?ry by? podany przy wpisywaniu do czarnej listy. To jest zwi?zane z poprzednimi b??dami? Poda? jakie? linijki czy te co ju? s? wystarcz??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-01, 13:49


xqz

otaku desu!






Wiek: 32
Na forum: 6407 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

Uff nie bedziemy przeciez od nowa tego robic w innym systemie ;o


Wroc do starego kodu tylko z ta funkcja od DracoBlue

Kod:

// Written by DracoBlue.
stock strtok(const string[], &index,seperator=' ')
{
new length = strlen(string);
new offset = index;
new result[MAX_STRING];
while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}

result[index - offset] = EOS;
if ((index < length) && (string[index] == seperator))
{
index++;
}
return result;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-01, 14:05


GoldMan







Wiek: 28
Na forum: 5270 dni
Posty: 14



Respekt: 50

Wszystko dzia?a. Dzi?kuj? ci serdecznie. Piwo za obja?nienie tego na pocz?tku i za rozwi?zanie tego wszystkiego drugie. Pozdrawiam :)

Postaw piwo autorowi tego posta
 

 
Tagi: strtok
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] Strtok 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