Errors [REP+] - 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: Errors [REP+] (
/showthread.php?tid=562873)
Errors [REP+] -
SecretBoss - 12.02.2015
Hello
I have the following errors
pawn Код:
(13239) : error 021: symbol already defined: "strtok"
(13254) : error 047: array sizes do not match, or destination array is too small
(13707) : error 021: symbol already defined: "HexToInt"
Error lines
pawn Код:
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] < 58)
{
res = res + cur * (string[i - 1] - 48);
}
else
{
res = res + cur * (string[i-1] - 65 + 10);
cur = cur * 16;
}
}
return res;
}
stock 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;
}
When I tried to remove that stocks, the compile worked but when I joined in race (Because it is a part from Ryder's race system) I spawned in the air without a car but in correct position/place
+REP to everyone who will help me
Re: Errors [REP+] -
DRIFT_HUNTER - 12.02.2015
remove strtok function (you already have one)
same for hextoint
Re: Errors [REP+] -
SecretBoss - 12.02.2015
Quote:
Originally Posted by DRIFT_HUNTER
remove strtok function (you already have one)
same for hextoint
|
I tried to find the second strtok and Hex but I just found the one is shown above
Re: Errors [REP+] -
PowerPC603 - 12.02.2015
strtok is old, try to replace it with sscanf.
Much easier to use and more flexible.
Re: Errors [REP+] -
SecretBoss - 12.02.2015
And how I can replace it with sscanf?
Re: Errors [REP+] -
asto63 - 12.02.2015
Sscanf is an include, which you can have here:
->
http://lmgtfy.com/?q=SAMP+SSCANF2