Jump to content
  • 0

Ajutor 1 comanda


GwE_Cristy

Question

2 answers to this question

Recommended Posts

[pawn] if (strcmp(cmd, "/changepass", true)==0)

{

tmp = strtok(cmdtext, idx);

if (gPlayerLogged[playerid] != 1)

{

SendClientMessage(playerid, COLOR_GRAD1, "  You Are Not Logged In");

return 1;

}

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00FF00}Tasteazã:{FFFFFF} /changepass [password]");

return 1;

}

strmid(PlayerInfo[playerid][pKey], tmp, 0, strlen(cmdtext), 255);

format(string, sizeof(string), "{F3FF02}Noua ta parola este{F81414} %s {F3FF02}nu o uita", PlayerInfo[playerid][pKey]);

SendClientMessage(playerid, COLOR_YELLOW, string);

new year, month,day;

getdate(year, month, day);

GetPlayerName(playerid, playername, sizeof(playername));

format(string, sizeof(string), "%s has changed his password, new password is %s (%d-%d-%d).", playername, PlayerInfo[playerid][pKey], month,day,year);

Encript(PlayerInfo[playerid][pKey]);

OnPlayerUpdateEx(playerid);

ChangepassLog(string);

//printf("%s has changed there password.", playername);

return 1;

}

if(!strcmp("/setname", cmd, true))

{

if (PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_GRAD2, "  Nu ai rangul administrativ necesar!");

tmp = strtok(cmdtext,idx);

if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Tasteazã:{FFFFFF} /setname [id] [newname]");

giveplayerid = ReturnUser(tmp);

if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid Playerid!");

new str[128],gpname[MAX_PLAYER_NAME];

GetPlayerName(giveplayerid, gpname, MAX_PLAYER_NAME);

format(str, 128, "users/%s.ini", gpname);

if(!fexist(str)) return SendClientMessage(playerid, COLOR_YELLOW, "The person havent an account on this server");

tmp = strtok(cmdtext,idx);

if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Tasteazã:{FFFFFF} /setname [id] [newname]");

new str2[128];

format(str2,128,"users/%s.ini",tmp);

frename(str,str2);

new pname[MAX_PLAYER_NAME];

GetPlayerName(playerid, pname, MAX_PLAYER_NAME);

SetPlayerName(giveplayerid,tmp);

format(string, sizeof(string), "[NameChange] %s changed name of \"%s\" to \"%s\"",pname,gpname,tmp);

SendClientMessageToAll(COLOR_LIGHTRED,string);

new year, month,day;

getdate(year, month, day);

format(string, sizeof(string), "(%d-%d-%d) Admin: %s was changed name of %s to %s", day,month,year, pname,gpname,tmp);

    NameChangeLog(string);

return 1;

}[/pawn]

Link to comment
Share on other sites

Te folosesti de:

[pawn]native WP_Hash(buffer[], len, const str[]);[/pawn]

Sa o formatezi.

Exmeplu(pe dialog):

[pawn]new escapedPassword[129];

WP_Hash(escapedPassword,sizeof(escapedPassword),inputtext);

[/pawn]

Si la update folosesti ToLower(escapedPassword).

[pawn]stock ToLower(text[]) {

    #if defined DEBUG

    printf("[debug] ToLower(%s)",text);

#endif

new string2[MAX_STRING],strings[MAX_STRING];

for(new i; i < strlen(text);i++) {

    format(strings,sizeof(strings),"%c",tolower(text));

strcat(string2,strings);

}

return string2;

}[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.