Pawno.exe has stopped working!
#1

Hello!
I wanted to create Register & Login system and I finished it but when I click on "Compile" my Pawno stopped worked and doesn't compile anything!
Can You help me please?
Code:

pawn Код:
#include <a_samp>
#include <zcmd>
#include <YSI\y_ini>

// DEFINES

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

#define PATH "/Akauntovi.%s.ini"
#pragma tabsize 0

enum pInfo
{
    pSifra,
    pNovac,
    pAdmin,
    pScore,
    pBankanovac,
    pBanovan
}

new PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Lozinka",PlayerInfo[playerid][pSifra]);
    INI_Int("Novac",PlayerInfo[playerid][pNovac]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Bankanovac",PlayerInfo[playerid][pBankanovac]);
    INI_Int("Banovan",PlayerInfo[playerid][pBanovan]);
    return 1;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
stock udb_hash(buf[])
{
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}

main()
{
    print("<==============================>");
    print("            MOD OD 0            ");
    print("             BY ME.             ");
    print("<==============================>");
}

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("MJR v1.0.0");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra - true,.extra = playerid);
        ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Molimo unesite vaљu lozinku!","Login","Napusti");
    }
    else
    {
        ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Molimo da se registrujete na server!\nUnesite lozinku koju ћelite koristiti na serveru!","Register","Napusti");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Novac"),GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Score",GetPlayerScore(playerid)););
    INI_WriteInt(File,"Bankanovac",PlayerInfo[playerid][pBankanovac]);
    INI_WriteInt(File,"Banovan",PlayerInfo[playerid][pBanovan]);
    INI_Close(File);
    return 1;
}

public OnDialogResponse[playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Lozinka koju ste unijeli nije validna!\nMolimo unesite novu!","Register","Napusti");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SerTag(File,"data");
                INI_WriteInt(File,"Lozinka",udb_hash(inputtext));
                INI_WriteInt(File,"Novac",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Score",0);
                INI_WriteInt(File,"Bankanovac",0);
                INI_WriteInt(File,"Banovan",0);
                INI_Close(File);
            }
        }
        case DIALOG_LOGIN:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pSifra])
                {
                    INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
                    GivePlayerMoney(playerid,PlayerInfo[playerid][pNovac]);
                    SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
                    SendClientMessage(playerid,-1,"Uspjesno si se ulogovao u svoj korisnicki racun!");
                }
                else
                {
                    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Lozinka koju ste unijeli nije tačna,pokuљajte ponovo!","Login","Napusti");
                }
            }
        }
    }
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Reply
#2

PHP код:
#include <a_samp>
#include <zcmd>
#include <YSI\y_ini>
// DEFINES
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define PATH "/Akauntovi.%s.ini"
#pragma tabsize 0
enum pInfo
{
    
pSifra,
    
pNovac,
    
pAdmin,
    
pScore,
    
pBankanovac,
    
pBanovan
}
new 
PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public 
LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Lozinka",PlayerInfo[playerid][pSifra]);
    
INI_Int("Novac",PlayerInfo[playerid][pNovac]);
    
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    
INI_Int("Score",PlayerInfo[playerid][pScore]);
    
INI_Int("Bankanovac",PlayerInfo[playerid][pBankanovac]);
    
INI_Int("Banovan",PlayerInfo[playerid][pBanovan]);
    return 
1;
}
stock UserPath(playerid)
{
    new 
string[128],playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,playername,sizeof(playername));
    
format(string,sizeof(string),PATH,playername);
    return 
string;
}
stock udb_hash(buf[])
{
    new 
length=strlen(buf);
    new 
s1 1;
    new 
s2 0;
    new 
n;
    for (
n=0n<lengthn++)
    {
       
s1 = (s1 buf[n]) % 65521;
       
s2 = (s2 s1)     % 65521;
    }
    return (
s2 << 16) + s1;
}
main()
{
    print(
"<==============================>");
    print(
"               MOD OD 0            ");
    print(
"                BY ME.             ");
    print(
"<==============================>");
}
public 
OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("MJR v1.0.0");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    return 
1;
}
public 
OnGameModeExit()
{
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    if(
fexist(UserPath(playerid)))
    {
        
INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra true,.extra playerid);
        
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Molimo unesite vaљu lozinku!","Login","Napusti");
    }
    else
    {
        
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Molimo da se registrujete na server!\nUnesite lozinku koju ћelite koristiti na serveru!","Register","Napusti");
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));
    
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
    
INI_WriteInt(File,"Bankanovac",PlayerInfo[playerid][pBankanovac]);
    
INI_WriteInt(File,"Banovan",PlayerInfo[playerid][pBanovan]);
    
INI_Close(File);
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_REGISTER:
        {
            if(!
response) return Kick(playerid);
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Lozinka koju ste unijeli nije validna!\nMolimo unesite novu!","Register","Napusti");
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Lozinka",udb_hash(inputtext));
                
INI_WriteInt(File,"Novac",0);
                
INI_WriteInt(File,"Admin",0);
                
INI_WriteInt(File,"Score",0);
                
INI_WriteInt(File,"Bankanovac",0);
                
INI_WriteInt(File,"Banovan",0);
                
INI_Close(File);
            }
        }
        case 
DIALOG_LOGIN:
        {
              if(!
response) return Kick(playerid);
            if(
response)
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pSifra])
                {
                    
INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra true,.extra playerid);
                    
GivePlayerMoney(playerid,PlayerInfo[playerid][pNovac]);
                    
SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
                    
SendClientMessage(playerid,-1,"Uspjesno si se ulogovao u svoj korisnicki racun!");
                }
                else
                {
                    
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Lozinka koju ste unijeli nije tačna,pokuљajte ponovo!","Login","Napusti");
                }
            }
        }
    }
    return 
1;
}
public 
OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    return 
1;

Reply
#3

Thank you bro but if You know can you help me with this warning? Its something about include files?

PHP код:
C:\Users\CENSORED\Desktop\MOJ MOD OD 0\pawno\include\YSI\..\YSI_Storage\..\YSI_Core\y_utils.inc(430) : warning 201redefinition of constant/macro (symbol "isnull(%1)")
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Warning

Reply
#4

Did you add new defines?
Reply
#5

What defines?
I only have includes of y_ini
Reply
#6

The code I've posted here compiles fine for me. Idk, maybe your YSI libraries need to be updated?
Reply
#7

Do you define isnull somewhere in your script? It looks like it's being defined twice (probaby in includes)
Reply
#8

can you send me updated YSI libraries?
Reply
#9

No I'm not @kovac
Reply
#10

YSI should be included directly after a_samp.inc and before any other libraries. Try that.

Otherwise put
pawn Код:
#undef isnull
at the end of zcmd file.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)