SA-MP Forums Archive
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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: argument type mismatch (argument 1) (/showthread.php?tid=96281)



argument type mismatch (argument 1) - Justsmile - 07.09.2009

Where is the error?
[pwn] tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /email [accountname] [password]");
return 1;
}
new accountname = strval(tmp);
if(strlen(accountname) < 3 || strlen(accountname) > 10) { SendClientMessage(playerid, COLOR_GRAD2, " Your name MUST have 3 words and not ore than 10 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /email [accountname] [password]");
return 1;
}
new accountpass = strval(tmp);
if(strlen(accountpass) < 5 && strlen(accountpass) > 15) { SendClientMessage(playerid, COLOR_GRAD2, " You password MUST have 5 words and not more than 15 !"); return 1; }
PlayerInfo[playerid][pAccountMailName] = accountname;
PlayerInfo[playerid][pAccountMailPass] = accountpass;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have created your E-mail Account.");
format(string, sizeof(string), "Account: %s, Password: %d",PlayerInfo[playerid][pAccountMailName], PlayerInfo[playerid][pAccountMailPass]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;[/pwn]


Re: argument type mismatch (argument 1) - dice7 - 07.09.2009

And on which line ?
And use
Код:
[pwn]stuff[/pwn]



Re: argument type mismatch (argument 1) - Justsmile - 07.09.2009

This Line

if(strlen(accountname) < 3 || strlen(accountname) > 10) { SendClientMessage(playerid, COLOR_GRAD2, " Your name MUST have 3 words and not ore than 10 !"); return 1; }


Re: argument type mismatch (argument 1) - Sdhoirm - 07.09.2009

What is the error?

pawn Код:
tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /email [accountname] [password]");
         return 1;
        }
        new accountname = strval(tmp);
        if(strlen(accountname) < 3 || strlen(accountname) > 10) { SendClientMessage(playerid, COLOR_GRAD2, "  Your name MUST have 3 words and not ore than 10 !"); return 1; }
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /email [accountname] [password]");
         return 1;
        }
        new accountpass = strval(tmp);
        if(strlen(accountpass) < 5 && strlen(accountpass) > 15) { SendClientMessage(playerid, COLOR_GRAD2, "  You password MUST have 5 words and not more than 15 !"); return 1; }
        PlayerInfo[playerid][pAccountMailName] = accountname;
        PlayerInfo[playerid][pAccountMailPass] = accountpass;
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have created your E-mail Account.");
        format(string, sizeof(string), "Account: %s, Password: %d",PlayerInfo[playerid][pAccountMailName], PlayerInfo[playerid][pAccountMailPass]);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        return 1;
Edit: Ooops, error msg in subject


Re: argument type mismatch (argument 1) - dice7 - 07.09.2009

Strlen gets a lengh of a string and accountname is an integer in your case. Just do if(accountname < 3)


Re: argument type mismatch (argument 1) - Justsmile - 07.09.2009

Thx, works.