SA-MP Forums Archive
Compiling error...+rep for solution - 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: Compiling error...+rep for solution (/showthread.php?tid=512771)



Compiling error...+rep for solution - saikumar - 12.05.2014

i added this cmd to the moneybag script

pawn Код:
if(!strcmp("/mbdis", cmdtext, true))
    {
        new string[64];
        new distance = GetPlayerDistanceFromPoint(playerid, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2]);
        format(string, sizeof(string), "The MoneyBag is %i meters away", distance);
        SendClientMessage(playerid, -1, string);
    }
full code: http://pastebin.com/UtUsMXG2

i am getting this errors

C:\DOCUME~1\SAIKUM~1\Desktop\Server\Gm\MONEYB~1.PW N(567) : error 017: undefined symbol "playerid"
C:\DOCUME~1\SAIKUM~1\Desktop\Server\Gm\MONEYB~1.PW N(567) : warning 213: tag mismatch
C:\DOCUME~1\SAIKUM~1\Desktop\Server\Gm\MONEYB~1.PW N(569) : error 017: undefined symbol "playerid"
C:\DOCUME~1\SAIKUM~1\Desktop\Server\Gm\MONEYB~1.PW N(580) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.






my aim is to make a command that shows that how many meters the player is away from the pickup ot moneyag


Re: Compiling error...+rep for solution - Stanford - 12.05.2014

Add this command under OnPlayerCommandText.


Re: Compiling error...+rep for solution - saikumar - 12.05.2014

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Add this command under OnPlayerCommandText.
thats what i did


Re: Compiling error...+rep for solution - SAMProductions - 13.05.2014

and it is a Float, right ?

(EDIT :- or add it in OnPlayerCommandText >> "public OnPlayerCommandText(playerid, cmdtext[])")


Re: Compiling error...+rep for solution - IceBilizard - 13.05.2014

pawn Код:
C:\DOCUME~1\SAIKUM~1\Desktop\Server\Gm\MONEYB~1.PW N(569) : error 017: undefined symbol "playerid"
because of

pawn Код:
forward MoneyBag();
public MoneyBag()
timers you did not define playerid in timer


Re: Compiling error...+rep for solution - saikumar - 13.05.2014

Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
and it is a Float, right ?

(EDIT :- or add it in OnPlayerCommandText >> "public OnPlayerCommandText(playerid, cmdtext[])")
thats what i did

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

    if(!strcmp("/mbdis", cmdtext, true))
    {
        new string[64];
        new Float: distance = GetPlayerDistanceFromPoint(playerid, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2]);
        format(string, sizeof(string), "The MoneyBag is %.1f meters away", distance);
        SendClientMessage(playerid, -1, string);
        return 1;
    }
please help me somebody...


Re: Compiling error...+rep for solution - Lynn - 13.05.2014

View my reply.


Re: Compiling error...+rep for solution - IceBilizard - 13.05.2014

Quote:
Originally Posted by Lynn
Посмотреть сообщение
View my reply.
you did a little mistake in your code

pawn Код:
new distancestring[127];
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
            new Float:distance = GetPlayerDistanceFromPoint(i, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2]);
            format(distancestring, sizeof(string), "The MoneyBag is %i meters away", distance);// see this line
            SendClientMessage(i, -1, string);
            }



Re: Compiling error...+rep for solution - saikumar - 13.05.2014

it is showing you are 1002456 meters away even tho i am front of the mb.

help me please


Re: Compiling error...+rep for solution - BroZeus - 13.05.2014

format(string, sizeof(string), "The MoneyBag is %i meters away", distance);
CHANGE THIS TO THE FOLLOWING--
format(string, sizeof(string), "The MoneyBag is %1f meters away", distance);