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

Wysłany: 2012-08-02, 12:01


Pro-reklamowiec

Robię to co Lubię






Wiek: 32
Na forum: 5101 dni
Posty: 23
Nick w MP: Hardkor

Piwa: 9

Respekt: 50

Witam mam problem w GM ?e wyskakuj? mi takie warningi za ka?dy rozwi?zany daje Piwo :piwo:

Kod:

\pawno\include\strtok.inc(12) : error 021: symbol already defined: "strtok"
\pawno\include\strtok.inc(27) : error 047: array sizes do not match, or destination array is too small
: error 017: undefined symbol "strrest"
: error 033: array must be indexed (variable "String")
: error 017: undefined symbol "strrest"
: error 033: array must be indexed (variable "BReason")
: error 017: undefined symbol "strrest"
: error 033: array must be indexed (variable "Reason")
: warning 203: symbol is never used: "gActivePlayers"
: warning 203: symbol is never used: "gLastGaveCash"
: warning 203: symbol is never used: "gangBank"
: warning 203: symbol is never used: "gangInfo"
: warning 203: symbol is never used: "gangInvite"
: warning 203: symbol is never used: "gangMembers"
: warning 203: symbol is never used: "gangNames"
: warning 203: symbol is never used: "playerGang"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:02


Kurio







Wiek: 35
Na forum: 5512 dni
Posty: 122

Piwa: 17

Respekt: 76,3

mo?e tak linijki z b?edami?
nie jeste?my jasnowidzami, a ?atwiej i szybciej rozwi?za? problem jak sie widzi linijke (kod) ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:03


Pro-reklamowiec

Robię to co Lubię






Wiek: 32
Na forum: 5101 dni
Posty: 23
Nick w MP: Hardkor

Piwa: 9

Respekt: 50

Ju? podaje :)

Kod:

COMMAND:gang(playerid, params[])
{
new Func[255], String[255], idx;
Func = StrToLower(strtok(params, idx));

if(MyStrCmp(Func, "create"))
{
String = strrest(params, idx);
if(strlen(String) < 1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Wpisz: /gang create [nazwa gangu]");
return 1;
}

if(strlen(String) < 2)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nazwa gangu jest za kt?tka. Min. 2 znaki.");
return 1;
}

if(strlen(String) > 16)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nazwa gangu jest za d?uga. Max. 16 znak?w.");
return 1;
}

if(Player[playerid][Gangster] != -1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Jeste? ju? w innym gangu. By go opu?ci? wpisz /gang exit");
return 1;
}

if(Player[playerid][MGang])
MGangQuit(playerid);

if(Player[playerid][NGang])
NGangQuit(playerid);

new nGang = CreateGang(String, playerid);
if(nGang == -1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Wyst?pi? b??d w tworzeniu gangu.");
return 1;
}

new Success[255];
format(Success, sizeof(Success), " (info) Gang %s zosta? utworzony. Wpisz /gang invite [id gracza] by kogo? zaprosi?.", String);
SendClientMessage(playerid, COLOR_GANG, Success);
return 1;
}
else if(MyStrCmp(Func, "invite"))
{
if(Player[playerid][Gangster] == -1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie jeste? w gangu.");
return 1;
}

String = strtok(params, idx);
if(!isNumeric(String) || strlen(String) < 1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Wpisz: /gang invite [id gracza]");
return 1;
}

new PlayerId = strval(String);

if(!IsPlayerConnected(PlayerId))
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie ma takiego gracza.");
return 1;
}

if(Player[PlayerId][Gangster] != -1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Ten gracz jest ju? w innym gangu.");
return 1;
}

