Compile error -
GerryMcRarey - 12.12.2013
Everyone please help me for this error, i will give you +rep if you help me
Код:
C:\Users\COMPAQ\Downloads\Compressed\Freeroam Holic International\Freeroam Holic International\gamemodes\larp.pwn(43798) : error 021: symbol already defined: "NameTimer"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Sorry for my bad english, i'm from Indonesia
Re: Compile error -
ProjectNewYork - 12.12.2013
Can You Show The Lines Around Line 43798?
Re: Compile error -
StuartD - 12.12.2013
This means you already have something called NameTimer, go through your script and find where it says that. If you find two, rename one to something like NameTimer2
Re: Compile error -
GerryMcRarey - 12.12.2013
ProjectNewYork : This in line 43798 public NameTimer()
This in line 40866 NameTimer();
StuartD : When i change the NameTimer to NameTimer2 the compiler say
Код:
C:\Users\COMPAQ\Downloads\Compressed\Freeroam Holic International\Freeroam Holic International\larp.pwn(40866) : error 017: undefined symbol "NameTimer2"
C:\Users\COMPAQ\Downloads\Compressed\Freeroam Holic International\Freeroam Holic International\larp.pwn(43798) : error 021: symbol already defined: "NameTimer"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: Compile error -
StuartD - 12.12.2013
Show the code for:
Public NameTimer()
and
NameTimer();
Re: Compile error -
GerryMcRarey - 12.12.2013
This for NameTimer();
Код:
public CustomPickups()
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new string[128];
NameTimer();
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, oldposx, oldposy, oldposz);
new tmpcar = GetPlayerVehicleID(i);
if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
{
for(new h = 0; h < sizeof(SBizzInfo); h++)
{
if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
{
format(string, sizeof(string), "~w~%s~n~~r~Products Required~w~: %d~n~~y~Price per Product: ~w~: $%d~n~~g~Funds: ~w~: $%d",SBizzInfo[h][sbMessage],(SBizzInfo[h][sbMaxProducts]-SBizzInfo[h][sbProducts]),SBizzInfo[h][sbPriceProd],SBizzInfo[h][sbTill]);
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
if(PlayerToPoint(2.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
{
if(SBizzInfo[h][sbOwned] == 1)
{
format(string, sizeof(string), "~w~%s~w~~n~Owner : %s~n~Extortion by : %s~n~Entrance Fee : ~g~$%d ~n~~w~to enter type /enter",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost]);
}
else
{
format(string, sizeof(string), "~w~%s~w~~n~This Business is for sale~n~Cost: ~g~$%d ~w~Level : %d ~n~to buy this Business type /buybiz",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
}
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
}
This for public NameTimer()
Код:
public NameTimer()
{
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
for(new q = 0;q < MAX_PLAYERS;q++)
{
if(IsPlayerConnected(q))
{
new Float:p1x;
new Float:p1y;
new Float:p1z;
new Float:p2x;
new Float:p2y;
new Float:p2z;
if(IsPlayerConnected(i) && IsPlayerConnected(q))
{
GetPlayerPos(i,p1x,p1y,p1z);
GetPlayerPos(q,p2x,p2y,p2z);
if(GetPointDistanceToPointExMorph(p1x,p1y,p1z,p2x,p2y,p2z) < pdistance)
{
if(PlayerInfo[q][pMaskuse] != 1)
{
ShowPlayerNameTagForPlayer(i,q,1);
}
}
else
{
ShowPlayerNameTagForPlayer(i,q,0);
}
}
}
}
}
}
}
Re: Compile error -
StuartD - 12.12.2013
That looks fine, are you sure there are no other NameTimers in the script?
EDIT: As a Timer the NameTimer(); shouldn't be called on its own, you need to SetTimer, try using this:
https://sampwiki.blast.hk/wiki/SetTimer
Re: Compile error -
GerryMcRarey - 12.12.2013
I've been looking for it and only 2 in this script