[Pomoc] Nemogu se logirat

Započeo System32, Jun 07, 2011, 20:22:47 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: iStnt
Detaljan opis problema: ma jedan covjek mi je napravio sejving sistem s y_iniem ali kad se regam i idem se poslje logirati nemog,uvjek pise da sam kucao kriv lozinku a nisam :S
Dio skripte:
ovo je cijeli mod za sad pa... :D
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <stocks>
#include <YSI\y_ini>

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

forward LoadUserData(playerid, name[], value[]);

#define INI_Exists(%0) fexist(%0)
#define SetPVarIntEx(%0,%1,%2,%3)  SetPVarInt(%0, %1, GetPVarInt(%0, %1) %2 %3)

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN    2

#define USER_FILE       "Korisnici/%s.ini"
#define VERSION         "1.0.0"

#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SPAWN 0xFF8C55FF
#define COLOR_LIGHTBLUE 0x6DC5F3FF
#define COLOR_ADMIN 0xFF0000FF
#define COLOR_SAY 0x2986CEFF
#define COLOR_SYSGREY 0xC6BEBDFF
#define COLOR_BLACK 0x000000FF
#define COLOR_JOIN 0x74E80099
#define COLOR_WARN 0xBE615099
#define COLOR_RACE 0x00BBBB99
#define COLOR_KRED 0xFF0000FF
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_BLUE 0x2641FEAA
#define COL_EASY           "{FFF1AF}"
#define COL_WHITE          "{FFFFFF}"
#define COL_BLACK          "{0E0101}"
#define COL_GREY           "{C3C3C3}"
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
#define COL_YELLOW         "{F3FF02}"
#define COL_ORANGE         "{FFAF00}"
#define COL_LIME           "{B7FF00}"
#define COL_CYAN           "{00FFEE}"
#define COL_LIGHTBLUE      "{00C0FF}"
#define COL_BLUE           "{0049FF}"
#define COL_MAGENTA        "{F300FF}"
#define COL_VIOLET         "{B700FF}"
#define COL_PINK           "{FF00EA}"
#define COL_MARONE         "{A90202}"
#define COL_CMD            "{B8FF02}"
#define COL_PARAM          "{3FCD02}"
#define COL_SERVER         "{AFE7FF}"
#define COL_VALUE          "{A3E4FF}"
#define COL_RULE           "{F9E8B7}"
#define COL_RULE2          "{FBDF89}"
#define COL_RWHITE         "{FFFFFF}"
#define COL_LGREEN         "{C9FFAB}"
#define COL_LRED           "{FFA1A1}"
#define COL_LRED2          "{C77D87}"

