SA-MP Forums Archive
Invalid function call, "Expected token ";", but found ")" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Invalid function call, "Expected token ";", but found ")" (/showthread.php?tid=610567)



Invalid function call, "Expected token ";", but found ")" - justjamie - 25.06.2016

title

code:

PHP Code:
                        new query[256];
                        
format(querysizeof(query), "INSERT INTO Accounts (Username, regip,reggpci, Sex, Skin, Admin, Helper, Money, BankMoney, Level, Points, PayTime) VALUES ('%s', '%s','%s', '0', '60', '0', '0', '1250', '7750', '0', '0', '0')"Name(playerid), Ip(playerid),playerserial(playerid));
                        
mysql_tquery(connectionquery"emptyQuery"); 



Re: Invalid function call, "Expected token ";", but found ")" - Konstantinos - 25.06.2016

It is [playerid] not (playerid).


Re: Invalid function call, "Expected token ";", but found ")" - justjamie - 25.06.2016

Quote:
Originally Posted by Konstantinos
View Post
It is [playerid] not (playerid).
no
?


Re: Invalid function call, "Expected token ";", but found ")" - Konstantinos - 25.06.2016

Quote:
Originally Posted by justjamie
View Post
no
?
Unless you post how you defined "Name", "Ip" and "playerserial" nobody can guess. When I declared a 2D array and used parentheses to reproduce it, I get 2 errors: one for invalid function call and the other for expecting ";" but finding ")". Not sure if you get both at once.


Re: Invalid function call, "Expected token ";", but found ")" - AlonzoTorres - 25.06.2016

Quote:
Originally Posted by justjamie
View Post
title

code:

PHP Code:
                        new query[256];
                        
format(querysizeof(query), "INSERT INTO Accounts (Username, regip,reggpci, Sex, Skin, Admin, Helper, Money, BankMoney, Level, Points, PayTime) VALUES ('%s', '%s','%s', '0', '60', '0', '0', '1250', '7750', '0', '0', '0')"Name[playerid], Ip[playerid],playerserial[playerid]);
                        
mysql_tquery(connectionquery"emptyQuery"); 
Like that.


Re: Invalid function call, "Expected token ";", but found ")" - justjamie - 25.06.2016

Quote:
Originally Posted by AlonzoTorres
View Post
Like that.
doesnt work


Re: Invalid function call, "Expected token ";", but found ")" - WhiteGhost - 25.06.2016

Quote:
Originally Posted by AlonzoTorres
View Post
Like that.
Quote:
Originally Posted by justjamie
View Post
no
?
But he is Right.


Re: Invalid function call, "Expected token ";", but found ")" - Stinged - 25.06.2016

Show us how you declare Name, Ip and playerserial (Either functions or arrays)


Re: Invalid function call, "Expected token ";", but found ")" - justjamie - 26.06.2016

Quote:
Originally Posted by Stinged
View Post
Show us how you declare Name, Ip and playerserial (Either functions or arrays)
new playerserial[150];

(global string)


PHP Code:
/* ============================================================================= */
stock Name(playerid) {
    new 
name[25]; GetPlayerName(playeridname25);
    return 
name;
}
/* ============================================================================= */
stock Ip(playerid) {
    new 
ip[25]; GetPlayerIp(playeridip25);
    return 
ip;
}
/* ============================================================================= */ 



Re: Invalid function call, "Expected token ";", but found ")" - Sjn - 26.06.2016

Why not just use local arrays to grab names/ips? I find using functions for these stuff kinda useless. Or just store their name/ip in an array from player's enumerator.