I don't know how fix this!
#1

Please help me! I don't know how fix this !
Error code :
Код:
 C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(99) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(100) : error 017: undefined symbol "SetupPlayerForLogin"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(101) : error 017: undefined symbol "SetupPlayerForRegister"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(103) : warning 217: loose indentation
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(111) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(114) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(119) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(124) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(126) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(130) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(132) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(140) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(146) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(151) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(155) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(157) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(158) : error 017: undefined symbol "udb_hash"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(161) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(166) : error 017: undefined symbol "SetupPlayerForRegister"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(166) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(169) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(179) : error 017: undefined symbol "SetupPlayerForLogin"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(184) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(185) : error 017: undefined symbol "SetupPlayerForLogin"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(185) : error 079: inconsistent return types (array & non-array)
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(187) : error 017: undefined symbol "pName"
C:\Users\Milos\Desktop\uydhuhsauhygduas\gamemodes\SHRP.pwn(188) : error 017: undefined symbol "udb_hash"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Here is all:
Код:
//=============================================================================> #include
#include <a_samp>
#include <dini>
//==============================================================================> define i new

#define SERVER_NAME "StayHere RolePlay "
#define SERVER_SCRIPT "#Mikki"
#define SERVER_VERSION "v1.0 Alpha"
#define LAST_UPDATE "09/12/2014"
#define MOTO " ''Ja se ne predajem ni onda kada mi ladje potonu.'' "

#define REGISTER_DIALOG_RULES 1
#define REGISTER_DIALOG_GODINE 2
#define REGISTER_DIALOG_POL 3
#define REGISTER_DIALOG_PASSWORD 4
#define REGISTER_DIALOG_END 5
#define LOGIN_DIALOG_PASSWORD 6

#define MAX_LOGIN_FAILS 3

#undef MAX_PLAYERS
#define MAX_PLAYERS 100
//------------------------------------------------------------------------------Boje
#define BELA            "{FFFFFF}"
#define ZELENA          "{008000}"
#define CRVENA          "{FF0000}"
#define JCRVENA         "{F81414}"
#define SPLAVA          "{29fcff}"
#define GLAVNA          "{EEC111}"
#define ZUTA            "{F3FF02}"
#define ORANGE          "{FFA500}"
#define ZPLAVA          "{22C7F5}"
#define PLAVA           "{0000FF}"
#define ROZA            "{FF00FF}"
#define CMDC            "{B8FF02}"
#define SERVER          "{AFE7FF}"
#define SZELENA         "{00FF00}"
#define LJUB            "{800080}"
#define SIVA            "{C0C0C0}"
#define CRVENA2         "{FF6347}"
#define PPLAVA          "{0084e3}"
#define SCRV2           "{FF6347}"
#define DRCC            "{800080}"
#define HZELENA         "{04CC29}"
#define LOCOS           0xFFA500C8
#define AZUTA           0xFFA500C8
#define BELA2           0xFFFFFFAA
#define PROX            0xC2A2DAAA
#define SCRVENA         0xFF6347AA
#define COLOR_GRAD2     0xBFC0C2FF
#define TEAM_HIT_COLOR  0xFFFFFF00
#define COLOR_GREY 		0xAFAFAFAA
#define COLOR_YELLOW    0xFFFF00AA
#define RED_ZONE        0xFF000065
#define DRC_ZONE        0x80008065
#define LOCOS_ZONE      0xFFA50065
#define COLOR_RED       0xAA3333AA
#define COLOR_LIGHTRED  0xFF6347AA
#define SVETLOPLAVA     0x33CCFFAA
#define GREEN           0x21DD00FF


//=============================================================================> main
main()
{
	print(" ");
    printf("--------------------------------------");
	printf("          [SH:RP] %s", SERVER_NAME);
	printf("    Naskriptao: %s", SERVER_SCRIPT);
	printf("    Server verzija: %s", SERVER_VERSION);
	printf("    Poslednji update: %s", LAST_UPDATE);
	printf("    Moto: %s", MOTO);
	printf("--------------------------------------");
	print(" ");
}
//=============================================================================> enum i news
enum registration {
	Player_Godine,     // Govori koliko igrac ima godina
	Player_Lozinka[24],       // Govori o passwordu
	Player_Pol,
	Player_Skin,
	}
