02.07.2013, 05:32
The /stats command.
The /changepass command.
For the /changepass, if you want admins to know when ever a user changed his password and what password did he changed to here is the code.
pawn Код:
CMD:stats(playerid,params[])
{
new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s's stats",name);
SendClientMessage(playerid,0xFF8000AA,string);
format(string,sizeof(string),"Cash: $%d",pInfo[playerid][pCash]);
SendClientMessage(playerid,0xFF4000AA,string);
format(string,sizeof(string),"Score: %d",pInfo[playeid][pScore]);
SendClientMessage(playerid,0xFF1000FF,string);
format(string,sizeof(string),"Password: %s",pInfo[playerid][pPass]);
SendClientMessage(playerid,0xAAAAAAFF,string);
return 1;
}
pawn Код:
CMD:changepass(playerid,params[])
{
new pass;
if(sscanf(params,"s",pass)) return SendClientMessage(playerid,0xCCCCCCAA,"/changepass [new password]");
if(pass > 24 || pass < 0) return SendClientMessage(playerid,0xCCCCCCAA,"Invalid character length.");
pInfo[playerid][pPass] = pass;
format(string,sizeof(string),"You've changed your password to %s",pass);
SendClientMessage(playerid,0xFF4000AA,string);
return 1;
}
pawn Код:
CMD:changepass(playerid,params[])
{
new pass,name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(sscanf(params,"s",pass)) return SendClientMessage(playerid,0xCCCCCCAA,"/changepass [new password]");
if(pass > 24 || pass < 0) return SendClientMessage(playerid,0xCCCCCCAA,"Invalid character length.");
pInfo[playerid][pPass] = pass;
format(string,sizeof(string),"You've changed your password to %s",pass);
SendClientMessage(playerid,0xFF4000AA,string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pInfo[i][pAdmin] > 1)
{
format(string,sizeof(string),"%s changed his password to %s",name,pass);
SendClientMessage(i,0xFFFFFFAA,string);
}
}
return 1;
}