28.04.2011, 16:13
I made this command to set a value for certain player's variable (Variable here is PlayerPassword)
The line i marked with red is the line which changes to value to the value that a player specifies in the command /pass (password), So if im doing PlayerPassword(playerid) = tmp, It is just changing value of PlayerPassword to tmp, But what i need is to change it to the password he entered, How to do this, and tell me if i went anything wrong in this script, Thnx in advance
Код:
if(strcmp(cmd, "/pass", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You are not Logged in !"); return 1; } new tmppass[64]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pass [password]"); return 1; } format(string, sizeof(string), "You have entered the gate password to %s.", tmp); SendClientMessage(playerid, COLOR_YELLOW, string); PlayerPassword(playerid) = strmid(tmppass, tmp, 0, strlen(cmdtext), 255); } return 1; }