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;
}
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!
if(sscanf(params,"s",PlayerInfo[playerid][Password]) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
if(sscanf(params,"u",PlayerInfo[playerid][Password])) return SendClientMessage(playerid,0xFFFFFFAA,"Nex'Admin: Usage: /register [password].");
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;
}
Change:
pawn Код:
pawn Код:
|
try this
pawn Код:
|