Jump to content
  • 0

pomoc HELP Chyby v pawno


Voldacz

Dotaz

Mám takový problém...V pawno sem si zkopíroval toto http://pastebin.com/z2YQJW1w a když dám F5 hází to 4 errory s Pawnem sem začátečník tak jestli by mi byl ochotnej helpnout

 

Ty errory jsou:

 

C:\Documents and Settings\Admin\Plocha\warpson.pwn(31) : error 001: expected token: "-string end-", but found "-identifier-"

C:\Documents and Settings\Admin\Plocha\warpson.pwn(31) : error 017: undefined symbol "al"

C:\Documents and Settings\Admin\Plocha\warpson.pwn(31) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Admin\Plocha\warpson.pwn(31) : fatal error 107: too many error messages on one line

 

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

4 Errors.

 

Link to comment
Share on other sites

14 odpovědí na tuto otázku

Recommended Posts

  • 0

Teď jsem to zkusil zmazat a už to píše jenom jeden error

 

C:\Documents and Settings\Admin\Plocha\warpson.pwn(0) : fatal error 100: cannot read from file: "C:\Documents and Settings\Admin\Plocha\warpson.pwn"

 

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

1 Error.

 

Link to comment
Share on other sites

  • 0

Díky moc a teď to zase píše todle

 

C:\Documents and Settings\Admin\Plocha\warpson.pwn(68) : warning 217: loose indentation

C:\Documents and Settings\Admin\Plocha\warpson.pwn(156) : warning 217: loose indentation

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

2 Warnings.

 

Link to comment
Share on other sites

  • 0
Díky moc a teď to zase píše todle

 

C:\Documents and Settings\Admin\Plocha\warpson.pwn(68) : warning 217: loose indentation

C:\Documents and Settings\Admin\Plocha\warpson.pwn(156) : warning 217: loose indentation

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

2 Warnings.

 

Hore do módu #pragma tabsize 0

Link to comment
Share on other sites

  • 0

Jestli to pomůže

 

/*

*

* QWER Warp System v1

* © by Denis 'QWER' Granec

* "Prišiel som, Videl som, Vyhral som..."

* "Najvae`ší okamžik života je úspech"

*

* Inštalácia:

* - Vo scriptfiles vytvorte zložku/priee`inok "Warps"

* - Na servery si dajte rcon cez "/rcon login heslo"

* - Postavte sa na miesto, kde chcete urobi? warp a dajte príkaz /cwarp [ nazov ] [ 0 - 1 ]

* - Ten posledný parameter ([ 0 - 1]) je e`i je to warp s autom (ak áno tak daj "1") alebo nie (ak nie tak daj "0")

* - Warp zmažeš príkazom /dwarp [ nazov ]

*/

 

#include

#define MAX_WARPS 50

#define MAX_WARP_NAME 25

 

new Float:WarpPos[MAX_WARPS][4];

new WarpCar[MAX_WARPS];

new WarpInterior[MAX_WARPS];

new WarpName[MAX_WARPS][MAX_WARP_NAME];

new WarpCount = -1;

 

stock CreateWarp(name[],Float:x,Float:y,Float:z,Float:a,int,car){

WarpCount++;

if(WarpCount >= MAX_WARPS){

print("------ QWER Warp System v1 ------");

printf("Bol prekroe`ený max (%d) poe`et warpov (%d)",MAX_WARPS,WarpCount);

print("Dalšie warpy sa nevytvorili");

print("------ QWER Warp System v1 ------");

}else{

format(WarpName[WarpCount],MAX_WARP_NAME,name);

WarpPos[WarpCount][0] = x;

WarpPos[WarpCount][1] = y;

WarpPos[WarpCount][2] = z;

WarpPos[WarpCount][3] = a;

WarpInterior[WarpCount] = int;

WarpCar[WarpCount] = car;

new bigstr[256];

format(bigstr,256,"%s %0.4f %0.4f %0.4f %0.4f %d %d\r\n",name,x,y,z,a,int,car);

new File:file = fopen("Warps/warpy.txt",io_append);

fwrite(file,bigstr);

fclose(file);

}

}

 

stock LoadWarps(){

new File:file;

if(!fexist("Warps/warpy.txt")){

file = fopen("Warps/warpy.txt",io_write);

fclose(file);

}else{

file = fopen("Warps/warpy.txt",io_read);

new str[128];

while(fread(file,str)){

WarpCount++;

sscanf(str,"sffffii",WarpName[WarpCount],WarpPos[WarpCount][0],WarpPos[WarpCount][1],WarpPos[WarpCount][2],WarpPos[WarpCount][3],WarpInterior[WarpCount],WarpCar[WarpCount]);

}

}

return true;

}

 

public OnFilterScriptInit()

{

LoadWarps();

return 1;

}

 

 

 

public OnPlayerCommandText(playerid, cmdtext[])

