mysql error
#1

hi all,

I got a MySQL error, anyone know how to fix it?
Код:
C:\Users\-.-\Downloads\Compressed\Project Innovative\Project Innovative\Gamemode\Innovative.pwn(7583) : error 017: undefined symbol "va_return"
C:\Users\-.-\Downloads\Compressed\Project Innovative\Project Innovative\Gamemode\Innovative.pwn(7589) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Line
Код:
StringNumeric(const str[])
{
    for(new i = 0,ii = strlen(str);i < ii;i++)
    {
        if(str[i] > '9' || str[i] < '0') return 0;
    }
    return 1;
}
Reply
#2

try this:
pawn Код:
StringNumeric(const str[])
{
    for(new i = 0,ii = strlen(str);i < ii;i++)
    {
        if(str[i] > 9 || str[i] < 0) return 0;
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Eth
Посмотреть сообщение
try this:
pawn Код:
StringNumeric(const str[])
{
    for(new i = 0,ii = strlen(str);i < ii;i++)
    {
        if(str[i] > 9 || str[i] < 0) return 0;
    }
    return 1;
}
if u'd use decimal 9 and 0, the line is the same as:

if char > TAB OR char < NULL

thats not what we want here.
we want to detect numbers, starting from
decimal 48('0') to 57('9')

the correct way to do that would be
pawn Код:
StringNumeric(const str[])
{
    for(new i = 0,ii = strlen(str);i < ii;i++)
    {
        if(str[i] > '0' && str[i] < '9') return 1;
    }
    return 0;
}
pawn Код:
printf("str: %d",StringNumeric("tms"));
output "str: 0"
pawn Код:
printf("str: %d",StringNumeric("tm5s"));
output "str: 1"

also, instead of calling a function, why not use whats already there by default.
like EOS
the head with the new condition would look like
pawn Код:
for(new i = 0;str[i]!=EOS;i++)
and it'll still work the same, even faster ^^
not that it mathers though...
Reply
#4

i gave wrong the correct line
Код:
stock SendClientMessageEx(playerid, color, const form[], va_args<>)
	return SendClientMessage(playerid, color, va_return(form, va_start<3>));

stock SendClientMessageToAllEx(colour, const fmat[], va_args<>)
{
    new
        str[145];
    va_format(str, sizeof (str), fmat, va_start<2>);
    return SendClientMessageToAll(colour, str);
}
Sorry!
Reply
#5

How is this at all related to MySQL? I suggest you ask in the y_vars topic.
Reply
#6

uhm before I got a a_MySQL.inc which gave 26 errors and now my friend gave me a new one a_mysql which have only 2 errors so isn't it related to MySQL :/?
Reply
#7

None of these errors are related to the MySQL itself.
Reply
#8

hmm okay.. so you know how to fix them?plz?i need them?
Reply
#9

Like Vince said:

Quote:
Originally Posted by Vince
Посмотреть сообщение
How is this at all related to MySQL? I suggest you ask in the y_vars topic.
And also check the y_vars tutorials on the forums.
Reply
#10

okaywhats y_vars and where I can find it?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)