07.04.2011, 13:37
hello, I have a problem with this code
it is not working
Also this, it doesnt work
it is not working
pawn Код:
COMMAND:changepass(playerid, params[])
{
new file[128], pName[MAX_PLAYER_NAME];
format(file, sizeof(file), SERVER_USER_FILE, pName);
if(sscanf(params, "ss", params, params)) return SendClientMessage(playerid, Yellow, "Usage: /changepass <old password> <new password>");
if(udb_hash(params) != dini_Int(file, "Password")) return SendClientMessage(playerid,Red,"Incorrect password !");
else
{
GetPlayerName(playerid,pName,sizeof(pName));
dini_IntSet(file, "Password", udb_hash(params));
SendClientMessage(playerid,Green,"You succesfully changed your password !");
}
return 1;
}
pawn Код:
COMMAND:getid(playerid, params[]) // credit to Lethal
{
if(sscanf(params, "s[128]", params[2])) return SendClientMessage(playerid, Yellow, "Usage: /getid <name>");
new found, string[128], playername[MAX_PLAYER_NAME];
format(string,sizeof(string),"Searched for: \"%s\" ",params);
SendClientMessage(playerid,blue,string);
for(new i=0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, playername, MAX_PLAYER_NAME);
new namelen = strlen(playername);
new bool:searched=false;
for(new pos=0; pos <= namelen; pos++)
{
if(searched != true)
{
if(strfind(playername,params,true) == pos)
{
found++;
format(string,sizeof(string),"%s (ID %d)",playername,i);
SendClientMessage(playerid, green ,string);
searched = true;
}
}
}
}
}
if(found == 0) SendClientMessage(playerid, lightblue, "No players have this in their nick");
return 1;
}