{

if(!strcmp(cmdtext,"/allwarps")){

new str[500],st[256];

for(new i; i <= WarpCount;i += 3){

format(st,256,"%s\t\t\t%s\t\t\t%s\n",WarpName,WarpName[i+1],WarpName[i+2]);

strcat(str,st);

}

ShowPlayerDialog(playerid,4999,0,"{FF0000}QWER{FFFFFF} Warp System",str,"Ok","");

return true;

}

 

if(!strcmp(cmdtext,"/cwarp",true,6)){

if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"Niesi admin !");

new name[MAX_WARP_NAME],car;

if(sscanf(cmdtext[6],"si",name,car)) return SendClientMessage(playerid,0xFF0000AA,"Použi: /cwarp [ NAZOV ] [ 0 - 1 ]");

if(strlen(name) >= MAX_WARP_NAME) return SendClientMessage(playerid,0xFF0000AA,"Príliš dlhý názov warpu !");

if(car > 1 || car < 0) return SendClientMessage(playerid,0xFF0000AA,"1 = Warp s autom | 0 = Warp bez auta !");

new c = GetPlayerVehicleID(playerid);

new Float:x,Float:y,Float:z,Float:a,int;

if(c > 0){

GetVehiclePos(c,x,y,z);

GetVehicleZAngle(c,a);

}else{

GetPlayerPos(playerid,x,y,z);

GetPlayerFacingAngle(playerid,a);

}

int = GetPlayerInterior(playerid);

CreateWarp(name,x,y,z,a,int,car);

SendClientMessage(playerid,0xFF0000AA,"Warp bol úspešne vytvorený");

new str[128];

if(car == 1) format(str,128,"Administrátor {FFFFFF}%s{FF0000} vytvoril warp s autom {FFFFFF}/%s",Jmeno(playerid),name);

else format(str,128,"Administrátor {FFFFFF}%s{FF0000} vytvoril warp bez auta {FFFFFF}/%s",Jmeno(playerid),name);

SendClientMessageToAll(0xFF0000FF,str);

return true;

}

 

if(!strcmp(cmdtext,"/dwarp",true,6)){

if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"Niesi admin !");

if(!cmdtext[7]) return SendClientMessage(playerid,0xFF0000AA,"Použi: /dwarp [ NAZOV ]");

if(DeleteLineFromText(cmdtext[7]) == 0) return SendClientMessage(playerid,0xFF0000AA,"Warp sa nenašiel");

SendClientMessage(playerid,0xFF0000AA,"Warp bol úspešne zmazaný");

for(new i; i <= WarpCount;i++){

if(!strcmp(cmdtext[7],WarpName)){

WarpCar = -1;

break;

}

}

new str[128];

format(str,128,"Administrátor {FFFFFF}%s{FF0000} zmazal warp {FFFFFF}/%s",Jmeno(playerid),cmdtext[7]);

SendClientMessageToAll(0xFF0000FF,str);

return true;

}

if(cmdtext[1]){

for(new i; i <= WarpCount;i++){

if(!strcmp(cmdtext[1],WarpName) && WarpCar != -1){

new car = GetPlayerVehicleID(playerid);

if(car > 0){

if(WarpCar == 0) return SendClientMessage(playerid,0xFF0000AA,"Nemôžeš by? v aute !");

SetVehiclePos(car,WarpPos[0],WarpPos[1],WarpPos[2]);

SetVehicleZAngle(car,WarpPos[3]);

LinkVehicleToInterior(car,WarpInterior);

SetPlayerInterior(playerid,WarpInterior);

new players = GetMaxPlayers();

for(new x; x < players;x++){

if(GetPlayerVehicleID(x) == car){

SetPlayerInterior(playerid,WarpInterior);

}}

new str[128];

format(str,128,"Hráe` {FFFFFF}%s{0000FF} sa teleportoval na {FFFFFF}/%s",Jmeno(playerid),cmdtext[1]);

SendClientMessageToAll(0x0000FFFF,str);

}else{

SetPlayerFacingAngle(playerid,WarpPos[3]);

SetPlayerInterior(playerid,WarpInterior);

SetPlayerPos(playerid,WarpPos[0],WarpPos[1],WarpPos[2]);

new str[128];

format(str,128,"Hráe` {FFFFFF}%s{0000FF} sa teleportoval na {FFFFFF}/%s",Jmeno(playerid),cmdtext[1]);

SendClientMessageToAll(0x0000FFAA,str);

}

return true;

}

}

}

return 0;

}

 

 

stock FindChar(str[],chars)

{

new len = strlen(str);

for(new i;i < len+1;i++){

if(str == chars) return i;

}

return false;

}

 

stock fcreate(file[])

{

if(fexist(file)) return false;

new File:cFile = fopen(file,io_write);

return fclose(cFile);

}

 

stock DeleteLineFromText(text[],bool:caps = true)

