Compiling error...+rep for solution
#1

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
Reply
#2

Add this command under OnPlayerCommandText.
Reply
#3

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

and it is a Float, right ?

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

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
Reply
#6

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...
Reply
#7

View my reply.
Reply
#8

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);
            }
Reply
#9

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

help me please
Reply
#10

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);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)