new GangId = Player[playerid][Gangster];
Gang[GangId][Invited][PlayerId] = true;
new Success[255];
format(Success, sizeof(Success), " (info) Zaproszenie zosta?o wys?ane do %s.", Player[PlayerId][Name]);
SendClientMessage(playerid, COLOR_GANG, Success);
format(Success, sizeof(Success), " (info) Gracz %s zaprasza Ci? go gangu %s. Je?li chcesz do??czy? wpisz /gang join %d", Player[playerid][Name], Gang[GangId][Name], GangId);
SendClientMessage(PlayerId, COLOR_GANG, Success);
return 1;
}
else if(MyStrCmp(Func, "join"))
{
String = strtok(params, idx);
if(!isNumeric(String) || strlen(String) < 1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Wpisz: /gang join [id gangu]");
return 1;
}

new GangId = strval(String);
if(GangId < 0 || GangId >= MAX_GANGS)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie zosta?e? zaproszony do tego gangu.");
return 1;
}

if(!Gang[GangId][Invited][playerid])
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie zosta?e? zaproszony do tego gangu.");
return 1;
}

if(Player[playerid][Gangster] != -1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Jeste? ju? w innym gangu. By go opu?ci? wpisz /gang exit");
return 1;
}

if(Player[playerid][MGang])
MGangQuit(playerid);

if(Player[playerid][NGang])
NGangQuit(playerid);

PlayerJoinGang(playerid, GangId);
new Success[255];
format(Success, sizeof(Success), " (info) Do??czy?e?/a? do gangu %s.", Gang[GangId][Name]);
SendClientMessage(playerid, COLOR_GANG, Success);
SendClientMessage(playerid, COLOR_GANG, " (info) Mo?esz porozumiewa? si? ze swoim gangiem. Wystarczy ?e przez wiadomo?ci? dodasz znak \"!\". Na przyk?ad !siema ziomcy");
format(Success, sizeof(Success), " (info) %s (id %d) do??czy? do gangu.", Player[playerid][Name], playerid);
SendClientMessageToGang(GangId, Success);
return 1;
}
else if(MyStrCmp(Func, "exit") || MyStrCmp(Func, "quit"))
{
if(Player[playerid][Gangster] == -1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie jeste? w gangu.");
return 1;
}

new GangId = Player[playerid][Gangster];
PlayerExitGang(playerid);
new Success[255];
format(Success, sizeof(Success), " (info) Opu?ci?e?/a? gang %s.", Gang[GangId][Name]);
SendClientMessage(playerid, COLOR_GANG, Success);
format(Success, sizeof(Success), " (info) %s (id %d) opu?ci? gang.", Player[playerid][Name], playerid);
SendClientMessageToGang(playerid, Success);
return 1;
}
else if(MyStrCmp(Func, "info"))
{
if(Player[playerid][Gangster] == -1)
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Nie jeste? w gangu.");
return 1;
}

new GangId = Player[playerid][Gangster];
new Success[255];
format(Success, sizeof(Success), " (info) Informacje o gangu %s.", Gang[GangId][Name]);
SendClientMessage(playerid, COLOR_GREEN, Success);
format(Success, sizeof(Success), " Stan konta: %d$", Gang[GangId][BankMoney]);
SendClientMessage(playerid, COLOR_GREY, Success);

new PlayersInGang = 0;
format(Success, sizeof(Success), " Cz?onkowie:");
for(new PlayerId = 0; PlayerId < MAX_PLAYERS; PlayerId++)
{
if(IsPlayerConnected(PlayerId) && Player[PlayerId][Gangster] == GangId)
{
PlayersInGang++;
format(Success, sizeof(Success), "%s %s (id %d),", Success, Player[PlayerId][Name], PlayerId);
}
if((strlen(Success) > 90 || PlayerId == (MAX_PLAYERS-1)) && PlayersInGang > 0)
{
SendClientMessage(playerid, COLOR_GREY, Success);
format(Success, sizeof(Success), "");
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERROR, " (b??d) Wpisz: /gang [\"create\" / \"invite\" / \"join\" / \"info\" / \"exit\"]");
return 1;
}
}

stock CreateGang(GangName[255], Master)
{
for(new GangId = 0; GangId < MAX_GANGS; GangId++)
{
if(Gang[GangId][Players] < 1)
{
format(Gang[GangId][Name], sizeof(GangName), "%s", GangName);
for(new PlayerId = 0; PlayerId < MAX_PLAYERS; PlayerId++)
Gang[GangId][Invited][PlayerId] = false;
Gang[GangId][Players] = 1;
Gang[GangId][BankMoney] = 0;
Player[Master][Gangster] = GangId;
Gang[GangId][Color] = GetPlayerColor(Master);
return GangId;
}
}
return -1;
}

