[POMOC] GTA:RP - error 047

Započeo black_dota, Decembar 14, 2010, 11:37:29 PRE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

black_dota

Juce sam dobio TUT za pravljenje Organizacija za GF i krenuo sam raditi po Tutu i na kraju mi kad sam compile izbacio je ovo

C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


Taj red:

new f2text[35]; //RED IZNAD
    if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo[targetid][pFMember]][FamilyName]; } //<<< OVO OVDE
else { f2text = "None"; }//RED ISPOD

koristi strmid za stavljanje stringa u drugi string ili jos bolje

strcpy od Y_Lessa

/*----------------------------------------------------------------------------*-
Function:
strcpy
Params:
dest - Destination string.
src - Source string.
len - Maximum length of the destination.
Return:
-
Notes:
-
-*----------------------------------------------------------------------------*/

#define strcpy(%0,%1,%2) \
strcat((%0[0] = '\0', %0), %1, %2)

/*----------------------------------------------------------------------------*/

Poslednja Izmena: Decembar 14, 2010, 14:01:47 POSLE PODNE od John

black_dota

Citat: Hoxxy poslato Decembar 14, 2010, 12:44:10 POSLE PODNE
Stavi ovako:
new f2text[128]; //RED IZNAD 
       if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo[targetid][pFMember][FamilyName]; } //<<< OVO OVDE 
      else { f2text = "None"; }//RED ISPOD  [128]

ma kako god da se stavi isti error

a obrisao sam ta tri reda tj stavio ih pod /* i */ i sad sve normalno compila

FamilyInfo[PlayerInfo[targetid][pFMember][FamilyName]

prouci ovo malo...
Aequam memento rebus in arduis servare mentem.

black_dota

nisam video lol

ali nekontam pre mi je to bilo normalno i normalno je compilao lol

EDIT:

new f2text[64];
    if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo][targetid][pFMember][FamilyName]; }
else { f2text = "None"; }


sad jos sjebanije


C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : error 033: array must be indexed (variable "PlayerInfo")
C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : error 029: invalid expression, assumed zero
C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : warning 215: expression has no effect
C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : error 001: expected token: ";", but found "]"
C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Poslednja Izmena: Decembar 15, 2010, 12:03:30 POSLE PODNE od black_dota

cristiane

Citat: black_dota poslato Decembar 15, 2010, 11:57:48 PRE PODNE
nisam video lol

ali nekontam pre mi je to bilo normalno i normalno je compilao lol

EDIT:

new f2text[64];
    if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo][targetid][pFMember][FamilyName]; }
else { f2text = "None"; }

 
sad jos sjebanije


C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : error 033: array must be indexed (variable "PlayerInfo")
C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : error 029: invalid expression, assumed zero
C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : warning 215: expression has no effect
C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : error 001: expected token: ";", but found "]"
C:\Users\Guest\Desktop\Inferno Gaming Roleplay\gamemodes\igrp.pwn(9101) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo][targetid][pFMember][FamilyName]; }

Izbaci tu zagradu sto sam oznacio crvenim



Ajde stanite s glupostima o zagradama, da ste pogledali ovaj kod sto je on dao vidjeli bi da je dobro stavio zagrade ( vidi se u prilozenome):

FamilyInfo[PlayerInfo[targetid][pFMember]][FamilyName]

Crvene zagrade oznacavaju Array pod imenom FamilyInfo, dok plave oznacavaju PlayerInfo.

U njegovom kodu jedino sto NIJE u redu je nacin na koji izjednacava string f2text sa arrayem, to kod stringova NECE raditi.

Kao sto sam reako treba koristiti strmid ili strcpy koji sam mu gore dao.

Posto se ovdje vidim nikome nista neda i mora se ocito dati gotov kod jer svima je zakljucivanje 0 eto vam ga onda:



VARIJANTA 1.)


new f2text[35];

if (PlayerInfo[targetid][pFMember] < 255)
{
strmid(f2text, FamilyInfo[PlayerInfo[targetid][pFMember]][FamilyName], 0, sizeof(f2text));
}



VARIJANTA 2.)


new f2text[35];

if (PlayerInfo[targetid][pFMember] < 255)
{
strcpy(f2text, FamilyInfo[PlayerInfo[targetid][pFMember]][FamilyName], sizeof(f2text));
}



Naravno da druga varijanta RADI treba prije toga staviti ovo sto sam stavio u prijasnjem postu.