16.03.2009, 16:14
Ive made an ini file in scriptfiles, called Players.ini
My player name is Decysen then it does this: Decysen=TestPass
It should say logged if it it inputs that, or else say Invalid Password. But this command will only say Unknown Command. Can somebody help me why this wont work? Thnx
My player name is Decysen then it does this: Decysen=TestPass
It should say logged if it it inputs that, or else say Invalid Password. But this command will only say Unknown Command. Can somebody help me why this wont work? Thnx
Код:
#include <a_samp> #include <dini> #define COLOR_RED 0xFF0000AA #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 new _LOGIN_Password[MAX_PLAYERS]; new _LOGIN_LoggedIn[MAX_PLAYERS]; new Name[MAX_PLAYER_NAME+1]; public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnPlayerRequestSpawn(playerid) { if(_LOGIN_LoggedIn[playerid] == 1) { return 1; } else { return 0; } return 0; } public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(login, 5, cmdtext); return 0; } dcmd_login(playerid, params[]) { print("Got Input FS"); if(params[128] == dini_Int("Players.ini", Name)) { _LOGIN_LoggedIn[playerid] = 1; SendClientMessage(playerid, COLOR_RED, "Logged In."); } else { SendClientMessage(playerid, COLOR_RED, "Invalid Password! Please Retry."); } return 1; } public OnPlayerConnect(playerid) { _LOGIN_LoggedIn[playerid] = 0; GetPlayerName(playerid, Name, sizeof(Name)); // _LOGIN_Password[playerid] = dini_Get("Players.ini", Name); printf("%s (%d) Password Is: %s", Name, playerid, dini_Get("Players.ini", Name)); return 1; }