SendClientMessageToGang(GangId, Text[])
{
new MColor;
if(GangId == MGANG)
MColor = COLOR_RASPBERRY;
else if(GangId == NGANG)
MColor = COLOR_NGANG;
else
MColor = COLOR_GANG;
for(new PlayerId = 0; PlayerId < MAX_PLAYERS; PlayerId++)
if(IsPlayerConnected(PlayerId) && (Player[PlayerId][Gangster] == GangId || (GangId == MGANG && Player[PlayerId][MGang]) || (GangId == NGANG && Player[PlayerId][NGang])))
SendClientMessage(PlayerId, MColor, Text);
}

PlayerJoinGang(PlayerId, GangId)
{
Player[PlayerId][Gangster] = GangId;
SetPlayerColor(PlayerId, Gang[GangId][Color]);
Gang[GangId][Players]++;
Gang[GangId][Invited][PlayerId] = false;
}

PlayerExitGang(PlayerId)
{
new GangId = Player[PlayerId][Gangster];
Player[PlayerId][Gangster] = -1;
SetPlayerColor(PlayerId, Player[PlayerId][Color]);
Gang[GangId][Players] = GetPlayersInGang(GangId);
Gang[GangId][Invited][PlayerId] = false;
}

stock GetPlayersInGang(GangId)
{
new Count;
for(new PlayerId = 0; PlayerId < MAX_PLAYERS; PlayerId++)
if(IsPlayerConnected(PlayerId) && Player[PlayerId][Gangster] == GangId)
Count++;
return Count;
}


Ostatnio zmieniony przez Pro-reklamowiec 2012-08-02, 12:14, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:06


B!4CK

Never give UP!






Wiek: 32
Na forum: 5809 dni
Posty: 1047
Nick w MP: John

Piwa: 1891

Respekt: 124,2
Respekt: 124,2

Masz include strtok ?

To ca?a komenda? Jaki to GM ?

Podpis
Cześć
! :)


Projekt, który poruszy scenę platformy SA:MP!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:08


Pro-reklamowiec

Robię to co Lubię






Wiek: 32
Na forum: 5101 dni
Posty: 23
Nick w MP: Hardkor

Piwa: 9

Respekt: 50

tak mam to jest gm Polskie Party Topka i nie dzia?a mi :(

[ Dodano: 2012-08-02, 12:11 ]
i to ca?a komenda

Podpis
International Road Truck

Zapraszamy

IP: 213.189.52.62:7791
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:12


B!4CK

Never give UP!






Wiek: 32
Na forum: 5809 dni
Posty: 1047
Nick w MP: John

Piwa: 1891

Respekt: 124,2
Respekt: 124,2

Pode?lij map? tutaj. Sprawdz? i spr?buje pom?c oraz dam Ci wskaz?wki jak b?d? umia? to naprawi?.

Podpis
Cześć
! :)


Projekt, który poruszy scenę platformy SA:MP!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:16


Pro-reklamowiec

Robię to co Lubię






Wiek: 32
Na forum: 5101 dni
Posty: 23
Nick w MP: Hardkor

Piwa: 9

Respekt: 50

chwilk? gdzie Ci to wys?a? mo?e na gg

Podpis
International Road Truck

Zapraszamy

IP: 213.189.52.62:7791
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:18


B!4CK

Never give UP!






Wiek: 32
Na forum: 5809 dni
Posty: 1047
Nick w MP: John

Piwa: 1891

Respekt: 124,2
Respekt: 124,2

wy?lij na prywatn? wiadomo??.

Podpis
Cześć
! :)


Projekt, który poruszy scenę platformy SA:MP!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:20


Pro-reklamowiec

Robię to co Lubię






Wiek: 32
Na forum: 5101 dni
Posty: 23
Nick w MP: Hardkor

