Where am I going wrong?
#1

Hello guys I was working on a GOLDPOT Minigame like i99's Flag Minigame, So i got these errors, Please post the solution to them :/
ERROR 1---Error 001: expected token: "}", but found ";" on this line
pawn Код:
[]new Float:RandomPickup[][3] =
{
(1997.1996,1522.9457,17.0625);
(-2662.3706,1484.8855,7.6846);
}
_________________________________________________
pawn Код:
OnGameModeInIt
new rand = random(sizeof(RandomPickup));
cash = CreatePickup(1550, 2, RandomPickup[rand][0], RandomPickup[rand][1], RandomPickup[rand][2], 0);
ERROR 2---error 017: undefined symbol "notification" on this line
pawn Код:
OnPlayerPickup
if(pickupid == cash)
    {
            new string[120], name[MAX_PLAYER_NAME];
                GetPlayerName(playerid,name,sizeof(name));
        GivePlayerMoney(playerid,10000);
        format(string, sizeof(string), "%s found the Money Bag!", name);
        TextDrawSetString(notification, string);
        SetTimer("CloseTextdraw_notification", 2*1000, false);
       
                bagholder = GetPlayerID(name);
 
        SetPlayerAttachedObject(playerid, 1, 1550, 1, 0.1, -0.2, 0, 0, 90, 0.5, 0.8, 0.8, 0.8);
        DestroyPickup(cash);
    }
   
    return 1;
_________________________________________________
pawn Код:
stock GetPlayerID(const Name[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(i, pName, sizeof(pName));
        if(strcmp(Name, pName, true)==0)
        {
          return i;
        }
      }
    }
    return -1;
}
_________________________________________________
pawn Код:
OnPlayerDeath
if(playerid == bagholder)
    {
        DestroyPickup(cash);
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        cash = CreatePickup(1550, 2, X, Y, Z, 0);
        RemovePlayerAttachedObject(playerid, 1);
        SendClientMessage(playerid, LIGHTGREEN, "You lost the {FF0000}Money Bag!");
    }
_________________________________________________
Thanks for the replies, Note the error lines are marked with ERROR 1 and ERROR 2
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
Error 1: They should be commas, not semi-colons. Commas are used to separate the elements in arrays, like you are using in the inner arrays.

Error 2: You are using "notification" in "TextDrawSetString", but nowhere in the code you posted is that variable defined. It needs to be "in scope", i.e. the function needs to be able to see the variable.
Please do me a favour, post the fixed version of the error lines plz, cuz i tried it lots of times still not working :/
Reply
#3

Help plzlzlzlzlzlzlzzz!
Reply
#4

Fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)