SA-MP Forums Archive
[Problems] /bonus - 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: [Problems] /bonus (/showthread.php?tid=603032)



[Problems] /bonus - Play4FUun - 17.03.2016

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



Re: [Problems] /bonus - Pottus - 17.03.2016

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


Re: [Problems] /bonus - Play4FUun - 17.03.2016

you give a me command /bonus, no error


Re: [Problems] /bonus - AdrianG - 17.03.2016

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.


Re: [Problems] /bonus - saffierr - 17.03.2016

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



Re: [Problems] /bonus - Play4FUun - 17.03.2016

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)



Re: [Problems] /bonus - saffierr - 17.03.2016

Have you created your enum like this?

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



Re: [Problems] /bonus - Hiddos - 17.03.2016

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.


Re: [Problems] /bonus - Play4FUun - 17.03.2016

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")



Re: [Problems] /bonus - Play4FUun - 17.03.2016

UP... Please help me fast