new PlayerColors[200] = {
0x5F7C6D77 ,0xF555EF77 ,0x8E5B9777 ,0x68E7EF77 ,0x76AB5B77 ,0xFAF65D77 ,0xBD76AB77 ,0xB5A5D777 ,0x959AB777 ,0x5DB5B877 ,
0xF8757D77 ,0x7B5B9F77 ,0xA66FCF77 ,0xCBC5E877 ,0xBA7B9E77 ,0x7B6F9E77 ,0xF7B5B977 ,0xB57AEF77 ,0x9F6D9C77 ,0x7C979D77 ,
0x87668977 ,0xD5FCAE77 ,0xB58EDD77 ,0xCCDD7877 ,0xD96CAE77 ,0xA65FBF77 ,0xF79AAD77 ,0xBB6ED677 ,0x559BBC77 ,0x5CCDCC77 ,
0xFF6BA677 ,0xFAED7577 ,0x6B676E77 ,0xCBB7F777 ,0x565CBC77 ,0xB7D86977 ,0xABEE9E77 ,0xCF65E577 ,0x89AFD777 ,0x5EEE8777 ,
0x886B6577 ,0xECF78677 ,0x9A6EDF77 ,0xDA6CBA77 ,0xBFBAB977 ,0x8F5B7C77 ,0xF57DD977 ,0xD85F8D77 ,0x6C756D77 ,0xFDB68B77 ,
0x6AFC9977 ,0xB9AB9677 ,0x9EBB7577 ,0x675FFC77 ,0xEFF8F877 ,0x9A6E6677 ,0xCDE67D77 ,0xDADD6D77 ,0x96AFA577 ,0xDC9BB577 ,
0xC57CA577 ,0xDA5BC977 ,0xBD9F7F77 ,0x597A7D77 ,0x65D99A77 ,0xB97DFF77 ,0xE8D78B77 ,0xDA8ADF77 ,0x755C6D77 ,0xB67DCF77 ,
0xCE8CB677 ,0x7C5A9E77 ,0xBF5DE977 ,0xEE6CF677 ,0xEA89FE77 ,0xABAFF977 ,0x89FFBA77 ,0x59A9AB77 ,0xEF78A677 ,0x5AA59F77 ,
0xD6EE7B77 ,0x5DDAB577 ,0x8D99BA77 ,0x777DBE77 ,0xBCABDC77 ,0xEF5BA877 ,0xEC689D77 ,0xD5E6A577 ,0xD577A877 ,0xECBC6677 ,
0xC8F8B877 ,0x5BFC9877 ,0xFC68EF77 ,0xD578C977 ,0x58B58677 ,0x7F789777 ,0xD88ABC77 ,0xA6998C77 ,0xB6596877 ,0x75ECD777 ,
0xA6DB6D77 ,0x77DEFB77 ,0x55BC7577 ,0x76BC5A77 ,0x7F6D9C77 ,0x998B6A77 ,0xD568AD77 ,0x67DFAD77 ,0xFFA85E77 ,0x9B9AA777 ,
0x6E79F677 ,0xDCF98677 ,0xA6C9CC77 ,0x5C9EEA77 ,0xF6FAC677 ,0x9A9AE577 ,0xFCC76C77 ,0xDA675877 ,0x7BEE7977 ,0xC8C7AA77 ,
0x7CAB5677 ,0xA9FD7577 ,0xF75AE577 ,0xE6A88777 ,0xAEC8DF77 ,0xE8AEA777 ,0xA685EB77 ,0x6ECEB777 ,0x98557A77 ,0xD7EEC777 ,
0x9DB9CB77 ,0xDCB75E77 ,0xCF98EA77 ,0xBE796D77 ,0xDCBDEC77 ,0xF9B66C77 ,0xFFBCE777 ,0x8ACD7A77 ,0x6DD9C977 ,0xCCC6C777 ,
0xF6858677 ,0xA5557577 ,0xE8D8CD77 ,0xC9DAD977 ,0x77FE7D77 ,0xAD8A6D77 ,0xB8E75C77 ,0xFB7C5E77 ,0x6D6FD677 ,0x97FA8C77 ,
0xDBB9FC77 ,0xEF7D6877 ,0xC8CA6C77 ,0x85E8D577 ,0x9CBECA77 ,0xDBFEF677 ,0xFC5AC877 ,0xA6D8F977 ,0xFDBC8577 ,0x55F77D77 ,
0xA69EE577 ,0x5A87EE77 ,0x6F9EDC77 ,0xA59CBC77 ,0x875E8677 ,0x5A776977 ,0xDFEE6E77 ,0xB56DFE77 ,0xA5B55677 ,0xC875D577 ,
0xAE598977 ,0xBBD69977 ,0xD9EF9B77 ,0xE767FC77 ,0x6AFDAB77 ,0x5B667D77 ,0xDADCB977 ,0x89A67A77 ,0x65CCBF77 ,0xC55C6C77 ,
0xE9E6DF77 ,0x6565C677 ,0xBBA95B77 ,0x6AFDCA77 ,0xBFA97777 ,0x6B7B9877 ,0x6DEB6D77 ,0xDFB6F777 ,0xDEDBC577 ,0x78C86577 ,
0x98B5AD77 ,0x65BBF577 ,0x896F9F77 ,0x9C5DF677 ,0xB79BFA77 ,0xFAFF9A77 ,0xE865AD77 ,0x8758FF77 ,0xCF7DEE77 ,0xF598AD77
};

