ERROR :/
#1

Код:
D:\ZFR\gamemodes\ZFR.pwn(1322) : error 017: undefined symbol "w"
D:\ZFR\gamemodes\ZFR.pwn(1322) : error 017: undefined symbol "w"
D:\ZFR\gamemodes\ZFR.pwn(1322) : error 029: invalid expression, assumed zero
D:\ZFR\gamemodes\ZFR.pwn(1322) : fatal error 107: too many error messages on one line
line
Код:
format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid));
All code

Код:
 if(dialogid == 1)
   {
     if(response == 1)
        {
        new pFile[128], pIP[16], w[128], gw[128];
          GetPlayerIp(playerid, pIP, sizeof(pIP));
            format(pFile, sizeof(pFile), "Users/%s.ini", PlayerName(playerid));
			if(strlen(inputtext))
			{
	    		if(dini_Exists(pFile))
	    		{
	    			SendClientMessage(playerid, COLOR_RED, "Tu jau esi uzsiregistraves!");
	    		}
	    		else
	    		{
	    	    	PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
	    			dini_Create(pFile);
	    			dini_Set(pFile, "PlayerName", PlayerName(playerid));
	    			dini_Set(pFile, "PlayerIP", pIP);
    				dini_IntSet(pFile, "PasswordHash", udb_hash(inputtext));
	    			dini_IntSet(pFile, "Admin", 0);
					dini_IntSet(pFile, "Pinigai", 0);
					dini_IntSet(pFile, "Taskai", 100);
                    dini_IntSet(pFile, "Mirtys", 0);
                    dini_IntSet(pFile, "Nuzudymai", 0);
                    SendClientMessage(playerid, COLOR_GREEN, "Tu UZREGISTRUOTAS!");
	    			format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid));
    				ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti");
	    		}
			}
			else
			{
	    		SendClientMessage(playerid, COLOR_RED, "Irasyk slaptazodi!");
    			format(gw,sizeof(gw),"Uzsiregistruok,jeigu nori zaisti",PlayerName(playerid));
    			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registracija",gw,"Registruotis","Iseiti");
			}
        }
        if(response == 0)
        {
       		format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid));
    		ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti");
        }
    }

    if(dialogid == 2)
    {
        if(response == 1)
        {
			if(strlen(inputtext))
			{
				format(pFile, sizeof(pFile), "Users/%s.ini", PlayerName(playerid));
	    		new pass[256];
				pass = dini_Get(pFile, "PasswordHash");
	    		if(udb_hash(inputtext) != strval(pass))
	        	{
	    			SendClientMessage(playerid, COLOR_RED, "Blogas slaptazodis!");
	    			format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid));
    				ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti");
				}
				else
				{
					PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
					if(dini_Int(pFile,"Admin") == 0){pInfo[playerid][Admin]=false;}
					if(dini_Int(pFile,"Admin") == 1){pInfo[playerid][Admin]=true;}
					pInfo[playerid][Money] = dini_Int(pFile, "Pinigai");
					pInfo[playerid][Taskai] = dini_Int(pFile, "Taskai");
					pInfo[playerid][Mirtys] = dini_Int(pFile, "Mirtys");
					pInfo[playerid][Killai] = dini_Int(pFile, "Nuzudymai");
					GivePlayerMoney(playerid, pInfo[playerid][Money]);
					SetPlayerScore(playerid, pInfo[playerid][Taskai]);
	    			SendClientMessage(playerid, COLOR_GREEN, "PRISIJUNGIAI!");
				}
			}
			else
			{
	    		SendClientMessage(playerid, COLOR_RED, "Irasyk slaptazodi!");
	    		format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid));
    			ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti");
			}
        }
        if(response == 0)
        {
	    	format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid));
    		ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti");
        }
}
	return 0;
}
help!
Reply
#2

You need to create string "w"

pawn Код:
new w[Size];
Reply
#3

Код:
if(dialogid == 1)
{
    if(response == 1)
    {
        new w[128];
    }
    if(response == 0)
    {

    }
}
Variables that you create are ONLY available in the block they were created in (marked in green). It it not known in any other blocks (marked in red). This is called the 'scope' of a variable.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Код:
if(dialogid == 1)
{
    if(response == 1)
    {
        new w[128];
    }
    if(response == 0)
    {

    }
}
Variables that you create are ONLY available in the block they were created in (marked in green). It it not known in any other blocks (marked in red). This is called the 'scope' of a variable.
Noo,i alerty defined w[128];
if(response == 1)
{
new pFile[128], pIP[16], w[128], gw[128];
Reply
#5

That's what I said ... You ONLY defined it in the block I marked in green, but nowhere else. Hence, the compiler will complain if you use it anywhere else.
Reply
#6

Код:
if(response == 0)
        {
            new w[128];
       		format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid));
    		ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti");
        }
    }
In this way?

but then:
Код:
:\ZFR\gamemodes\ZFR.pwn(1334) : error 017: undefined symbol "pFile"
D:\ZFR\gamemodes\ZFR.pwn(1334) : error 017: undefined symbol "pFile"
D:\ZFR\gamemodes\ZFR.pwn(1334) : error 029: invalid expression, assumed zero
D:\ZFR\gamemodes\ZFR.pwn(1334) : fatal error 107: too many error messages on one line
line:
format(pFile, sizeof(pFile), "Users/%s.ini", PlayerName(playerid));
Reply
#7

anyone?
Reply
#8

pawn Код:
new pFile[128];
Reply
#9

Quote:
Originally Posted by Antonio144
Посмотреть сообщение
pawn Код:
new pFile[128];
Код:
format(pFile, sizeof(pFile), "Users/%s.ini", PlayerName(playerid));
	    		new pass[256],new pFile[128];
Not work.
Reply
#10

pawn Код:
new pass[256],new pFile[128];
format(pFile, sizeof(pFile), "Users/%s.ini", PlayerName(playerid));
I think you need read wiki.sa-mp.com tutorials.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)