Jump to content
  • 0

Problema sistem logare/inregistrare pe y_ini


Question

Posted (edited)

Problema intalnita (descriere):Salut, sa-mp.ro! Am creat un sistem de inregistrare cu admin/vip, problema este ca imi da doua warning-uri la stockul udb_hash
Ero(area / rile) / warning-(ul / urile):  warning 219: local variable "s1" shadows a variable at a preceding level
                                                         warning 219: local variable "s2" shadows a variable at a preceding level
Liniile de cod / sursa / script-ul:

stock udb_hash(buf[])
{
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1)% 65521;
}
return (s2 << 16) + s1;
}

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Desigur... am incercat sa las spati intre variabile, sa le redenumesc...

Edited by Bobita

// Desenul meu animat 
// Alte episoade aici: 
https://www.youtube.com/channel/UCF2kY1CzhHI_PCyV5LprQ1w/videos

 

 

 

2 answers to this question

Recommended Posts

  • 0
Posted

Uite foloseste asa, dar fi atent, waningurile alea le-ai primit deoarece mai ai 2 variabile globale in gamemode numite s1 si s2.

stock udb_hash( buf[  ] )
{
    new FirstElement = 1, SecondElement = 0;
    for ( new n = 0; n < strlen( buf ); n++ )
    {
        FirstElement = ( FirstElement + buf[ n ] ) % 65521;
        SecondElement = ( SecondElement + FirstElement) % 65521;
    }
    return ( SecondElement << 16 ) + FirstElement;
}

I'm back bitches.

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.