[HELP]/register command error
#1

i have /register commands on ZCMD

pawn Код:
CMD:register(playerid,params[])
{
    new PlayerFolder[512],str[512],stradmin[512],strwarns[512],strkicks[512],strban[512],strdate[512],strpoints[512],strdeaths[512],strkills[512],strmoney[512],strbank[512],strlevel[512],year,month,day; getdate(year, month, day);
    if(sscanf(params,"s",PlayerInfo[playerid][Password])) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
    if(dini_Exists(PlayerFolder)) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: You allready registered.");
    dini_Create(PlayerFolder);
    dini_Set(PlayerFolder,"Password",MD5_Hash(PlayerInfo[playerid][Password]));
    format(PlayerFolder,sizeof(PlayerFolder),"/NexAdmin/Users/%s.nex",PlayerName(playerid));
    format(strdate,sizeof(strdate),"%d/%d/%d",day,month,year);
    format(strpoints,sizeof(strpoints),"0");
    format(strdeaths,sizeof(strdeaths),"0");
    format(strkills,sizeof(strkills),"0");
    format(strmoney,sizeof(strmoney),"0");
    format(strbank,sizeof(strbank),"50000");
    format(strlevel,sizeof(strlevel),"0");
    format(stradmin,sizeof(stradmin),"0");
    format(strwarns,sizeof(strwarns),"0");
    format(strkicks,sizeof(strkicks),"0");
    format(strban,sizeof(strban),"0");
    dini_Set(PlayerFolder,"RegDate",strdate);
    dini_Set(PlayerFolder,"Admin",stradmin);
    dini_Set(PlayerFolder,"Warns",strwarns);
    dini_Set(PlayerFolder,"Kicks",strkicks);
    dini_Set(PlayerFolder,"Banned",strban);
    dini_Set(PlayerFolder,"Points",strpoints);
    dini_Set(PlayerFolder,"Level",strlevel);
    dini_Set(PlayerFolder,"Kills",strkills);
    dini_Set(PlayerFolder,"Deaths",strdeaths);
    dini_Set(PlayerFolder,"Money",strmoney);
    dini_Set(PlayerFolder,"Bank",strbank);
    PlayerInfo[playerid][Logged] = 1;
    format(str,sizeof(str),"Nex'Admin: You has been succesfully registered with name %s and password %s. Use  /login [password] , to login.",PlayerName(playerid),PlayerInfo[playerid][Password]);
    SendClientMessage(playerid,0xFFFFFFAA,str);
    return 1;
}
and i have this sh*t:

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new gWrongCmd[128];
    format(gWrongCmd,sizeof(gWrongCmd),"SERVER: %s - Unknown commands. Use /cmds To see all commands list!",cmdtext);
    if(!success) SendClientMessage(playerid,0xFFFFFFAA,gWrongCmd);
    printf("%s typed command %s",PlayerName(playerid),cmdtext);
    return 1;
}
and when i'm typing
Код:
/register 123456(this is for example)
server showing me this message

Код:
SERVER: /register 123456 - Unknown commands. Use /cmds To see all commands list!
Help me to solve this problem!
Reply
#2

Change:
pawn Код:
if(sscanf(params,"s",PlayerInfo[playerid][Password]) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
To:
pawn Код:
if(sscanf(params,"u",PlayerInfo[playerid][Password])) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
Reply
#3

try this

pawn Код:
CMD:register(playerid,params[])
{
    if(sscanf(params,"u",PlayerInfo[playerid][Password]) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
    new PlayerFolder[512],str[512],strdate[512],year,month,day;
    getdate(year, month, day);
    format(PlayerFolder,sizeof(PlayerFolder),"/NexAdmin/Users/%s.nex",PlayerName(playerid));
    if(dini_Exists(PlayerFolder)) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: You allready registered.");
    dini_Create(PlayerFolder);
    dini_Set(PlayerFolder,"Password",MD5_Hash(PlayerInfo[playerid][Password]));
    format(strdate,sizeof(strdate),"%d/%d/%d",day,month,year);
   
    dini_Set(PlayerFolder,"RegDate",strdate);
    dini_IntSet(PlayerFolder,"Admin",0);
    dini_IntSet(PlayerFolder,"Warns",0);
    dini_IntSet(PlayerFolder,"Kicks",0);
    dini_IntSet(PlayerFolder,"Banned",0);
    dini_IntSet(PlayerFolder,"Points",0);
    dini_IntSet(PlayerFolder,"Level",0);
    dini_IntSet(PlayerFolder,"Kills",0);
    dini_IntSet(PlayerFolder,"Deaths",0);
    dini_IntSet(PlayerFolder,"Money",50000);
    dini_IntSet(PlayerFolder,"Bank",0);
    PlayerInfo[playerid][Logged] = 1;
    format(str,sizeof(str),"Nex'Admin: You has been succesfully registered with name %s and password %s. Use  /login [password] , to login.",PlayerName(playerid),PlayerInfo[playerid][Password]);
    SendClientMessage(playerid,0xFFFFFFAA,str);
    return 1;
}
Reply
#4

Quote:
Originally Posted by Clive
Посмотреть сообщение
Change:
pawn Код:
if(sscanf(params,"s",PlayerInfo[playerid][Password]) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
To:
pawn Код:
if(sscanf(params,"u",PlayerInfo[playerid][Password])) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
do not work but thanks anyway
Reply
#5

Quote:
Originally Posted by maxtorcd55
Посмотреть сообщение
try this

pawn Код:
CMD:register(playerid,params[])
{
    if(sscanf(params,"u",PlayerInfo[playerid][Password]) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
    new PlayerFolder[512],str[512],strdate[512],year,month,day;
    getdate(year, month, day);
    format(PlayerFolder,sizeof(PlayerFolder),"/NexAdmin/Users/%s.nex",PlayerName(playerid));
    if(dini_Exists(PlayerFolder)) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: You allready registered.");
    dini_Create(PlayerFolder);
    dini_Set(PlayerFolder,"Password",MD5_Hash(PlayerInfo[playerid][Password]));
    format(strdate,sizeof(strdate),"%d/%d/%d",day,month,year);
   
    dini_Set(PlayerFolder,"RegDate",strdate);
    dini_IntSet(PlayerFolder,"Admin",0);
    dini_IntSet(PlayerFolder,"Warns",0);
    dini_IntSet(PlayerFolder,"Kicks",0);
    dini_IntSet(PlayerFolder,"Banned",0);
    dini_IntSet(PlayerFolder,"Points",0);
    dini_IntSet(PlayerFolder,"Level",0);
    dini_IntSet(PlayerFolder,"Kills",0);
    dini_IntSet(PlayerFolder,"Deaths",0);
    dini_IntSet(PlayerFolder,"Money",50000);
    dini_IntSet(PlayerFolder,"Bank",0);
    PlayerInfo[playerid][Logged] = 1;
    format(str,sizeof(str),"Nex'Admin: You has been succesfully registered with name %s and password %s. Use  /login [password] , to login.",PlayerName(playerid),PlayerInfo[playerid][Password]);
    SendClientMessage(playerid,0xFFFFFFAA,str);
    return 1;
}
this is really working cool shit! Thank you very much
Reply
#6

Don't double post, There is a modify button
Rules
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)