new rInfo[MAX_PLAYERS][registration];
//=============================================================================> CallBack-ovi

public OnGameModeInit() {
  AddPlayerClass(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  return 1;
}

public OnPlayerConnect(playerid) {

   SetPVarInt(playerid, "ulogovan", 0);                                         //Govori da li je igrac ulogovan?
   SetPVarInt(playerid, "godine", -1);
   SetPVarInt(playerid, "pol", -1);
   SetPVarInt(playerid, "skin", -1);
   SetPVarInt(playerid, "login_fail", 0);
   //------------------------------------------------------------------------------
   new str[64]; format(str, sizeof(str), "/Korisnici/%s.ini", pName(playerid));
   if(!dini_Exists(str)) { SetupPlayerForLogin(playerid);
   }else{ SetupPlayerForRegister(playerid); }

return 1;}

//============================================================================ > OnDialogResponse

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
	SetPVarInt(playerid, "dialog", 0);
	//Dialog za prihvatiti pravila restracija
	if(dialogid == REGISTER_DIALOG_RULES) {
	    if(!response) return Kick(playerid);
	    new str[64], str2[128];
	    format(str, sizeof(str), ""SPLAVA"%s - Godine", SERVER_NAME);
	    format(str2, sizeof(str2), ""SPLAVA"%s,\nupisi koliko imas godina:", pName(playerid));
	    ShowPlayerDialog(playerid, REGISTER_DIALOG_GODINE, DIALOG_STYLE_INPUT, str, str2, "Dalje", "Odustani");
	//--------------------------------------------------------------------------
	//Dialog za upisati godine na registraciji
	}else if(dialogid == REGISTER_DIALOG_GODINE) {
	    if(!response) return Kick(playerid);
		new godine = strval(inputtext);
		if(!strlen(inputtext)) {
		    new str[64], str2[128];
	  	  	format(str, sizeof(str), ""SPLAVA"%s - Godine", SERVER_NAME);
	   	 	format(str2, sizeof(str2), ""BELA"%s,\nupisi koliko imas godina:", pName(playerid));
	    	ShowPlayerDialog(playerid, REGISTER_DIALOG_GODINE, DIALOG_STYLE_INPUT, str, str2, "Dalje", "Odustani");
	    	return 1; }
	    if(godine < 10 || godine > 80) {
		    new str[64], str2[128];
	  	  	format(str, sizeof(str), ""SPLAVA"%s - Godine", SERVER_NAME);
	   	 	format(str2, sizeof(str2), ""BELA"%s,\nupisi koliko imas godina\n\n"CRVENA"Ne mozes imati manje od 10 a vise od 80 godina!", pName(playerid));
	    	ShowPlayerDialog(playerid, REGISTER_DIALOG_GODINE, DIALOG_STYLE_INPUT, str, str2, "Dalje", "Odustani");
	    	return 1; }
		rInfo[playerid][Player_Godine] = godine;
	 	new str[64];
	 	format(str, sizeof(str), ""SPLAVA"%s - Pol", SERVER_NAME);
	   	ShowPlayerDialog(playerid, REGISTER_DIALOG_POL, DIALOG_STYLE_LIST, str, "Musko\nZensko", "Dalje", "Odustani");
	//--------------------------------------------------------------------------
	//Dialog za izabrati spol na registraciji
 	}else if(dialogid == REGISTER_DIALOG_POL) {
	    if(!response) return Kick(playerid);
		rInfo[playerid][Player_Pol] = listitem;
		if(listitem == 0) { rInfo[playerid][Player_Skin] = 2;
		}else if(listitem == 1) { rInfo[playerid][Player_Skin] = 12; }
	    new str[64], str2[128];
	 	format(str, sizeof(str), ""SPLAVA"%s - Lozinka", SERVER_NAME);
	 	format(str2, sizeof(str2), ""BELA"%s,\nupisi lozinku:", pName(playerid));
	   	ShowPlayerDialog(playerid, REGISTER_DIALOG_PASSWORD, DIALOG_STYLE_INPUT, str, str2, "Dalje", "Odustani");
	//--------------------------------------------------------------------------
	//Dialog za upisati lozinku na registraciji
	}else if(dialogid == REGISTER_DIALOG_PASSWORD) {
	    if(!response) return Kick(playerid);
	    if(!strlen(inputtext) || (strlen(inputtext) < 5 || strlen(inputtext) > 20)) {
		    new str[64], str2[128];
		 	format(str, sizeof(str), ""SPLAVA"%s - Lozinka", SERVER_NAME);
		 	format(str2, sizeof(str2), ""BELA"%s,\nupisi lozinku:\n\n"CRVENA"Lozinka mora imati\nizmedu 5 i 20 znakova !", pName(playerid));
		   	ShowPlayerDialog(playerid, REGISTER_DIALOG_PASSWORD, DIALOG_STYLE_INPUT, str, str2, "Dalje", "Odustani");
	        return 1; }
		rInfo[playerid][Player_Lozinka] = udb_hash(inputtext);
		new str[64], str2[256];
		format(str, sizeof(str), ""SPLAVA"%s - Kraj", SERVER_NAME);
		format(str2, sizeof(str2), ""BELA"%s,\nupisani podatci:\n\n"SPLAVA"Ime:"BELA"%s\n"SPLAVA"Lozinka:"BELA"%s\n"SPLAVA"Godine:"BELA"%d"SPLAVA"\nSpol:"BELA"%s\n\nUkoliko su upisani podatci tocni\nklikni dalje, ukoliko nisu klikni\nna ponovi !", pName(playerid), pName(playerid), inputtext, rInfo[playerid][Player_Godine], GetPolName(rInfo[playerid][Player_Pol]));
		ShowPlayerDialog(playerid, REGISTER_DIALOG_END, DIALOG_STYLE_MSGBOX, str, str2, "Registriraj", "Ponovi");
	//--------------------------------------------------------------------------
	//Dialog za zavrsiti registraciju ili je ponoviti
	}else if(dialogid == REGISTER_DIALOG_END) {
	    if(!response) return SetupPlayerForRegister(playerid);
	    //Stvaramo file u koji cemo spremiti igracu statistiku
	    new str[64];
		format(str, sizeof(str), "/Korisnici/%s.ini", pName(playerid));
		dini_Create(str);
		//----------------------------------------------------------------------
		//Stvaramo statisktiu koju upisujemo igracu u file (//STATISTIKA)
		dini_IntSet(str, "password", rInfo[playerid][Player_Lozinka]);
		dini_IntSet(str, "godine", rInfo[playerid][Player_Godine]);
		dini_IntSet(str, "pol", rInfo[playerid][Player_Pol]);
		dini_IntSet(str, "skin", rInfo[playerid][Player_Skin]);
	    //----------------------------------------------------------------------
		//Prikazujemo igracu dilaog da se logira
	    SetupPlayerForLogin(playerid);
	    //----------------------------------------------------------------------
	//--------------------------------------------------------------------------
	//Dialog za upisati lozinku na loginu
	}else if(dialogid == LOGIN_DIALOG_PASSWORD) {
	    if(!response) return Kick(playerid);
	    if(!strlen(inputtext)) return SetupPlayerForLogin(playerid);
	    new str[64];
		format(str, sizeof(str), "/Korisnici/%s.ini", pName(playerid));
		if(udb_hash(inputtext) != dini_Int(str, "password")) {
		    SetPVarInt(playerid, "login_fail", GetPVarInt(playerid, "login_fail")+1);
		    if(GetPVarInt(playerid, "login_fail") == MAX_LOGIN_FAILS) return Kick(playerid);
		    SetupPlayerForLogin(playerid);
		}else{
		    LoginPlayer(playerid);
			return 1; }
    //--------------------------------------------------------------------------
	return 1; }


stock pName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); return name; }
//------------------------------------------------------------------------------

	
//==============================================================================

