Error on compile - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error on compile (
/showthread.php?tid=644506)
Error on compile -
Belengher - 09.11.2017
Hello all
I received this errors in compiler(until now they did not show up, now we've updated all the plugins /include)
Quote:
grandlarc.pwn(15669) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
grandlarc.pwn(15684) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
grandlarc.pwn(24675) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
grandlarc.pwn(25111) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
grandlarc.pwn(36495) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
Pawn compiler 3.10.4 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Line 36495: Adrian(B, item, 0);
This is stock:
stock Adrian(playerid, string[], V)
{
new A, B, C;
if(!V)
{
switch(random(5))
{
case 0: V = 1;
case 1: V = 3;
case 2: V = 5;
case 3: V = 7;
case 4: V = 9;
}
PlayerInfo[playerid][pLoserLevel] = V;
}
switch(V)
{
case 1:
{
A = 3;
B = 4;
C = 7;
}
case 3:
{
A = 8;
B = 9;
C = 1;
}
case 5:
{
A = 3;
B = 7;
C = 4;
}
case 7:
{
A = 1;
B = 3;
C = 9;
}
case 9:
{
A = 5;
B = 2;
C = 6;
}
}
for(new i, l = strlen(string); i < l; i++)
{
switch(string[i])
{
case 48..57:
{
string[i] += A;
if(string[i] > 57) string[i] -= 10;
}
case 65..90:
{
string[i] += B;
if(string[i] > 90) string[i] -= 26;
}
case 97..122:
{
string[i] += C;
if(string[i] > 122) string[i] -= 26;
}
}
}
return string;
}
|
P.S: This stock is a hash password
Re: Error on compile -
Belengher - 09.11.2017
anyone?
Re: Error on compile -
Belengher - 09.11.2017
well, this work fine... until now... I updated my server to 0.3.8 rc and all plugins/ inc.. and received this errors..
Re: Error on compile -
Mauzen - 09.11.2017
@Question: Dont return string, but instead just change the variable. Arrays are passed by reference by default.
I dont see the point of writing an own hash function.
First, it includes randomness, so for the same input it may output different results. This will definitely cause problems sooner or later.
Second, it is just character shifting, easy to analyze, and - even worse - symmetric. The "hash" can be converted back to the plain password. And the whole point of hashing is to prevent that. In terms of security this isnt any better than storing the plain passwords.