Need help with my admins script!
#1

Hi, I followed a Admin Tutorial on SA-MP Wiki (https://sampwiki.blast.hk/wiki/Creating_...cript/Example1)

And I understood everything except one thing. And because of that misunderstood I got these errors:

pawn Код:
C:\Users\Gast\Desktop\SA-MP Server\pawno\DonataRP2.pwn(84) : warning 225: unreachable code
C:\Users\Gast\Desktop\SA-MP Server\pawno\DonataRP2.pwn(84) : warning 217: loose indentation
C:\Users\Gast\Desktop\SA-MP Server\pawno\DonataRP2.pwn(84) : error 017: undefined symbol "player_level"
C:\Users\Gast\Desktop\SA-MP Server\pawno\DonataRP2.pwn(84) : warning 215: expression has no effect
C:\Users\Gast\Desktop\SA-MP Server\pawno\DonataRP2.pwn(84) : error 001: expected token: ";", but found "]"
C:\Users\Gast\Desktop\SA-MP Server\pawno\DonataRP2.pwn(84) : error 029: invalid expression, assumed zero
C:\Users\Gast\Desktop\SA-MP Server\pawno\DonataRP2.pwn(84) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
These are all on line 84:

pawn Код:
if(player_level[playerid] == -1) {
I am new here, and new at scripting so I have actually no idea how to fix this.

Someone could help me?
Reply
#2

#define SLOTS 8
new player_level[SLOTS] = {-1, ...}; // Saves the player's level - the default
// one is -1 for not connected, 0 for not logged in and others for logged in

To fix the defining error, did you add that inside that tutorial or whatever it is that you're trying to do?
Reply
#3

Quote:
Originally Posted by mrtms
Посмотреть сообщение
#define SLOTS 8
new player_level[SLOTS] = {-1, ...}; // Saves the player's level - the default
// one is -1 for not connected, 0 for not logged in and others for logged in

To fix the defining error, did you add that inside that tutorial or whatever it is that you're trying to do?
I followed the tutorial, Read every part, And I couldn't make clear what that function was for, How to solve this annoying problem?
Reply
#4

I mean just looking at that piece of code, I can't really tell you but this error means a lot.

undefined symbol "player_level"

It means that it's not defined anywhere in the file at all so you need to define it. What exactly are you trying to do? Be descriptive.
Reply
#5

Quote:
Originally Posted by mrtms
Посмотреть сообщение
I mean just looking at that piece of code, I can't really tell you but this error means a lot.

undefined symbol "player_level"

It means that it's not defined anywhere in the file at all so you need to define it. What exactly are you trying to do? Be descriptive.
As the tutorial told me, It saves the player data and it will be saved in the "users.txt" file.

I am making a Freeroam server, and ofcourse it have to save the players position, money etc.

I followed the tutorial and I have no further errors (as far as I know). Only this one, I have to define the player_level but I don't know where / how.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)