stock SetupPlayerForLogin(playerid) {
	new str[64], str2[128];
	format(str, sizeof(str), ""SPLAVA"%s - Logovanje", SERVER_NAME);
	format(str2, sizeof(str2), ""BELA"%s,\nDobrodosao nazag na server !\n\nKako bi nastavio s igrom molimo\nte upisi lozinku:", pName(playerid));
	ShowPlayerDialog(playerid, LOGIN_DIALOG_PASSWORD, DIALOG_STYLE_PASSWORD, str, str2, "Prijava", "Odustani");
	return 1; }
//------------------------------------------------------------------------------
stock SetupPlayerForRegister(playerid) {
    new str[64], str2[256];
	format(str, sizeof(str), ""SPLAVA"%s - Pravila", SERVER_NAME);
	format(str2, sizeof(str2), ""BELA"%s,\nDobrodosao na nas server! \n\nKako bi igrao moras prihvatiti\ndole navedena pravila:\n\n1. Zabranjeno vredjanje!\n2. Zabranjen DM (Stroga kazna!)\n3. Zabranjeno iskoriscavanje BUG-ova (Stroga kazna!)\n4. Zabranjeno varanje (Stroga kazna!)\n\nDa li prihvatas navedena pravila?", pName(playerid));
	ShowPlayerDialog(playerid, REGISTER_DIALOG_RULES, DIALOG_STYLE_MSGBOX, str, str2, "Prihvatam", "Odbijam");
	return 1; }
	
	//============================================================================ > Fnkcija za dobiti ime spola igraca

stock GetSexName(sex) {
	new str[12];
	if(sex == 0) { format(str, sizeof(str), "Musko");
	}else if(sex == 1) { format(str, sizeof(str), "Zensko"); }
	return str; }

//=============================================================================> LoginPlayer - funkcija
stock LoginPlayer(playerid) {
    new str[64];
	format(str, sizeof(str), "/Korisnici/%s.ini", pName(playerid));
	//Ucitavamo igracevu statistiku (//STATISTIKA)
	SetPVarInt(playerid, "is_logged", 1);
	SetPVarInt(playerid, "godine", dini_Int(str, "godine"));
	SetPVarInt(playerid, "pol", dini_Int(str, "pol"));
	SetPVarInt(playerid, "skin", dini_Int(str, "skin"));
	//--------------------------------------------------------------------------
	//Namjestavamo igracu ostale stvari na serveru
	SetPlayerSkin(playerid, GetPVarInt(playerid, "skin"));
	//--------------------------------------------------------------------------
	//Saljemo igracu poruku da se uspjesno logirao na server
	new str2[128];
	ClearText(playerid);
	format(str2, sizeof(str2), ""SPLAVA"%s"BELA", dobrodosao na %s !", pName(playerid), SERVER_NAME);
	SendClientMessage(playerid, -1, str2);
	SendClientMessage(playerid, -1, ""BELA"Uspesno si se ulogovao, zelimo ti ugodnu igru !");
	SendClientMessage(playerid, -1, ""BELA"Zeli ti SH:RP Admin team!");
	//--------------------------------------------------------------------------
	return 1; }

//============================================================================ > ClearText - funkcija koja igracu brise chat

stock ClearText(playerid) {
	for(new i=0;i<100;i++) { SendClientMessage(playerid, -1, ""BELA" "); }
	return 1; }

//============================================================================ > udb_hash

stock udb_hash(buf[]) {
    new length=strlen(buf), s1 = 1, s2 = 0, n;
    for (n=0; n<length; n++) { s1 = (s1 + buf[n]) % 65521; s2 = (s2 + s1)     % 65521; }
    return (s2 << 16) + s1; }
Please help! Bye!
Reply
#2

There are most likely missing brackets.

U can use tools like:
https://sampforum.blast.hk/showthread.php?tid=291018

to spot the right line faster.

Use proper indentation to spot a missing bracket faster.
Reply
#3

Problem:
Код:
Error 99: Line:    new str[64]; format(str, sizeof(str), "/Korisnici/%s.ini", pName(playerid));
Код:
Error 100: Line:    if(!dini_Exists(str)) { SetupPlayerForLogin(playerid);
Код:
Error 101: Line:    }else{ SetupPlayerForRegister(playerid); }
Код:
Warring 103: Line:  return 1; }
Код:
Error 111: Line: 	    if(!response) return Kick(playerid);
Код:
Error 114: Line: 	    format(str2, sizeof(str2), ""SPLAVA"%s,\nupisi koliko imas godina:", pName(playerid));
Код:
Error 119: Line: 	    if(!response) return Kick(playerid);
Код:
Error 124: Line: 	   	 	format(str2, sizeof(str2), ""BELA"%s,\nupisi koliko imas godina:", pName(playerid));
Код:
Error 126: Line: 	    	return 1; }
Код:
Error 130: Line: 	   	 	format(str2, sizeof(str2), ""BELA"%s,\nupisi koliko imas godina\n\n"CRVENA"Ne mozes imati manje od 10 a vise od 80 godina!", pName(playerid));
Код:
Error 132: Line:  	    	return 1; }
Код:
Error 140: Line: 	    if(!response) return Kick(playerid);
Код:
Error 146: Line: 	 	format(str2, sizeof(str2), ""BELA"%s,\nupisi lozinku:", pName(playerid));
Код:
Error 151: Line: 	    if(!response) return Kick(playerid);
Код:
Error 155: Line: 		 	format(str2, sizeof(str2), ""BELA"%s,\nupisi lozinku:\n\n"CRVENA"Lozinka mora imati\nizmedu 5 i 20 znakova !", pName(playerid));
Код:
Error 157: Line: 	        return 1; }
Код:
Error 158: Line: 		rInfo[playerid][Player_Lozinka] = udb_hash(inputtext);
Код:
Error 161: Line: 		format(str2, sizeof(str2), ""BELA"%s,\nupisani podatci:\n\n"SPLAVA"Ime:"BELA"%s\n"SPLAVA"Lozinka:"BELA"%s\n"SPLAVA"Godine:"BELA"%d"SPLAVA"\nSpol:"BELA"%s\n\nUkoliko su upisani podatci tocni\nklikni dalje, ukoliko nisu klikni\nna ponovi !", pName(playerid), pName(playerid), inputtext, rInfo[playerid][Player_Godine], GetPolName(rInfo[playerid][Player_Pol]));
Код:
Error 166: Line: 	    if(!response) return SetupPlayerForRegister(playerid);
Код:
Error 169: Line: 		format(str, sizeof(str), "/Korisnici/%s.ini", pName(playerid));
Код:
Error 179: Line: 	    SetupPlayerForLogin(playerid);
Код:
Error 184: Line: 	    if(!response) return Kick(playerid);
Код:
Error 185: Line: 	    if(!strlen(inputtext)) return SetupPlayerForLogin(playerid);
Код:
Error 185 have two errors!
Код:
Error 187: Line: 		format(str, sizeof(str), "/Korisnici/%s.ini", pName(playerid));
Код:
Error 188: Line: 		if(udb_hash(inputtext) != dini_Int(str, "password")) {
Reply
#4

Yes, just make sure all brackets that are opened are closed later on again.
Reply
#5

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
There are most likely missing brackets.

U can use tools like:
https://sampforum.blast.hk/showthread.php?tid=291018

to spot the right line faster.

Use proper indentation to spot a missing bracket faster.
Ok i'll try!
Reply
#6

http://prntscr.com/5f2b61 why don't move?
Reply
#7

Add bracket }

pawn Код:
}else if(dialogid == LOGIN_DIALOG_PASSWORD) {
        if(!response) return Kick(playerid);
        if(!strlen(inputtext)) return SetupPlayerForLogin(playerid);
        new str[64];
        format(str, sizeof(str), "/Korisnici/%s.ini", pName(playerid));
        if(udb_hash(inputtext) != dini_Int(str, "password")) {
            SetPVarInt(playerid, "login_fail", GetPVarInt(playerid, "login_fail")+1);
            if(GetPVarInt(playerid, "login_fail") == MAX_LOGIN_FAILS) return Kick(playerid);
            SetupPlayerForLogin(playerid);
        }else{
            LoginPlayer(playerid);
            return 1; } // <-- here is missing second }
Reply
#8

@jefff thankssssssssssssss WORK
Reply
#9

But login/register system is buged xD
I dont have register system in start, only login and when i put passwrod nothing doing...
Ohh xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)