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

Wysłany: 2008-11-18, 14:41


KOSA_Red







Wiek: 35
Na forum: 6693 dni
Posty: 7

Piwa: 48

Respekt: 50

Ostrzeżeń: 40%
Terazz jest 26eroor?w i powyzej 30 waring?w ....

Podpis
CHCESZ MIEC ZIME STULECIA ?? WEJDZ NA http://www.robimy-balwana.yoyo.pl/
Jestem młody w pawno!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 14:47


BraYaN_







Wiek: 34
Na forum: 6698 dni
Posty: 276
Nick w MP: BraYaN_

Piwa: 1614

Respekt: 63

KOSA_Red, bo brak kalmry daj na ko?cu kod jeszcze } ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 15:17


Mayke512







Wiek: 32
Na forum: 6698 dni
Posty: 48

Piwa: 3022

Respekt: 50

Ostrzeżeń: 100%
Cze??
Komenda /heal + wy??cznik/w??cznik

Kod:

new blokujkomende;

if(strcmp(cmdtext, "/on", true)==0) { // komenda na w??czenie komendy
if(IsPlayerAdmin(playerid)){ // definicja, ?e co? jest tylko dla admina
blokujkomende=0; // wlacza komende
SendClientMessage(playerid, KOLOR_ZOLTY, "Wy??czy?e? mo?liwo?? wpisywania komendy /heal");
return 1;
}

if(strcmp(cmdtext, "/off", true)==0) { // komenda na wy??czenie komendy
if(IsPlayerAdmin(playerid)){ // definicja, ?e co? jest tylko dla admina
blokujkomende=1; // wylacza komend?
SendClientMessage(playerid, KOLOR_ZOLTY, "W??czy?e? mo?liwo?? wpisywania komendy /heal");
return 1;
}

if(strcmp(cmdtext, "/heal", true)==0) { // komenda na spawn pojazdu barracks
if(blokujkomende==1){ // aktualnie komenda jest w??czona
SendClientMessage(playerid, KOLOR_CZERWONY, "Ta komenda jest aktualnie wy??czona, skontaktuj si? z Administratorem."); // je?li wy??czona
return 1;
}
SetPlayerHealth(playerid, 100.0); // daje 100 hp
SendClientMessage(playerid, KOLOR_ZOLTY, "Uzdrowi?e? si?"); // wy?wietla tekst na chacie
return 1;
}


error + 2 warrings:
Kod:


C:\Documents and Settings\Grand Theft Auto\Pulpit\komendy\funkcje.pwn(97) : warning 217: loose indentation
C:\Documents and Settings\Grand Theft Auto\Pulpit\komendy\funkcje.pwn(143) : warning 217: loose indentation
C:\Documents and Settings\Grand Theft Auto\Pulpit\komendy\funkcje.pwn(147) : error 030: compound statement not closed at the end of file (started at line 100)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 15:23


BraYaN_







Wiek: 34
Na forum: 6698 dni
Posty: 276
Nick w MP: BraYaN_

Piwa: 1614

Respekt: 63

Mayke512, podaj linijk? z b??dem a te dwa warningi likwidujesz daj?c na g?rze moda/skryptu
Kod:

#pragma tabsize 0
;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 15:25


Mayke512







Wiek: 32
Na forum: 6698 dni
Posty: 48

Piwa: 3022

Respekt: 50

Ostrzeżeń: 100%
BraYaN_, fakt zapomnia?em ;]
A ten error?
Kod:

error 030: compound statement not closed at the end of file (started at line 101)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 15:28


BraYaN_







Wiek: 34
Na forum: 6698 dni
Posty: 276
Nick w MP: BraYaN_

Piwa: 1614

Respekt: 63

Mayke512, podaj linijk? z b??dem

Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 15:30


Mayke512







Wiek: 32
Na forum: 6698 dni
Posty: 48

Piwa: 3022

Respekt: 50

Ostrzeżeń: 100%
Aha...
Tej linijki nie ma lol

Skrypt ma 147 a to jest 148-ma

Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 15:33


BraYaN_







Wiek: 34
Na forum: 6698 dni
Posty: 276
Nick w MP: BraYaN_

Piwa: 1614

Respekt: 63

Mayke512,
Cytat:

new blokujkomende;

if(strcmp(cmdtext, "/on", true)==0) { // komenda na w??czenie komendy
if(IsPlayerAdmin(playerid)){ // definicja, ?e co? jest tylko dla admina
blokujkomende=0; // wlacza komende
SendClientMessage(playerid, KOLOR_ZOLTY, "Wy??czy?e? mo?liwo?? wpisywania komendy /heal");
return 1;
}

if(strcmp(cmdtext, "/off", true)==0) { // komenda na wy??czenie komendy
if(IsPlayerAdmin(playerid)){ // definicja, ?e co? jest tylko dla admina
blokujkomende=1; // wylacza komend?
SendClientMessage(playerid, KOLOR_ZOLTY, "W??czy?e? mo?liwo?? wpisywania komendy /heal");
return 1;
}

if(strcmp(cmdtext, "/heal", true)==0) { // komenda na spawn pojazdu barracks
if(blokujkomende==1){ // aktualnie komenda jest w??czona
SendClientMessage(playerid, KOLOR_CZERWONY, "Ta komenda jest aktualnie wy??czona, skontaktuj si? z Administratorem."); // je?li wy??czona
return 1;
}
SetPlayerHealth(playerid, 100.0); // daje 100 hp
SendClientMessage(playerid, KOLOR_ZOLTY, "Uzdrowi?e? si?"); // wy?wietla tekst na chacie
return 1;

} //// coto komenda czy co ??Niema { aby? zamkn?? i da? return 1 ;)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 15:39


Mayke512







Wiek: 32
Na forum: 6698 dni
Posty: 48

Piwa: 3022

Respekt: 50

Ostrzeżeń: 100%
BraYaN_, mulisz si? :P
Ta cz??? jest dobrze

Ju? sam si? kapn??em :)
W if(IsPlayerAdmin(playerid)) by?a na ko?cu klamra (nie powinno jej by?)

By?o tak:
Kod:

if(IsPlayerAdmin(playerid)) {


Ma by? tak:
Kod:

if(IsPlayerAdmin(playerid))


[ Dodano: 2008-11-18, 15:42 ]
Nast?pny problem.
Poni?sza komenda daje 100hp oraz wy?wietla gracz [nick]... z tym [nick] jest problem...
Kod:


if(strcmp(cmdtext, "/100hp", true) == 0)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name, sizeof(name));
format(string, sizeof(string), "- %s uzdrowi? si? za 5000$. -",name);
SetPlayerHealth(playerid, 100);
SendClientMessageToAll(0xFF8A00AA,string);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid, -5000);
return 1;
}


