06.11.2010, 12:45
pawn Код:
dcmd_login(playerid, params[])
{
new file[256], name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(file, 256, "\\Users\\%s.ini", name);
if(!dini_Exists(file)) return SendClientMessage(playerid, 0xFFFFFFFF, "You aren't registered, to do, type /register [password] !");
if(!strlen(params)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE:/register [password]");
if(logged[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You are already logged in!");
if(!strcmp(params, dini_Get(file, "password"), true))
{
logged[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "You successfully logged in!");
return 1;
}
if(strcmp(params, variable))
{
format(string, sizeof(string), "%s, you typed your pasword incorrectly", name);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
return 0;
}
I didn't test it, so I don't know if it's working
And I made it a bit different, so it will save a BIT disk space
And please use [ pawn ][ /pawn ] BB codes
Then it will be PAWN highlighted