error 035: argument type mismatch (argument 3)
#1

Hi,
I think i'm doing something wrong here. Check the codes and errors.

Код:
    if (dUserINT(PlayerName2(playerid)).("Banned") == 1)
    {
		new year,month,day; getdate(year, month, day);
		new reason[128];
		new tmp[128];
		new player1;
        new playername[MAX_PLAYER_NAME];
        new adminname [MAX_PLAYER_NAME];
        player1 = strval(tmp);
		GetPlayerName(player1, playername, sizeof(playername));
		GetPlayerName(playerid, adminname, sizeof(adminname));
		new String[500];
		strcat(String, "You are banned from this server :\n\n");
        strcat(String, "{FF0000}» Account Name : %s\n", playername); ///line : 738
        strcat(String, "{FF0000}» Banned by : %s\n", adminname);  ///line : 739
        strcat(String, "{FF0000}» Reason : %s\n", reason); ///line : 740
        strcat(String, "{FF0000}» Ban Date : %d/%d/%d\n",day,month,year); ///line : 741
        /////////////////////////////////////////////////////////////////////////////////////////
		dUserSetINT(PlayerName2(player1)).("Banned",1);
		dUserSet(PlayerName2(player1)).("BannedBy",adminname);
		dUserSet(PlayerName2(player1)).("BannedReason",reason);
		format(str,sizeof(str),"%d/%d/%d",year, month, day);
        dUserSet(PlayerName2(player1)).("BannedDate",str);
        /////////////////////////////////////////////////////////////////////////////////////////
        ShowPlayerDialog(playerid,15576,DIALOG_STYLE_MSGBOX,"{FF0000}Account banned!",String,"Ok","");
		format(string,sizeof(string),"[ Player %s (Id: %d) has beenAutomatically  Kicked. | Reason: Ban Evade. ]",PlayerName,playerid);
		SendClientMessageToAll(red, string);  print(string);
		SaveIn("KickLog",string);  Kick(playerid);
    }
Errors :

Код:
(738) : error 035: argument type mismatch (argument 3)
(739) : error 035: argument type mismatch (argument 3)
(740) : error 035: argument type mismatch (argument 3)
(741) : warning 202: number of arguments does not match definition
(741) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Error.
And kindly please check the codes. i don't think so they are correct.
Reply
#2

I banned myself to test.
When i reconnect, dialog doesn't appear of my ban.
Reply
#3

Argument mismatch means that you're passing the wrong arguments through a function.

E.g passing a string when you're meant to be passing an integer.
Reply
#4

so how it should be like :c?
Reply
#5

Anyone else please??
Reply
#6

The rest of the code is called properly?

Maybe you are being kicked before the dialog can be shown.
Reply
#7

Sigh. I doubt I have coded it completely wrong.
Just tell me how can I make a dialog onplayerconnect if he is ban with :

Banned by :
Account name :
Reason :
Ban date :
Reply
#8

Sigh...
How have none of you spotted it

PHP код:
 strcat(String"{FF0000}» Account Name : %s\n"playername); ///line : 738 
INTO....

PHP код:
new dialogstr[4500]; // ANY WHERE AT THE TOP OF YOUR GAMEMODE 
PHP код:
dialogstr[0] = 0;
strcat(dialogstr,String,sizeof(dialogstr));
ShowPlayerDialog(target15576DIALOG_STYLE_MSGBOX"{FF0000}You're banned!"dialogstr"Okay"""); 
The below code SHOULD work fine...

Following YOU PUT THE CODE BELOW IN YOUR GAMEMODE...
PHP код:
new dialogstr[4500]; 
PHP код:
if (dUserINT(PlayerName2(playerid)).("Banned") == 1) {
    new 
year,month,daygetdate(yearmonthday);
    new 
reason[128], tmp[128], player1;
    new 
playername[MAX_PLAYER_NAME], adminname [MAX_PLAYER_NAME];
    
player1 strval(tmp);
    
GetPlayerName(player1playernamesizeof(playername));
    
GetPlayerName(playeridadminnamesizeof(adminname));
    
dialogstr[0] = 0;
    new 
string[500];
    
format(stringsizeof(string), "You are banned from this server :\n\n");
    
strcat(dialogstrstringsizeof(dialogstr));
    
format(stringsizeof(string), "{FF0000}» Account Name : %s\n"playername);
    
strcat(dialogstrstringsizeof(dialogstr));
    
format(stringsizeof(string), "{FF0000}» Banned by : %s\n"adminname);
    
strcat(dialogstrstringsizeof(dialogstr));
    
format(stringsizeof(string), "{FF0000}» Reason: %s\n"reason);
    
strcat(dialogstrstringsizeof(dialogstr));
    
format(stringsizeof(string), "{FF0000}» Ban Date : %d/%d/%d\n"daymonthyear);
    
strcat(dialogstrstringsizeof(dialogstr));
    
dUserSetINT(PlayerName2(player1)).("Banned",1);
    
dUserSet(PlayerName2(player1)).("BannedBy",adminname);
    
dUserSet(PlayerName2(player1)).("BannedReason",reason);
    
format(string,sizeof(string),"%d/%d/%d",yearmonthday);
    
dUserSet(PlayerName2(player1)).("BannedDate",string);
    
ShowPlayerDialog(playerid,15576,DIALOG_STYLE_MSGBOX,"{FF0000}Account banned!",dialogstr,"Ok","");
    
format(string,sizeof(string),
    
format(stringsizeof(string), "[ Player %s (Id: %d) has beenAutomatically  Kicked. | Reason: Ban Evade. ]",PlayerName,playerid);
    
SendClientMessageToAll(redstring);  print(string);
    
SaveIn("KickLog",string);  Kick(playerid);

MADE A couple edits...
I use "msg" an forgot you're using string
Reply
#9

Код:
(756 -- 757) : error 035: argument type mismatch (argument 3)
Код:
    format(string,sizeof(string), ///756
    format(string, sizeof(string), "[ Player %s (Id: %d) has beenAutomatically  Kicked. | Reason: Ban Evade. ]",PlayerName,playerid); ///757
Reply
#10

anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)