{

new nasiel;

new File:a = fopen("Warps/warpy.txt",io_read);

new str[128],str2[128];

format(str2,128,"%s.part","Warps/warpy.txt");

new File:b = fopen(str2,io_write);

new len2 = FindChar(str,' ')-1;

while(fread(a,str)){

if(!strfind(str,text,caps,len2)){

nasiel = 1;

continue;

}else{

fwrite(b,str);

}

}

fclose(a);

fremove("Warps/warpy.txt");

fclose(B);

b = fopen(str2,io_read);

fcreate("Warps/warpy.txt");

a = fopen("Warps/warpy.txt",io_write);

while(fread(b,str)){

fwrite(a,str);

}

fclose(a);

fclose(B);

fremove(str2);

return nasiel;

}

 

stock Jmeno(i){

new n[MAX_PLAYER_NAME];

GetPlayerName(i,n,MAX_PLAYER_NAME);

return n;

}

 

stock sscanf(string[], format[], {Float,_}:...)

{

#if defined isnull

if (isnull(string))

#else

if (string[0] == 0 || (string[0] == 1 && string[1] == 0))

#endif

{

return format[0];

}

#pragma tabsize 4

new

formatPos = 0,

stringPos = 0,

paramPos = 2,

paramCount = numargs(),

delim = ' ';

while (string[stringPos] && string[stringPos] <= ' ')

{

stringPos++;

}

while (paramPos < paramCount && string[stringPos])

{

switch (format[formatPos++])

{

case '\0':

{

return 0;

}

case 'i', 'd':

{

new

neg = 1,

num = 0,

ch = string[stringPos];

if (ch == '-')

{

neg = -1;

ch = string[++stringPos];

}

do

{

stringPos++;

if ('0' <= ch <= '9')

{

num = (num * 10) + (ch - '0');

}

else

{

return -1;

}

}

while ((ch = string[stringPos]) > ' ' && ch != delim);

setarg(paramPos, 0, num * neg);

}

case 'h', 'x':

{

new

num = 0,

ch = string[stringPos];

do

{

stringPos++;

switch (ch)

{

case 'x', 'X':

{

num = 0;

continue;

}

case '0' .. '9':

{

num = (num << 4) | (ch - '0');

}

case 'a' .. 'f':

{

num = (num << 4) | (ch - ('a' - 10));

}

case 'A' .. 'F':

{

num = (num << 4) | (ch - ('A' - 10));

}

default:

{

return -1;

}

}

}

while ((ch = string[stringPos]) > ' ' && ch != delim);

setarg(paramPos, 0, num);

}

case 'c':

{

setarg(paramPos, 0, string[stringPos++]);

}

case 'f':

{

 

new changestr[16], changepos = 0, strpos = stringPos;

while(changepos < 16 && string[strpos] && string[strpos] != delim)

{

changestr[changepos++] = string[strpos++];

}

changestr[changepos] = '\0';

setarg(paramPos,0,_:floatstr(changestr));

}

case 'p':

{

delim = format[formatPos++];

continue;

}

case '\'':

{

new

end = formatPos - 1,

ch;

while ((ch = format[++end]) && ch != '\'') {}

if (!ch)

{

return -1;

}

format[end] = '\0';

if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)

{

if (format[end + 1])

{

return -1;

}

return 0;

}

format[end] = '\'';

stringPos = ch + (end - formatPos);

formatPos = end + 1;

}

case 'u':

{

new

end = stringPos - 1,

id = 0,

bool:num = true,

ch;

while ((ch = string[++end]) && ch != delim)

{

if (num)

{

if ('0' <= ch <= '9')

{

id = (id * 10) + (ch - '0');

}

else

{

num = false;

}

}

}

if (num && IsPlayerConnected(id))

{

setarg(paramPos, 0, id);

}

else

{

#if !defined foreach

#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))

#define __SSCANF_FOREACH__

#endif

string[end] = '\0';

num = false;

new

name[MAX_PLAYER_NAME];

id = end - stringPos;

foreach (Player, playerid)

{

GetPlayerName(playerid, name, sizeof (name));

if (!strcmp(name, string[stringPos], true, id))

{

setarg(paramPos, 0, playerid);

num = true;

break;

}

}

if (!num)

{

setarg(paramPos, 0, INVALID_PLAYER_ID);

}

string[end] = ch;

#if defined __SSCANF_FOREACH__

#undef foreach

#undef __SSCANF_FOREACH__

#endif

}

stringPos = end;

}

case 's', 'z':

{

new

i = 0,

ch;

if (format[formatPos])

{

while ((ch = string[stringPos++]) && ch != delim)

{

setarg(paramPos, i++, ch);

}

if (!i)

{

return -1;

}

}

else

{

while ((ch = string[stringPos++]))

{

setarg(paramPos, i++, ch);

}

}

stringPos--;

setarg(paramPos, i, '\0');

}

default:

{

continue;

}

}

while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')

{

stringPos++;

}

while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))

{

stringPos++;

}

paramPos++;

}

do

{

if ((delim = format[formatPos++]) > ' ')

{

if (delim == '\'')

{

while ((delim = format[formatPos++]) && delim != '\'') {}

}

else if (delim != 'z')

{

return delim;

}

}

}

while (delim > ' ');

return 0;

}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...