Kod:

C:\Documents and Settings\Grand Theft Auto\Pulpit\komendy\funkcje.pwn(130) : error 017: undefined symbol "string"
C:\Documents and Settings\Grand Theft Auto\Pulpit\komendy\funkcje.pwn(130) : error 017: undefined symbol "string"
C:\Documents and Settings\Grand Theft Auto\Pulpit\komendy\funkcje.pwn(130) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Grand Theft Auto\Pulpit\komendy\funkcje.pwn(130) : fatal error 107: too many error messages on one line

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


4 Errors.



Jak ju? wspomnia?em b??d jest tutaj:
Kod:

format(string, sizeof(string), "- %s uzdrowi? si? za 5000$. -",name);


Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 15:47


BraYaN_







Wiek: 34
Na forum: 6698 dni
Posty: 276
Nick w MP: BraYaN_

Piwa: 1614

Respekt: 63

Mayke512, new string[256]; ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 16:36


Mayke512







Wiek: 32
Na forum: 6698 dni
Posty: 48

Piwa: 3022

Respekt: 50

Ostrzeżeń: 100%
Dzi?ki BraYaN_, ?le dzi? zemn?.. nie my?le...
Jeszcze jedno pytanie.
// sorry ?e tak tu spamie ale musz? na 18.00 to umie?...

/lock & /unlock (pojazdy)

Kod:

if (strcmp(cmdtext, "/lock", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GREY,"You can only lock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
}
}
SendClientMessage(playerid, COLOR_GREY, "Vehicle locked!");
GetPlayerPos(playerid,X,Y,Z);
PlayerPlaySound(playerid,1056,X,Y,Z);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle!");
}
return 1;
}

if (strcmp(cmdtext, "/unlock", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GREY,"You can only unlock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
}
SendClientMessage(playerid, COLOR_GREY, "Vehicle unlocked!");
GetPlayerPos(playerid,X,Y,Z);
PlayerPlaySound(playerid,1057,X,Y,Z);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle!");
}
return 1;
}


Na dole mapy, skryptu:

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;
}


Wklejcie sobie do pawn, bo za du?o tych error?w jest, ?eby tu pisa? (to nie jest kwestia klamry)

PS: Tam ma by? jeszcze return 0; } ale to wiadomo...


Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 18:27


KOSA_Red







Wiek: 35
Na forum: 6693 dni
Posty: 7

Piwa: 48

Respekt: 50

Ostrzeżeń: 40%
Kod:

