sscanf character
#1

I need this command transfered into sscanf so you can type a password when u register -.- please someone help

Код:
CMD:register(playerid, params[])
{
    new file[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    format(file,sizeof(file),"Admin/Accounts/%s.txt",name);
    if(dini_Exists(file)) return SendClientMessage(playerid,RED,">> Your Already Registered!");
    if(pInfo[playerid][Registered] == 1) return SendClientMessage(playerid,RED,">> Your Already Registered!");
    if(pInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,RED,">> Your Already Registered And Logged In!");
    if(strlen(params) == 0) return SendClientMessage(playerid,RED,"USAGE: /register [password]");//This line
    {
        if(!dini_Exists(file))
        {
            dini_Create(file);
            dini_Set(file,"Password",params);
            dini_IntSet(file,"Registered",1);
            dini_IntSet(file,"LoggedIn",0);
            dini_IntSet(file,"Level",0);
            dini_IntSet(file,"Score",0);
            dini_IntSet(file,"Money",0);
            SendClientMessage(playerid,YELLOW,">> You Have Successfully Registered! Please /login");
            pInfo[playerid][Registered] = 1;
            return true;
        }
	}
    return true;
}
do i just change it to:

Код:
if(sscanf(params, "c")) return SendClientMessage(playerid,RED,"USAGE: /register [pass]");
??

This dont look right to me :S

please help
Reply
#2

You do not need to use sscanf as there is only one parameter, password.
Reply
#3

it registers without password :S when i type /register it dnt show usage it registers :S

Any help?
Reply
#4

try and see if this works:
Код:
    if(strlen(params) == 0) return SendClientMessage(playerid,RED,"USAGE: /register [password]");//This line
	else // add else here
    {
Reply
#5

that dnt work i tried it with the scanf but when i type a password it still shows usage? :S

Any help
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)