Help in command ban offline
#1

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(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1) return NotAdmin(playerid);
    new 
Name[25], Reason[80], string[256], sendername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridsendernamesizeof(sendername));
    if(
sscanf(params"s[25]s[80]"NameReason)) return SendClientMessage(playeridCOLOR_WHITE"Use: /ban <playerid/name> <reason>");
    if(
IsPlayerConnected(Name))
    {
        if(
PlayerInfo[playerid][pLanguage] == 1) { format(stringsizeof(string), "%s a primit ban de la adminul %s, motiv: %s."NamesendernameReason); }
         else if(
PlayerInfo[playerid][pLanguage] == 2) { format(stringsizeof(string), "%s was banned from admin %s, reason: %s."NamesendernameReason); }
        
SendClientMessageToAll(COLOR_CMDstring);
        
format(szQuerysizeof(szQuery),"UPDATE `users` SET `Banned` = 1 WHERE `Username` = '%s'"Name), mysql_tquery(mysqlszQuery"" "");
        
Ban(Name);
    }
    else
    {
        
mysql_format(mysqlszQuerysizeof(szQuery), "SELECT * FROM `users` WHERE `Username` = '%e' LIMIT 1;"Name);
        new 
Cache:ez mysql_query(mysqlszQuery);
        if(
cache_get_row_count() > 0)
        {
              
format(szQuerysizeof(szQuery),"UPDATE `users` SET `Banned` = '1' WHERE `Name` = '%s'"Name);
             
mysql_tquery(mysqlszQuery"" "" );
            if(
PlayerInfo[playerid][pLanguage] == 1) { format(stringsizeof(string), "%s(offline) a primit ban de la adminul %s, motiv: %s."NamesendernameReason); }
            else if(
PlayerInfo[playerid][pLanguage] == 2) { format(stringsizeof(string), "%s(offline) was banned from admin %s, reason: %s."NamesendernameReason); }
            
SendClientMessageToAll(COLOR_CMDstring);
        }
        else 
SendClientMessage(playerid, -1"Acest cont nu exista in baza de date.");
        
cache_delete(ez);
    }
    return 
1;

Reply
#2

Can you be more specific ?
Which of the lines are 2490 and 2496 ?
Reply
#3

PHP код:
[2490]if(IsPlayerConnected(Name))
[
2496]Ban(Name); 
Reply
#4

IsPlayerConnected function expects playerid as pameterer, not name (string)
Same goes for Ban
Reply
#5

In this case what can I do? I want to make money offline / online directly in command / ban do not separate / ban and / banoff.
Reply
#6

Is this command about banning someone or to give them money when they're offline?
Reply
#7

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?
Reply
#8

[2490]if(IsPlayerConnected(playerid))
[2496]Ban(playerid);
Reply
#9

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.
Reply
#10

Is possible ?
help me, please!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)