[Problems] /bonus
#1

Welcome, please to resolve command /bonus.

CODE:
Код:
CMD:bonus(playerid, params[])
   {
          if(PlayerInfo[playerid][pLevel] <= 1 )  // the line 4417
         {
            GivePlayerCash(playerid, 1000000);
            new playerlevel = PlayerInfo[playerid][pLevel];
            PlayerInfo[playerid][pLevel] = playerlevel + 2;
            SetPlayerScore(playerid,PlayerInfo[playerid][pLevel]);
            PlayerInfo[playerid][pDriveLicense] = 1;
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Ai primit un cadou din partea staffului");
         }
         else
         {
            SendClientMessage(playerid,COLOR_RED,"Cadoul este doar pentru incepatori (Level 1)!");
            }
      return 1;
      }

ERROR:
Код:
C:\Documents and Settings\user\Desktop\gm\gamemodes\gm.pwn(4417) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\user\Desktop\gm\gamemodes\gm.pwn(4417) : warning 215: expression has no effect
C:\Documents and Settings\user\Desktop/gm\gamemodes\gm.pwn(4417) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\user\Desktop\gm\gamemodes\gm.pwn(4417) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\gm\gamemodes\gm.pwn(4417) : fatal error 107: too many error messages on one line
Reply
#2

You are just copying and pasting code from other gamemodes and expecting it to work.
Reply
#3

you give a me command /bonus, no error
Reply
#4

your code is coppied from another one which use PlayerInfo to save all information of player. Your gamemode does not use it. So you have to show us which variables use your gamemode in order to save smth about players in order to change this code with your compatible code.
Reply
#5

Create an enum with
PHP код:
new PlayerInfo[MAX_PLAYERS][pInfo]; 
Reply
#6

Thanks.. Please resolve new error.

Код:
C:\Documents and Settings\user\Desktop\gm\gm\BuGGed.pwn(446) : error 017: undefined symbol "pInfo"
C:\Documents and Settings\user\Desktop\gm\gm\BuGGed.pwn(446) : error 009: invalid array size (negative, zero or out of bounds)
Reply
#7

Have you created your enum like this?

PHP код:
enum pInfo
{
   
pLevel,
}
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
Reply
#8

Quote:
Originally Posted by Play4FUun
Посмотреть сообщение
Thanks.. Please resolve new error.

Код:
C:\Documents and Settings\user\Desktop\gm\gm\BuGGed.pwn(446) : error 017: undefined symbol "pInfo"
C:\Documents and Settings\user\Desktop\gm\gm\BuGGed.pwn(446) : error 009: invalid array size (negative, zero or out of bounds)
No. Sorry to be that guy, but we aren't just going to assemble your script for you and resolve every error. Your first priority shouldn't be getting your script to work, but understanding what your code does. I'll tell you what you did wrong. Your script, with its own code structure and nomenclature, is totally different from the piece of code you're trying to insert in it. This is how that looks like.

It's up to you to figure out what has to happen when the player does something. Read other scripts and see what they do it and what's going on. There are a few decent tutorials on the forum that can help you as well.
Reply
#9

Yes.

Код:
enum pInfo
{
pPass,
pSex,
pAge,
pOrigin,
pPlace,
pCash,
pExp,
pAdmin,
pNumber,
pTester,
pWarns,
pSelected,
pMuted,
pMuteTime,
pFirstJoined,
pModel,
pVip,
pSpawn,
pLocked,
pDriveLic
};
Add pLevel +1 error

Код:
error 091: ambiguous constant; tag override is required (symbol "pLevel")
Reply
#10

UP... Please help me fast
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)