PDA

View Full Version : Help with errors fast please


VIP475
26/08/2012, 06:29 PM
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27565) : error 017: undefined symbol "isNumeric"
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 017: undefined symbol "string"
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : fatal error 107: too many error messages on one line

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


5 Errors.

Lines:


if(!strlen(inputtext) || !isNumeric(inputtext) || strval(inputtext)<=0) return ShowPlayerDialog(playerid,DIALOGCOSTOGARA,DIALOG_S TYLE_INPUT,"Race's Coste","{FFFFFF}Pon el coste de la carrera (min 1):","Continuar",""); // 27565


IsNumeric(const string[]) // 27575

TaLhA XIV
26/08/2012, 06:31 PM
And try defining string like new string[//as many call you need//]

if(!strlen(inputtext) || !IsNumeric(inputtext) || strval(inputtext)<=0) return ShowPlayerDialog(playerid,DIALOGCOSTOGARA,DIALOG_S TYLE_INPUT,"Race's Coste","{FFFFFF}Pon el coste de la carrera (min 1):","Continuar",""); // 27565


IsNumeric(const string[]) // 27575

Dan.
26/08/2012, 06:31 PM
Seems like you are missing the IsNumeric stock in your gamemode:
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}

And also seems you didn't make a new string, give us some code around the error lines.

E:// The previous poster was right, IsNumeric starts with a capital I.

VIP475
26/08/2012, 06:48 PM
I still dont get what you mean with string..

C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 017: undefined symbol "string"
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : 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.



--

Lines:

if(dialogid==DIALOGCOSTOGARA)
{
if(!strlen(inputtext) || !IsNumeric(inputtext) || strval(inputtext)<=0) return ShowPlayerDialog(playerid,DIALOGCOSTOGARA,DIALOG_S TYLE_INPUT,"Race's Coste","{FFFFFF}Pon el coste de la carrera (min 1):","Continuar","");
format(stringa,sizeof(stringa),"Races/Race%d.txt",Giocatore[playerid][GaraEditorId]);
new File:nomegara=fopen(stringa, io_append);
GetPlayerName(playerid,nome,sizeof(nome));
format(stringa,sizeof(stringa),"%d,1000,Nobody,%s",strval(inputtext),nome);
fwrite(nomegara,stringa);
fclose(nomegara);
ShowPlayerDialog(playerid,DIALOGINSEGUIMENTO,DIALO G_STYLE_INPUT,"Chase opción","{FFFFFF}¿Quieres que la carrera sea tipo persecución?\n(Tipea Si o No)","Continuar","");
return 1;
}
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
}

Dan.
26/08/2012, 06:53 PM
Why do you even need the IsNumeric thing there? Just remove it or put it into a stock.

TaLhA XIV
26/08/2012, 06:59 PM
Try defining string as I said above.

Roko_foko
26/08/2012, 07:04 PM
Check for caps... it's not isNumeric but IsNumeric

VIP475
26/08/2012, 07:07 PM
Why do you even need the IsNumeric thing there? Just remove it or put it into a stock.

its for race..

Couldnt someone fix that code i gave for me and put it as [pawn] ?.. Thanks..

Dan.
26/08/2012, 07:10 PM
Just make a stock then?
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
}

VIP475
26/08/2012, 07:36 PM
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 017: undefined symbol "string"
C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : 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.


Could anyone fix "string" for me ? and also this C:\Documents and Settings\Admin\Desktop\freeroamEN.pwn(27575) : error 029: invalid expression, assumed zero

TaLhA XIV
26/08/2012, 07:37 PM
Why are you not defining stringnew string[258]

Dan.
26/08/2012, 07:38 PM
If you make the stock, then delete the function you have there near line 27575.