Help in command ban offline -
Edw - 28.01.2015
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)
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;
}
Re: Help in command ban offline -
Kaperstone - 28.01.2015
Can you be more specific ?
Which of the lines are 2490 and 2496 ?
Re: Help in command ban offline -
Edw - 28.01.2015
PHP код:
[2490]if(IsPlayerConnected(Name))
[2496]Ban(Name);
Re: Help in command ban offline -
DRIFT_HUNTER - 28.01.2015
IsPlayerConnected function expects playerid as pameterer, not name (string)
Same goes for Ban
Re: Help in command ban offline -
Edw - 28.01.2015
In this case what can I do? I want to make money offline / online directly in command / ban do not separate / ban and / banoff.
Re: Help in command ban offline -
Ironboy - 28.01.2015
Is this command about banning someone or to give them money when they're offline?
Re: Help in command ban offline -
Edw - 28.01.2015
I wanted to do a check online if you give money directly in the game and if you give him money offline offline (let's set the variable 'Banned': 1). I do not want to make two commands (/ ban (if online) and / banoff (if offline). So, it is possible to make money offline / online in one order?
Re: Help in command ban offline -
AdamsP - 28.01.2015
[2490]if(IsPlayerConnected(playerid))
[2496]Ban(playerid);
Re: Help in command ban offline -
Edw - 28.01.2015
You want to give him the money that wants to use this command?
)))
How do I check if the player is online (IsPlayerConnected (x) to give him money in the game and if i set the variable to offline.
Re: Help in command ban offline -
Edw - 28.01.2015
Is possible ?
help me, please!!