SA-MP Forums Archive
Error 035: argument type mismatch (argument 1) - 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: Error 035: argument type mismatch (argument 1) (/showthread.php?tid=626575)



Error 035: argument type mismatch (argument 1) - fastayko - 17.01.2017

new NewName [MAX_PLAYERS] [128];

new query[150];
mysql_format(g_Sql, query, sizeof(query), "UPDATE `users` SET `username` = '%e' WHERE `username` = '%e' LIMIT 1", NewName[giveplayerid], PlayerName(giveplayer));// ERROR HERE
mysql_query(g_Sql, query);

format(string, sizeof(string), "%s.ini", PlayerName(giveplayer));//THE SAME ERROR HERE TOO


Re: Error 035: argument type mismatch (argument 1) - iLearner - 17.01.2017

MAX_PLAYER_NAME, not MAX_PLAYERS, and whats [128] for?


Re: Error 035: argument type mismatch (argument 1) - fastayko - 17.01.2017

i have rp server and if someone have non rp name he get dialog and after he write new name it get stored then admins have to accept/deny the name


Re: Error 035: argument type mismatch (argument 1) - iLearner - 17.01.2017

PHP код:
NewName[30// 30 is more than enough for a name 



Re: Error 035: argument type mismatch (argument 1) - fastayko - 17.01.2017

but i need [MAX_PLAYERS] like : new NewName [MAX_PLAYERS] [30]; bec new NewName [30]; just can store one name


Re: Error 035: argument type mismatch (argument 1) - FaLLenGirL - 17.01.2017

Quote:
Originally Posted by iLearner
Посмотреть сообщение
MAX_PLAYER_NAME, not MAX_PLAYERS, and whats [128] for?
iLearner said all you need to use.
MAX_PLAYERS is the define for how many can join your server.

PHP код:
EX#define MAX_PLAYERS 50. 
You must use what iLearner said..
PHP код:
NewNameMAX_PLAYER_NAME ]; 
Also if u want to let admins now if the player can change his name
you must create a function like: "ShowMessageToAdmins" or something,
that will show to all admins that dialog and they will be able to accept or decline that newname request.
And if a admin already accepted to show an ERROR, to the others admins if they press "ACCEPT"
that one of the admins has already accepted the newname request.

Use something like this in your function:
PHP код:
foreach(new iPlayer)
            if( 
PlayerInfo][ Level ] >= 
- for admins.

ALSO in my opinion the request that will be showed to admins it's not a good ideea.
Buddy if a player want to change his name, let him change his name without any ACCEPT from admins
use a system in your DB that stores all player names, if u don't have aka. Or create command AKA
and you'll show all the names of that player.