[AJUDA] Warnings
#1

\pawno\include\dutils.inc(2 : warning 219: local variable "string" shadows a variable at a preceding level
\pawno\include\dutils.inc(132) : warning 219: local variable "string" shadows a variable at a preceding level
\pawno\include\dutils.inc(172) : warning 219: local variable "string" shadows a variable at a preceding level
\pawno\include\dutils.inc(280) : warning 219: local variable "string" shadows a variable at a preceding level
\pawno\include\dutils.inc(337) : warning 219: local variable "string" shadows a variable at a preceding level
\pawno\include\dutils.inc(379) : warning 219: local variable "string" shadows a variable at a preceding level

http://pastebin.com/dfP84GFD
Reply
#2

Vocк jб definiu a vбriavel " string "...
Reply
#3

Eu nгo defini nada quem foi que definiu foi o falcon

que eu fasso?
Reply
#4

Quote:
Originally Posted by Chis
Посмотреть сообщение
Eu nгo defini nada quem foi que definiu foi o falcon

que eu fasso?
Ou Troca a variavel 'string' da include para outro nome ou faзa o mesmo com o Gamemode.

@OFF

Quote:
Originally Posted by Chis
Посмотреть сообщение
Eu nгo defini nada quem foi que definiu foi o falcon
#RIALTO KKKKKKKKKKKKKKKK
Reply
#5

Vefique Se Tem
pawn Код:
new string[256];
Reply
#6

Quote:
Originally Posted by Chis
Посмотреть сообщение
Eu nгo defini nada quem foi que definiu foi o falcon

que eu fasso?
Tire a vбriavel global " string " do GM/FS ou include.
Reply
#7

apenas ponha

pawn Код:
new string[256];
em cima das linhas que estгo dando warnings
Reply
#8

Quote:
Originally Posted by Stronda xD
Посмотреть сообщение
apenas ponha

pawn Код:
new string[256];
em cima das linhas que estгo dando warnings
Os warnings estгo sendo causados porque a variбvel string foi definida.

E porque usar 256 cйlulas? (string[256])
Reply
#9

@Alls
Nem um nem outro funciono

Tudo que ta aqui http://pastebin.com/dfP84GFD ta no meu .pwn

PS: Como que tira string da include dutils

PHP код:
/*
 *            DUtils functions 1.9
 *       © Copyright 2006-2007 by DracoBlue
 *
 * @author    : DracoBlue (http://dracoblue.com)
 * @date      : 8th April 2006
 * @update    : 21st June. 2007
 *
 * This file is provided as is (no warranties).
 *
 */
#if defined _dutils_included
  #endinput
#endif
#define _dutils_included
#pragma library dutils
#define MAX_STRING 255
new PRIVATE_Last_Money[MAX_PLAYERS];
/*
 * First version released by mike, this one created by DracoBlue
 * Has also a fix to use "-" and "+" in the beginning of the number.
 */
stock isNumeric(const string[]) {
    new 
length=strlen(string);
    if (
length==0) return false;
    for (new 
0lengthi++) {
        if (
        (
string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+'// Not a number,'+' or '-'
        
|| (string[i]=='-' && i!=0)                                             // A '-' but not at first.
        
|| (string[i]=='+' && i!=0)                                             // A '+' but not at first.
        
) return false;
    }
    if (
length==&& (string[0]=='-' || string[0]=='+')) return false;
    return 
true;
}
/*
 * Originally created by mabako, tuned by DracoBlue
 */
stock mktime(hour,minute,second,day,month,year) {
    new 
timestamp2;
    
timestamp2 second + (minute 60) + (hour 3600);
    new 
days_of_month[12];
    if ( ((
year == 0) && (year 100 != 0)) || (year 400 == 0) ) {
            
days_of_month = {31,29,31,30,31,30,31,31,30,31,30,31}; // Schaltjahr
        
} else {
            
days_of_month = {31,28,31,30,31,30,31,31,30,31,30,31}; // keins
        
}
    new 
days_this_year 0;
    
days_this_year day;
    if(
month 1) { // No January Calculation, because its always the 0 past months
        
for(new i=0i<month-1;i++) {
            
days_this_year += days_of_month[i];
        }
    }
    
timestamp2 += days_this_year 86400;
    for(new 
j=1970;j<year;j++) {
        
timestamp2 += 31536000;
        if ( ((
year == 0) && (year 100 != 0)) || (year 400 == 0) )  timestamp2 += 86400// Schaltjahr + 1 Tag
    
}
    return 
timestamp2;
}
/**
 *  Return if a Email is valid or not
 *  @param   value
 */
stock ValidEmail(email[]) {
  new 
len=strlen(email);
  new 
cstate=0;
  new 
i;
  for(
i=0;i<len;i++) {
    if ((
cstate==|| cstate==1) && (email[i]>='A' && email[i]<='Z') || (email[i]>='a' && email[i]<='z')  || (email[i]=='.')  || (email[i]=='-')  || (email[i]=='_'))
    {
    } else {
       
// Ok no A..Z,a..z,_,.,-
       
if ((cstate==0) &&(email[i]=='@')) {
          
// its an @ after the name, ok state=1;
          
cstate=1;
       } else {
          
// Its stuff which is not allowed
          
return false;
       }
    }
  }
  if (
cstate<1) return false;
  if (
len<6) return false;
  
// A toplevel domain has only 3 to 4 signs :-)
  
if ((email[len-3]=='.') || (email[len-4]=='.') || (email[len-5]=='.')) return true;
  return 
false;
}
/**
 *  Return a timestamp
 */
stock Time() {
  new 
hour,minute,second;
  new 
yearmonth,day;
  
gettime(hourminutesecond);
  
getdate(yearmonthday);
  return 
mktime(hour,minute,second,day,month,year);
}
/**
 *  Return a timestamp
 */
stock Now() {
  new 
hour,minute,second;
  new 
yearmonth,day;
  
gettime(hourminutesecond);
  
getdate(yearmonthday);
  return 
mktime(hour,minute,second,day,month,year);
}
/**
 *  Return the value of an hex-string
 *  @param string
 */
stock HexToInt(string[]) {
  if (
string[0]==0) return 0;
  new 
i;
  new 
cur=1;
  new 
res=0;
  for (
i=strlen(string);i>0;i--) {
    if (
string[i-1]<58res=res+cur*(string[i-1]-48); else res=res+cur*(string[i-1]-65+10);
    
cur=cur*16;
  }
  return 
res;
}
/**
 *  Return the int as string
 *  @param   number
 */
stock IntToHex(number)
{
    new 
m=1;
    new 
depth=0;
    while (
number>=m) {
        
m*16;
        
depth++;
    }
    
depth--;
    new 
str[MAX_STRING];
    for (new 
depth>= 0i--)
    {
        
str[i] = ( number 0x0F) + 0x30// + (tmp > 9 ? 0x07 : 0x00)
        
str[i] += (str[i] > '9') ? 0x07 0x00;
        
number >>= 4;
    }
    
str[8] = '\0';
    return 
str;
}
/**
 *  Return the string as int
 *  @param   string
 */
stock StrToInt(string[]) {
  return 
strval(string);
}
/**
 *  Return the value as string
 *  @param   value
 */
stock IntToStr(value) {
  new 
tmp[MAX_STRING];
  
valstr(tmpvalue);
  return 
tmp;
}
/**
 *  Return the truncated value
 *  @param   Float:value
 */
stock trunc(Float:value) {
    return 
floatround(value,floatround_floor);
}
/**
 *  Sets money for player
 *  @param   playerid
 *           howmuch
 */
stock SetPlayerMoney(playerid,howmuch) {
  
PRIVATE_Last_Money[playerid]=howmuch;
  
GivePlayerMoney(playerid,howmuch-GetPlayerMoney(playerid));
}
/**
 *  Copies a file (Source file won't be deleted!)
 *  @param   oldname
 *           newname
 *  @requires WINDOWS
 */
stock fcopy(oldname[],newname[]) {
    new 
File:ohnd,File:nhnd;
    if (!
fexist(oldname)) return false;
    
ohnd=fopen(oldname,io_read);
    
nhnd=fopen(newname,io_write);
    new 
buf2[1];
    new 
i;
    for (
i=flength(ohnd);i>0;i--) {
        
fputchar(nhndfgetchar(ohndbuf2[0],false),false);
    }
    
fclose(ohnd);
    
fclose(nhnd);
    return 
true;
}
/**
 *  Copies a textfile (Source file won't be deleted!)
 *  @param   oldname
 *           newname
 */
stock fcopytextfile(oldname[],newname[]) {
    new 
File:ohnd,File:nhnd;
    if (!
fexist(oldname)) return false;
    
ohnd=fopen(oldname,io_read);
    
nhnd=fopen(newname,io_write);
    new 
tmpres[MAX_STRING];
    while (
fread(ohnd,tmpres)) {
        
StripNewLine(tmpres);
        
format(tmpres,sizeof(tmpres),"%s\r\n",tmpres);
        
fwrite(nhnd,tmpres);
    }
    
fclose(ohnd);
    
fclose(nhnd);
    return 
true;
}
/**
 *  Renames a file (Source file will be deleted!)
 *  @param   oldname
 *           newname
 *  @requires WINDOWS (because fcopy does)
 */
stock frename(oldname[],newname[]) {
    if (!
fexist(oldname)) return false;
    
fremove(newname);
    if (!
fcopy(oldname,newname)) return false;
    
fremove(oldname);
    return 
true;
}
/**
 *  Strips Newline from the end of a string.
 *  Idea: ******, Bugfixing (when length=1) by DracoBlue
 *  @param   string
 */
stock StripNewLine(string[])
{
    new 
len strlen(string);
    if (
string[0]==0) return ;
    if ((
string[len 1] == '\n') || (string[len 1] == '\r')) {
        
string[len 1] = 0;
        if (
string[0]==0) return ;
        if ((
string[len 2] == '\n') || (string[len 2] == '\r')) string[len 2] = 0;
    }
}
/**
 *  Copies items from one array/string into return.
 *  @param   source
 *           index (where to start, 0 is first)
 *           numbytes (how much)
 */
ret_memcpy(source[],index=0,numbytes) {
    new 
tmp[MAX_STRING];
    new 
i=0;
    
tmp[0]=0;
    if (
index>=strlen(source)) return tmp;
    if (
numbytes+index>=strlen(source)) numbytes=strlen(source)-index;
    if (
numbytes<=0) return tmp;
    for (
i=index;i<numbytes+index;i++) {
        
tmp[i-index]=source[i];
        if (
source[i]==0) return tmp;
    }
    
tmp[numbytes]=0;
    return 
tmp;
}
/**
 *  Copies items from one array/string into another.
 *  @param   dest
 *           source
 *           count
 */
stock copy(dest[],source[],count) {
    
dest[0]=0;
    if (
count<0) return false;
    if (
count>strlen(source)) count=strlen(source);
    new 
i=0;
    for (
i=0;i<count;i++) {
        
dest[i]=source[i];
        if (
source[i]==0) return true;
    }
    
dest[count]=0;
    return 
true;
}
/**
 *  Deletes the first 'count' items of a array/string
 *  @param   string[]
 *           count
 */
stock delete(string[],count) {
    new 
tmp[MAX_STRING];
    
tmp[0]=0;
    if (
count<=0) {
        
format(tmp,sizeof(tmp),"%s",string);
        return 
tmp;
    }
    
tmp=ret_memcpy(string,count,strlen(string));
    return 
tmp;
}
/**
 *  Sets a string's value to source.
 *  @param   dest
 *           source
 *           count
 */
stock set(dest[],source[]) {
    new 
count strlen(source);
    new 
i=0;
    for (
i=0;i<count;i++) {
        
dest[i]=source[i];
    }
    
dest[count]=0;
}
/**
 *  Checks wether two strings are equal (case insensetive)
 *  @param   str1
 *           str2
 */
stock equal(str1[],str2[],bool:ignorecase) {
    if (
strlen(str1)!=strlen(str2)) return false;
    if (
strcmp(str1,str2,ignorecase)==0) return true;
    return 
false;
}
/**
 *  Returns an element of a string splitted by ' ', default index is 0.
 *  @param   string
 *           index
 */
stock mod(up,down) {
  return 
up-(floatround((up/down),floatround_floor))*down;
}
stock div(up,down) {
  return (
floatround((up/down),floatround_floor));
}
/**
 *  Returns a hashed value in adler32 as int
 *  @param   buf
 */
stock num_hash(buf[])
 {
    new 
length=strlen(buf);
    new 
s1 1;
    new 
s2 0;
    new 
n;
    for (
n=0n<lengthn++) {
       
s1 = (s1 buf[n]) % 65521;
       
s2 = (s2 s1)     % 65521;
    }
    return (
s2 << 16) + s1;
 }
/**
 *  Returns a hashed value in adler32 as string
 *  @param   buf
 */
stock hash(str2[]) {
   new 
tmpdasdsa[MAX_STRING];
   
tmpdasdsa[0]=0;
   
valstr(tmpdasdsa,num_hash(str2));
   return 
tmpdasdsa;
}
/**
 *  Returns a string which has 'newstr' where 'trg' was before
 *  @param   trg
 *           newstr
 *           src
 */
stock strreplace(trg[],newstr[],src[]) {
    new 
f=0;
    new 
s1[MAX_STRING];
    new 
tmp[MAX_STRING];
    
format(s1,sizeof(s1),"%s",src);
    
strfind(s1,trg);
    
tmp[0]=0;
    while (
f>=0) {
        
strcat(tmp,ret_memcpy(s10f));
        
strcat(tmp,newstr);
        
format(s1,sizeof(s1),"%s",ret_memcpy(s1f+strlen(trg), strlen(s1)-f));
        
strfind(s1,trg);
    }
    
strcat(tmp,s1);
    return 
tmp;
}
/**
 *  Returns the string with lowercase
 *  @param   txt
 */
stock strlower(txt[]) {
    new 
tmp[MAX_STRING];
    
tmp[0]=0;
    if (
txt[0]==0) return tmp;
    new 
i=0;
    for (
i=0;i<strlen(txt);i++) {
        
tmp[i]=tolower(txt[i]);
    }
    
tmp[strlen(txt)]=0;
    return 
tmp;
}
/**
 *  Returns the string with uppercase
 *  @param   txt
 */
stock strupper(txt[]) {
    new 
tmp[MAX_STRING];
    
tmp[0]=0;
    if (
txt[0]==0) return tmp;
    new 
i=0;
    for (
i=0;i<strlen(txt);i++) {
        
tmp[i]=toupper(txt[i]);
    }
    
tmp[strlen(txt)]=0;
    return 
tmp;

Reply
#10

й teu pawno q da isto nb --'
aqui meu gm qnd eu aperto f5 no infernus pawn ele fica dando os mesmos erros na include dutitls

no normal vai de boa '-'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)