Piwa: 9

Respekt: 50

trzymaj tu jest mapa http://uploadfg.pl/files/pp.pwn chyba to samo :)

[ Dodano: 2012-08-02, 12:23 ]
He he Sorka za b??d ju? ogarn??em po?ow? :D ale blackelegy dostajesz browara za ch?ci :D

[ Dodano: 2012-08-02, 12:25 ]
KURRRR znowu co? Si? *****?o wielkie sorry ju? wysy?am

Podpis
International Road Truck

Zapraszamy

IP: 213.189.52.62:7791
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:28


B!4CK

Never give UP!






Wiek: 32
Na forum: 5809 dni
Posty: 1047
Nick w MP: John

Piwa: 1891

Respekt: 124,2
Respekt: 124,2

Potrzebujesz odpowiedniego include strok :
Kod:

\pawno\include\strtok.inc
<- to jest b??d i on odpowiada za reszt?.

Podpis
Cześć
! :)


Projekt, który poruszy scenę platformy SA:MP!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:30


Cz3chu

Szary człowiek






Wiek: 28
Na forum: 5947 dni
Posty: 239
Nick w MP: Czechu

Piwa: 174

Respekt: 54,3

A warningi typu: warning 203: symbol is never used: "gangBank"

CTRL + F: gangBank i usu?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 12:38


Pro-reklamowiec

Robię to co Lubię






Wiek: 32
Na forum: 5101 dni
Posty: 23
Nick w MP: Hardkor

Piwa: 9

Respekt: 50

yhy spoko a masz poprawny strtok.inc

Podpis
International Road Truck

Zapraszamy

IP: 213.189.52.62:7791
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 13:27


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Usu? ten include strtok.inc z mapy oraz z folderu pawno/includes, oraz dodaj poni?szy kod na d?? mapki

Kod:

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 15:10


Pro-reklamowiec

Robię to co Lubię






Wiek: 32
Na forum: 5101 dni
Posty: 23
Nick w MP: Hardkor

Piwa: 9

Respekt: 50

Dzi?ki dzia?a ?ap :piwo: tylko teraz zosta?o jeszcze to

Kod:

C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(10445) : error 017: undefined symbol "strrest"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(10445) : error 033: array must be indexed (variable "String")
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(10899) : error 017: undefined symbol "strrest"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(10899) : error 033: array must be indexed (variable "BReason")
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(14099) : error 017: undefined symbol "strrest"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(14099) : error 033: array must be indexed (variable "Reason")
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19528) : error 021: symbol already defined: "strtok"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19543) : error 047: array sizes do not match, or destination array is too small
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19561) : warning 203: symbol is never used: "gActivePlayers"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19561) : warning 203: symbol is never used: "gLastGaveCash"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19561) : warning 203: symbol is never used: "gangBank"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19561) : warning 203: symbol is never used: "gangInfo"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19561) : warning 203: symbol is never used: "gangInvite"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19561) : warning 203: symbol is never used: "gangMembers"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19561) : warning 203: symbol is never used: "gangNames"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19561) : warning 203: symbol is never used: "playerGang"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


[ Dodano: 2012-08-02, 15:14 ]
Stary cz?owiek ?ap piwko pomog?o tylko jeszcze to

Kod:

C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(10428) : error 017: undefined symbol "strrest"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(10428) : error 033: array must be indexed (variable "String")
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(10882) : error 017: undefined symbol "strrest"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(10882) : error 033: array must be indexed (variable "BReason")
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(14082) : error 017: undefined symbol "strrest"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(14082) : error 033: array must be indexed (variable "Reason")
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19511) : error 021: symbol already defined: "strtok"
C:\DOCUME~1\PAWE~1\Pulpit\pp(2).pwn(19526) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.


Podpis
International Road Truck

Zapraszamy

IP: 213.189.52.62:7791
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-02, 17:20


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Wklej poni?szy kod na d?? mapki

Kod:

stock strrest(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[128];
while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}


Postaw piwo autorowi tego posta
 

 
Tagi: warny
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