[POMOC] Pate me 4 errora i 1 wrning

Započeo MaTTaTa, Oktobar 06, 2010, 08:33:41 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.


Ewo ljudi koji me errori pate , dole imate broj redove koji mi errore izbacuju.... REDOVI ERRORA SU OZNACENI SA CREVENIM.

1.   C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(22245) : error 021: symbol already defined: "strtok"
2.   C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(22260) : error 047: array sizes do not match, or destination array is too small
3.   C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(36001) : warning 219: local variable "mod" shadows a variable at a preceding level
4.   C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(44405) : error 047: array sizes do not match, or destination array is too small
5.   C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(58218) : error 047: array sizes do not match, or destination array is too small

ewo broj reda od svakog errora ili cijela komanda

strtok(const string[], &index)
   {
   new length = strlen(string);
   while ((index < length) && (string[index] <= ' '))
   {
       index++;
   }

   new offset = index;
   new result[20];
   while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
   {
       result[index - offset] = string[index];
       index++;
   }
   result[index - offset] = EOS;
  return result;
}

  if(IsPlayerInRangeOfPoint(playerid, 10, 314.2548,-133.6627,999.6016) || IsPlayerInRangeOfPoint(playerid, 3,311.9589,-166.1407,999.6010))
         {
            new mod = 100;
            tmp = strtok(cmdtext, idx);

if(strcmp(cmd, "/agl", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if (PlayerInfo[playerid][pAdmin] >= 2)
           {
               new x_nr[24];
            x_nr = strtok(cmdtext, idx);
            if(!strlen(x_nr)) {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /agl [name] [playerid/PartOfName]");
                SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving, Flying, Sailing, Fishing, Weapon, Police.");
               return 1;
            }

if(strcmp(cmd,"/skill",true)==0)
   {
       if(IsPlayerConnected(playerid))
       {
           new x_nr[24];
         x_nr = strtok(cmdtext, idx);
         if(!strlen(x_nr)) {
Poslednja Izmena: Oktobar 06, 2010, 08:35:02 PRE PODNE od rakun1993




cristiane

Ubaci ovaj kod na dnu skripte

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

I ubaci ovo cmd = strtok(cmdtext, idx); ispod OnPlayerCommandText [/color]


napravio sam kako si reko i sada imam opet errora

C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(23819) : error 017: undefined symbol "cmd"
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(23819) : error 017: undefined symbol "idx"
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(35984) : warning 219: local variable "mod" shadows a variable at a preceding level
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(44388) : error 047: array sizes do not match, or destination array is too small
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(58239) : error 047: array sizes do not match, or destination array is too small
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(79137) : error 021: symbol already defined: "strtok"
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(79152) : error 047: array sizes do not match, or destination array is too small




cristiane

Moras sve te simbole  definirati probaj iz drugog mod kopirati te simbole.,Ako uspjesno definiras da dva simbola nebi ti trebalo vise bit errora


ewo opet ovo se dogodi kada definiram ??

C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(35983) : warning 219: local variable "mod" shadows a variable at a preceding level
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(44387) : error 047: array sizes do not match, or destination array is too small
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(58238) : error 047: array sizes do not match, or destination array is too small
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(79144) : error 021: symbol already defined: "strtok"
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(79159) : error 047: array sizes do not match, or destination array is too small




C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(79144) : error 021: symbol already defined: "strtok

To ja mislim mozes rijesit sa da kliknes na Error i ona da ce ti on pokazat u kojem se redu nalazi i onda izbrises cijeli taj red.Taj error ti se javlja kad napises npr:

OnPlayerEnterVehicle

//sad tu nes pises

OnPlayerExitVehicle

//sad tu nes pise

OnPlayerEnterVehicle

//sad tu nes pises

Znaci napiso si nes dvaput vjerovatno si skinuo skriptu s neta i htio si nes dodat u nju pa si samo to nesto kopirao u skriptu a nisi prvo pogledo dali vec ta naredba postoji.Pogledaj u skripti dali ti se nes dvaput ponavlja i ako se ponavlja to onda moras kopirat pod naredbu za koju to spada.Znaci nesmis pisati npr

OnPlayerEnterVehicle

//sad si tu upiso da kad igrac udje u infernus da mu pise "uso si u infernus"

OnPlayerEnterVehicle

//sad si tu upiso da kad igrac udje u infernus da mu pise "uso si u rancher"

Znaci sve sto spada pod (u tvom slucaju pod strtok,a u ovom gore navedenom OnPlayerEnterVehicle)OnPlayerEnterVehicle mora ic pod OnPlayerEnterVehicle nesmijes sto puta pisat OnPlayerEnterVehicle.Jos jedino moze bit problem u programu s kojim radis skripte ali ne vjerujem da je tu problem.
<center></center>

cristiane

O cemu ti pricas vidis da je rjesio taj error

Citat: rakun1993 poslato Oktobar 06, 2010, 10:36:50 PRE PODNE

ewo opet ovo se dogodi kada definiram ??

C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(35983) : warning 219: local variable "mod" shadows a variable at a preceding level
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(44387) : error 047: array sizes do not match, or destination array is too small
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(58238) : error 047: array sizes do not match, or destination array is too small
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(79144) : error 021: symbol already defined: "strtok"
C:\Users\RaKuN\Desktop\Radim na njemu\ser 0.3\gamemodes\larp.pwn(79159) : error 047: array sizes do not match, or destination array is too small
Lol o cemu ti pricas vidis da nije -.-

Kako ga je rijesio.Jos si i sam u svom postu napiso.Evo ti link podebljo sam ti njegov problem za koji sam ju ja napiso rješenje

http://img716.imageshack.us/f/capturebae.jpg/

<center></center>

cristiane

to su novi errori koji nisu definisani zar si slijep,rjesi je strtok
Poslednja Izmena: Oktobar 06, 2010, 15:26:21 POSLE PODNE od cristiane

Vjerovatno je moja greška jer baš se i nemogu pohvalit da sam neki skripter ali on je mojda napiso nesto slicno ovom

//Tu idu include filovi

//Tu idu define

//Tu idu new

//Zamislimo da je strtok na prvom mjestu i onda idu publici

//I sad ako je htio izvoditi promjene na skripti koju je skinuo s neta na kojoj je vec bio definiran strtok mozda je tu na kraju skripte ponovno htio koristiti strtok ali mu pawn to neda jer je vec strtok gore definiran

Znam da je i meni bila ta greska kad sam tek poco pisat skripte.
<center></center>