05.01.2011, 10:18
i have /register commands on ZCMD
and i have this sh*t:
and when i'm typing
server showing me this message
Help me to solve this problem!
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;
}
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;
}
Код:
/register 123456(this is for example)
Код:
SERVER: /register 123456 - Unknown commands. Use /cmds To see all commands list!