28.01.2015, 16:45
Hello, I made money order (give money if you're offline / online) I did a check if the player is connected to give him money online (directly) and if offline to give him money.
I get two error:
(2490) error 035: argument type mismatch (argument 1)
(2496): error 035: argument type mismatch (argument 1)
I get two error:
(2490) error 035: argument type mismatch (argument 1)
(2496): error 035: argument type mismatch (argument 1)
PHP код:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return NotAdmin(playerid);
new Name[25], Reason[80], string[256], sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(sscanf(params, "s[25]s[80]", Name, Reason)) return SendClientMessage(playerid, COLOR_WHITE, "Use: /ban <playerid/name> <reason>");
if(IsPlayerConnected(Name))
{
if(PlayerInfo[playerid][pLanguage] == 1) { format(string, sizeof(string), "%s a primit ban de la adminul %s, motiv: %s.", Name, sendername, Reason); }
else if(PlayerInfo[playerid][pLanguage] == 2) { format(string, sizeof(string), "%s was banned from admin %s, reason: %s.", Name, sendername, Reason); }
SendClientMessageToAll(COLOR_CMD, string);
format(szQuery, sizeof(szQuery),"UPDATE `users` SET `Banned` = 1 WHERE `Username` = '%s'", Name), mysql_tquery(mysql, szQuery, "" , "");
Ban(Name);
}
else
{
mysql_format(mysql, szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `Username` = '%e' LIMIT 1;", Name);
new Cache:ez = mysql_query(mysql, szQuery);
if(cache_get_row_count() > 0)
{
format(szQuery, sizeof(szQuery),"UPDATE `users` SET `Banned` = '1' WHERE `Name` = '%s'", Name);
mysql_tquery(mysql, szQuery, "" , "" );
if(PlayerInfo[playerid][pLanguage] == 1) { format(string, sizeof(string), "%s(offline) a primit ban de la adminul %s, motiv: %s.", Name, sendername, Reason); }
else if(PlayerInfo[playerid][pLanguage] == 2) { format(string, sizeof(string), "%s(offline) was banned from admin %s, reason: %s.", Name, sendername, Reason); }
SendClientMessageToAll(COLOR_CMD, string);
}
else SendClientMessage(playerid, -1, "Acest cont nu exista in baza de date.");
cache_delete(ez);
}
return 1;
}