public Gang(playerid) {
new string[256];
new playername[MAX_PLAYER_NAME];
new gangnum = playerGang[playerid];

if(gangnum > 0) {
for(new i = 0; i < gangInfo[gangnum][1]; i++) {
if(gangMembers[gangnum][i]==playerid) {

//One less gang member
gangInfo[gangnum][1]--;

for(new j = i; j < gangInfo[gangnum][1]; j++) {
//Shift gang members
gangMembers[gangnum][j]=gangMembers[gangnum][j+1];
}

//Disband gang if no more members
if(gangInfo[gangnum][1]<1) {
gangInfo[gangnum][0]=0;
gangInfo[gangnum][1]=0;
gangBank[gangnum]=0;
}

//Notify other members
for(new j = 0; j < gangInfo[gangnum][1]; j++) {
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string),"%s Odszed? z gangu", playername);
SendClientMessage(gangMembers[gangnum][j], COLOR_ORANGE, string);
}

format(string, sizeof(string),"odszed?es z gangu '%s' (id: %d)", gangNames[gangnum], gangnum);
SendClientMessage(playerid, COLOR_ORANGE, string);

playerGang[playerid]=0;
}
SetPlayerColor(playerid,playerColors[playerid]);
return 1;
}
}
} else {
SendClientMessage(playerid, COLOR_RED, "Nie Jeste? w Gangu");
}
}
}
}
}


Poprawisz to ?? bede bardzo wdzieczny :] oraz 5x :piwo: dostaniesz

Podpis
CHCESZ MIEC ZIME STULECIA ?? WEJDZ NA http://www.robimy-balwana.yoyo.pl/
Jestem młody w pawno!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 19:02


BraYaN_







Wiek: 34
Na forum: 6698 dni
Posty: 276
Nick w MP: BraYaN_

Piwa: 1614

Respekt: 63

Kod:

2/4/5

Wys?any: Dzisiaj 18:27

Kod:
public Gang(playerid) {
new string[256];
new playername[MAX_PLAYER_NAME];
new gangnum = playerGang[playerid];

if(gangnum > 0) {
for(new i = 0; i < gangInfo[gangnum][1]; i++) {
if(gangMembers[gangnum][i]==playerid) {

//One less gang member
gangInfo[gangnum][1]--;

for(new j = i; j < gangInfo[gangnum][1]; j++) {
//Shift gang members
gangMembers[gangnum][j]=gangMembers[gangnum][j+1];
}

//Disband gang if no more members
if(gangInfo[gangnum][1]<1) {
gangInfo[gangnum][0]=0;
gangInfo[gangnum][1]=0;
gangBank[gangnum]=0;
}

//Notify other members
for(new j = 0; j < gangInfo[gangnum][1]; j++) {
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string),"%s Odszed? z gangu", playername);
SendClientMessage(gangMembers[gangnum][j], COLOR_ORANGE, string);
}

format(string, sizeof(string),"odszed?es z gangu '%s' (id: %d)", gangNames[gangnum], gangnum);
SendClientMessage(playerid, COLOR_ORANGE, string);

playerGang[playerid]=0;
}
SetPlayerColor(playerid,playerColors[playerid]);
return 1;
}
} else {
SendClientMessage(playerid, COLOR_RED, "Nie Jeste? w Gangu");
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 19:25


STEEV







Wiek: 32
Na forum: 6533 dni
Posty: 8



Respekt: 50

Ostrzeżeń: 20%
siemka, robie swoja pierwsza baze (DM)
I robie bramy na komende
I wyskakuje mi blad
Cytat:

C:\Documents and Settings\xxx\Pulpit\baza by RKS.pwn(50) : error 029: invalid expression, assumed zero
C:\Documents and Settings\xxx\Pulpit\baza by RKS.pwn(50) : error 004: function "OnPlayerCommandText" is not implemented
C:\Documents and Settings\xxx\Pulpit\baza by RKS.pwn(52) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\xxx\Pulpit\baza by RKS.pwn(59) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\xxx\Pulpit\baza by RKS.pwn(66) : error 001: expected token: "}", but found "-end of file-"
Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase


5 Errors.

A o to linijki w ktorych sa bledy
Cytat:

public OnPlayerCommandText(playerid, cmdtext[])
if (strcmp("/open",cmdtext, true, 10) == 0
if (strcmp("/close", cmdtext, true, 10) == 0 )

linijki 66 niemam
Prosze o pomoc

Postaw piwo autorowi tego posta
 

 
Wysłany: 2008-11-18, 21:56


BraYaN_







Wiek: 34
Na forum: 6698 dni
Posty: 276
Nick w MP: BraYaN_

Piwa: 1614

Respekt: 63

STEEV, lol
Kod:

public OnPlayerCommandText(playerid, cmdtext[]){

if(strcmp(cmdtext, "/open", true) == 0) {

if(strcmp(cmdtext, "/close", true) == 0) {{

i na g?rze OnPlayerCommandText daj
Kod:

cmd = strtok(cmdtext, idx);
;)

Postaw piwo autorowi tego posta
 

 
Tagi: błędy :: przy :: kompilacji :: rozwiązanie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » BŁĘDY PRZY KOMPILACJI - ROZWIĄZANIE Odpowiedz do tematu

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