main()
{
print("  +----------------------------------+");
printf("  |  iStunt %s by System32        |", VERSION);
print("  +----------------------------------+\n");
}

public OnGameModeInit()
{
   for(new s = 9; s <= 80; ++s)
{
if(!IsInvalidSkin(s)) AddPlayerClass(s, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
  }

   AddPlayerClass(0, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
   AddPlayerClass(179, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(105, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(106, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(107, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(108, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(109, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(111, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(114, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(115, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(116, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(137, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(157, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(158, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(159, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(160, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(161, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(162, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(163, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(164, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(165, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);
AddPlayerClass(166, 2119.0869, -2616.2554, 13.5469, 358.1704, 0, 0, 0, 0, 0, 0);

SetGameModeText("iStunt "VERSION);
UsePlayerPedAnims();
EnableStuntBonusForAll(true);
return 1;
}

public OnPlayerConnect(playerid)
{
   new
       strText[104];

   format(strText, 35, USER_FILE, GetName(playerid));

if(!INI_Exists(strText))
{
   format(strText, 104, "{FF00EA}DobrodoÅ¡li {FFFFFF}%s!\n\n\n{00FFEE}Vi niste registrirani!\nRegistrirajte se!", GetName(playerid));
   ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "iStunt - Registracija", strText, "Register", "Leave");

   SetPVarInt(playerid, "Registered", 1);
}
else
{
   format(strText, 98, "{FF00EA}DobrodoÅ¡li {FFFFFF}%s!\n\n\n{00FFEE}Vi ste registrirani!\nPrijavite se!", GetName(playerid));
   ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "iStunt - Logiranje", strText, "Login", "Leave");

   SetPVarInt(playerid, "Registered", 0);
}
return 1;
}

public OnPlayerDisconnect(playerid)
{
OnPlayerLogout(playerid);
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
   if(GetPVarInt(playerid, "Registered") == 0) SetPVarInt(playerid, "Skin", GetPlayerSkin(playerid));
   SetPlayerPos(playerid, -2232.0833, -1738.4362, 480.9473);
SetPlayerFacingAngle(playerid, 43.6447);
SetPlayerCameraPos(playerid, -2242.07, -1726.70, 482.38);
SetPlayerCameraLookAt(playerid, -2238.97, -1730.63, 482.11);
SetPlayerColor(playerid, PlayerColors[playerid]);

SetPVarInt(playerid, "Joinned", 1);
return 1;
}

public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid, "Registered") == 0) SetPVarInt(playerid, "Skin", GetPlayerSkin(playerid));
if(GetPVarInt(playerid, "Joinned") == 1)
{
   GivePlayerMoney(playerid, GetPVarInt(playerid, "Money"));
SetPlayerScore(playerid, GetPVarInt(playerid, "Score"));

SetPVarInt(playerid, "Joinned", 0);
}
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
   case DIALOG_REGISTER:
{
   if(response)
   {
       new
           strText[179];
   
       if(strlen(inputtext) >= 4 && strlen(inputtext) <= 35)
       {
OnPlayerRegister(playerid, inputtext);

       format(strText, 125, "Registrirali ste se s imenom {FFFFFF}'%s' {FFFF00}i s lozinkom {FFFFFF}'%s'{FFFF00}, automatski ste logirani!", GetName(playerid), inputtext);
       SendClientMessage(playerid, COLOR_YELLOW, strText);
}
else
{
   format(strText, 179, "{FF00EA}DobrodoÅ¡li {FFFFFF}%s!\n\n{FF0000}GRESKA: {00FFEE}Lozinka mora biti dugacka najmanje 4 znaka, a najvise 35.\n\nVi niste registrirani!\nRegistrirajte se!", GetName(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "iStunt - Registracija", strText, "Register", "Leave");
}
}
else Kick(playerid);
}
case DIALOG_LOGIN:
{
   new string[70];
   if(response)
   {
       if(strlen(inputtext) > 0) OnPlayerLogin(playerid, inputtext);
}
else Kick(playerid);
format(string, sizeof(string), "iStunt: Server je izbacio %s zbog 3 puta pogrešno upisanih lozinki!", GetName(playerid));
SendClientMessageToAll(COLOR_KRED, string);
   }
return 1;
}

public OnPlayerText(playerid, text[])
{
ChatLog(playerid, text);
return 1;
}

public LoadUserData(playerid, name[], value[])
{
if(!strcmp(name, "Lozinka"))
{
new
   hashPassword[129];

   WP_Hash(hashPassword, 129, value);
SetPVarString(playerid, "Lozinka", hashPassword);
}
if(!strcmp(name, "Admin")) SetPVarInt(playerid, "Admin", strval(value));
if(!strcmp(name, "Money")) SetPVarInt(playerid, "Money", strval(value));
if(!strcmp(name, "Score")) SetPVarInt(playerid, "Score", strval(value));
if(!strcmp(name, "Kills")) SetPVarInt(playerid, "Kills", strval(value));
if(!strcmp(name, "Deaths")) SetPVarInt(playerid, "Deaths", strval(value));
if(!strcmp(name, "Skin")) SetPVarInt(playerid, "Skin", strval(value));
}

OnPlayerRegister(playerid, password[])
{
new
   hashPassword[129],
   uFile[35];

   format(uFile, 35, USER_FILE, GetName(playerid));

new
   INI:playerFile = INI_Open(uFile);
   
WP_Hash(hashPassword, 129, password);

INI_WriteString(playerFile, "Lozinka", hashPassword);
INI_WriteInt(playerFile, "Admin", 0);
INI_WriteInt(playerFile, "Money", 200);
INI_WriteInt(playerFile, "Score", 0);
INI_WriteInt(playerFile, "Kills", 0);
INI_WriteInt(playerFile, "Deaths", 0);
INI_WriteInt(playerFile, "Skin", 0);

INI_Close(playerFile);

SetPVarInt(playerid, "Registered", 1);
SetPVarInt(playerid, "Logged", 1);
return 1;
}

OnPlayerLogin(playerid, password[])
{
   new
       hashPassword[129],
       Password[129],
   uFile[35];

   format(uFile, 35, USER_FILE, GetName(playerid));

INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);

GetPVarString(playerid, "Lozinka", Password, 129);
WP_Hash(hashPassword, 129, password);

if(strcmp(Password, hashPassword, false, 35))
{
   if(GetPVarInt(playerid, "LoginTries") == 3) Kick(playerid);
   {
   ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "iStunt - Logiranje", "{FF00EA}Upisali ste pogreÅ¡nu lozinku!\n\n\n{F81414}Molimo pokuÅ¡ajte ponovo!", "Login", "Leave");
   SetPVarIntEx(playerid, "LoginTries", +, 1);
   }
}
return 1;
}

OnPlayerLogout(playerid)
{
   new
   uFile[35];

   format(uFile, 35, USER_FILE, GetName(playerid));

new
   INI:playerFile = INI_Open(uFile);

INI_WriteInt(playerFile, "Admin", GetPVarInt(playerid, "Admin"));
INI_WriteInt(playerFile, "Money", GetPlayerMoney(playerid));
INI_WriteInt(playerFile, "Score", GetPlayerScore(playerid));
INI_WriteInt(playerFile, "Kills", GetPVarInt(playerid, "Kills"));
INI_WriteInt(playerFile, "Deaths", GetPVarInt(playerid, "Deaths"));
INI_WriteInt(playerFile, "Skin", GetPVarInt(playerid, "Skin"));

INI_Close(playerFile);
return 1;
}


edit: evo i pastebin http://pastebin.com/iAW7r5w0
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Jun 07, 2011, 20:24:12 POSLE PODNE od [AG] System32
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √