Jump to content
  • 0

pomoc DOF2 Help


LukasB

Dotaz

Errory:

error 006: must be assigned to an array
error 006: must be assigned to an array
error 006: must be assigned to an array
error 006: must be assigned to an array
Kód:

new Administrator,Zabanovany,IP,Dovod,Cas;
 
   Administrator = DOF2_GetString(Account(playerid),"Meno admina","Ban");
   Zabanovany = DOF2_GetString(Account(playerid),"Meno zabanovaneho","Ban");
   IP = DOF2_GetInt(Account(playerid),"IP Zabanovaneho","Ban");
   Dovod = DOF2_GetString(Account(playerid),"Dôvod","Ban");
   Cas = DOF2_GetString(Account(playerid),"Èas","Ban");

 

Edited by LukasB
Link to comment
Share on other sites

Recommended Posts

  • 0

a potom toto :  

DOF2_CreateFile(BansCas(playerid));
DOF2_SetString(BansCas(ID),"Meno admina",GetName(playerid),"Ban");
DOF2_SetString(BansCas(ID),"Meno zabanovaneho",GetName(ID),"Ban");
DOF2_SetString(BansCas(ID),"IP Zabanovaneho",GetIP(ID),"Ban");
DOF2_SetString(BansCas(ID),"Dôvod",Dovod,"Ban");
     DOF2_SetInt(BansCas(ID),"Cas",Konec,"Ban");
DOF2_SaveFile();

Stock:

 

stock BansCas(playerid)
{
   new str[12 + MAX_PLAYER_NAME];
   format(str,sizeof(str),"GRE/Bany/%s/%s-banc.ini",GetName(playerid),GetName(playerid));
   return str;
}
Edited by LukasB
Link to comment
Share on other sites

  • 0

Stále to padá .. napíšem príkaz a zhodí mi to server...


Ahaa ;D DIK


Ale zistim som, že aj pri

   Administrator = DOF2_GetString(BansCas(playerid),"Meno admina");
        Zabanovany = DOF2_GetString(BansCas(playerid),"Meno zabanovaneho");
        IP = DOF2_GetInt(BansCas(playerid),"IP Zabanovaneho");
        Dovod = DOF2_GetString(BansCas(playerid),"Dôvod");
        Cas = DOF2_GetInt(BansCas(playerid),"Cas");

píše tú istí chybu ako pri tvojom ...

Len problém je že pokial som tam mal GetInt nic nerobilo

Edited by LukasB
Link to comment
Share on other sites

  • 0

~> Až teď jsem zjistil k čemu to chceš, a musím ti říct, že to máš naprosto pitomě(už jsem dokonce něco hodně podobného viděl). Nemluvě o tom načítání, tak, začni tím, že si to zjednodušíš:

 

 

enum MAX_BAN_INFO {
	AdminNick[MAX_PLAYER_NAME+1],
	Duvod[120],
	Cas,
	IP[26],
}

new
	BanInfo[50][MAX_BAN_INFO];
~> A pak to postupně načítáš. Nick banovaného načítat nemusíš, když jde o konkrétního hráče, a string(v tomhle případě důvod, ip a admin nick) samozřejmě musíš načítat formatem:

 

 

	new
		Nick[MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, Nick, sizeof(Nick));
	
	BanInfo[playerid][Cas] = DOF2_GetInt(Account(playerid), "Cas");
	format(BanInfo[playerid][AdminNick], MAX_PLAYER_NAME+1, DOF2_GetString(Account(playerid), "AdminNick");
	format(BanInfo[playerid][IP], 26, DOF2_GetString(Account(playerid), "IP");
	format(BanInfo[playerid][Duvod], 26, DOF2_GetString(Account(playerid), "Duvod");

SkiBigu... tvůj koment byl asi dost nepopsanej že to nepochopil.... :d

Link to comment
Share on other sites

  • 0

1. Skúšal som to aj z formátom ale stále to isté ... Načítanie, a nemám to na Hráča ale na IP lebo keby niekto dostane ban, tak sa tam môže pripojiť znovu a znovu...

Link to comment
Share on other sites

  • 0
riadok:1039         BanInfo[playerid][pAdministrator] = DOF2_GetString(BansCas(playerid),"Meno admina");
riadok:1040         BanInfo[playerid][pZabanovany] = DOF2_GetString(BansCas(playerid),"Meno zabanovaneho");
riadok:1041         BanInfo[playerid][pIp] = DOF2_GetString(BansCas(playerid),"IP Zabanovaneho");
riadok:1042         BanInfo[playerid][pDovod] = DOF2_GetString(BansCas(playerid),"Dôvod");
riadok:1043         BanInfo[playerid][pCas] = DOF2_GetInt(BansCas(playerid),"Cas");

Chyby:
(1039) : error 006: must be assigned to an array
(1040) : error 006: must be assigned to an array
(1041) : error 047: array sizes do not match, or destination array is too small
(1042) : error 047: array sizes do not match, or destination array is too small

-V enume mam svoje premenne, aby si vedel...

Edited by LukasB
Link to comment
Share on other sites

  • 0

mal som ju tam aj tak neslo ....


Keď dam dialku :

(1039) : error 006: must be assigned to an array
(1040) : error 006: must be assigned to an array
(1041) : error 047: array sizes do not match, or destination array is too small
(1042) : error 047: array sizes do not match, or destination array is too small


Pls pomôžte :(

Link to comment
Share on other sites

  • 0

jedinej kdo je tu omyl přírody jsi ty... když neumíš pawn nedělej ze začatku tak "složité" věci.. jinak tu pak nevidim důvod jakto že mě tenhle code šel v pohodě a tobě ne....

Link to comment
Share on other sites

  • 0

1.Skúsil som všetky radi ...

2.Robím to 3 deň a stále to píše tú istú chybu ...

3.Keby som nevedel pawn tak nemam cely vlastný admin system a vehicle system...

4.Keď tam dam DOF2_GetString píše chybu, ale keď napr. DOF2_GetInt = nemá to žiaden problém, ale objaví sa až v hre ...

Link to comment
Share on other sites

  • 0

zklidni se. a pochop ze nemuzes nacitat string do obycejny promeny. potrebujes pole (array). az tam budes mit pole tak ukaz co to pise.

Link to comment
Share on other sites

  • 0


BanInfo[playerid][Cas] = DOF2_GetInt(Account(playerid), "Cas");//int
format(BanInfo[playerid][AdminNick], MAX_PLAYER_NAME+1, DOF2_GetString(Account(playerid), "AdminNick");//STRING
format(BanInfo[playerid][IP], 26, DOF2_GetString(Account(playerid), "IP");//STRING
format(BanInfo[playerid][Duvod], 26, DOF2_GetString(Account(playerid), "Duvod");//STRING

 

Edited by Steam Wallet
Link to comment
Share on other sites

  • 0

String ale keď tam dam tieš array píše to tú istú chybu ako Dovodu a Ipcke


 

	BanInfo[playerid][Cas] = DOF2_GetInt(Account(playerid), "Cas");//int
	format(BanInfo[playerid][AdminNick], MAX_PLAYER_NAME+1, DOF2_GetString(Account(playerid), "AdminNick");//STRING
	format(BanInfo[playerid][IP], 26, DOF2_GetString(Account(playerid), "IP");//STRING
	format(BanInfo[playerid][Duvod], 26, DOF2_GetString(Account(playerid), "Duvod");//STRING

 

Prepáč .. ale stále také isté chyby...

Link to comment
Share on other sites

  • 0

Všetko ohladne toho ...

 

 

 

Načítavanie pri pripojení hráča :

  if(DOF2_FileExists(BansCas(playerid)))
  {
Riadok: 1031   BanInfo[playerid][pAdministrator] = DOF2_GetString(BansCas(playerid),"Meno admina");
Riadok: 1032        BanInfo[playerid][pZabanovany] = DOF2_GetString(BansCas(playerid),"Meno zabanovaneho");
Riadok: 1033        BanInfo[playerid][pIp] = DOF2_GetString(BansCas(playerid),"IP Zabanovaneho");
Riadok: 1034        BanInfo[playerid][pDovod]  = DOF2_GetString(BansCas(playerid),"Dôvod");
Riadok: 1035        BanInfo[playerid][pCas] = DOF2_GetInt(BansCas(playerid),"Cas");

        if(BanInfo[playerid][pCas] > gettime())
        {
       new str[300];
           format(str, sizeof(str),"{F0320C}Administrátor %s vás zabanoval\n{F0A40C}Nick: %s\n{F0A40C}IP: %s\n{F0A40C}Dôvod: %s\nBan vyprší %s !\n{C2B291}Pokial si myslíte že ban je udelený neprávom Stlaete F8\na požiadajte o UnBan na našom diskusnom fóre !",
           BanInfo[playerid][pAdministrator],BanInfo[playerid][pZabanovany],BanInfo[playerid][pIp],BanInfo[playerid][pDovod],date(BanInfo[playerid][pCas]));
ShowPlayerDialog(playerid,0, DIALOG_STYLE_MSGBOX,"Bol ste zabanovaní!",str,"Ok","");
SetTimerEx("Tkick2",100,0,"1",playerid);
return 0;
        }
  }

 

Stock:

stock BansCas(playerid)
{
   new str[12 + MAX_PLAYER_NAME];
   format(str,sizeof(str),"GRE/Bany/%s-banc.ini",GetIP(playerid));
   return str;
}

Enum:

enum pBan
{
  pAdministrator,
  pZabanovany,
  pIp[26],
  pDovod[30],
  pCas,
}
new BanInfo                     [MAX_PLAYERS][pBan]; 

Chyby:

(1031) : error 006: must be assigned to an array
(1032) : error 006: must be assigned to an array
(1033) : error 047: array sizes do not match, or destination array is too small
(1034) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

 

 

Edited by LukasB
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...