Getting 4 Problems on 1 Strmid Line
#1

Umm yeah. I'm just starting out and im getting 4 errors on this 1 line that uses strmid.
Код:
D:\SA Modding\Scripting\gamemodes\test.pwn(46) : error 017: undefined symbol "PlayerInfo"
D:\SA Modding\Scripting\gamemodes\test.pwn(46) : warning 215: expression has no effect
D:\SA Modding\Scripting\gamemodes\test.pwn(46) : error 001: expected token: ";", but found "]"
D:\SA Modding\Scripting\gamemodes\test.pwn(46) : error 029: invalid expression, assumed zero
D:\SA Modding\Scripting\gamemodes\test.pwn(46) : fatal error 107: too many error messages on one line
This is the line:
Код:
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
Reply
#2

Do you have PlayerInfo variable defined?
Reply
#3

How would I go about doing that? xD

I had someone helping me but he never finished and now he is ignoring me so I don't know what exactly I'm doing.
Reply
#4

I guess you were just copying the code and you forgot some things.
Example:
pawn Код:
enum pInfo
{
  pKey[128],
  // other variables, ..
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#5

Quote:
Originally Posted by DaRkM
How would I go about doing that? xD

I had someone helping me but he never finished and now he is ignoring me so I don't know what exactly I'm doing.
In English: Does your script know what is PlayerInfo? I think it don't so you have to tell it that.
Reply
#6

Quote:
Originally Posted by Don Correlli
I guess you were just copying the code and you forgot some things.
Example:
pawn Код:
enum pInfo
{
  pKey[128],
  // other variables, ..
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Ah yes thank you. Now it found other errors on another line. lol

Код:
D:\SA Modding\Scripting\gamemodes\test.pwn(68) : error 017: undefined symbol "gPlayerLogged"
D:\SA Modding\Scripting\gamemodes\test.pwn(68) : warning 215: expression has no effect
D:\SA Modding\Scripting\gamemodes\test.pwn(68) : error 001: expected token: ";", but found "]"
D:\SA Modding\Scripting\gamemodes\test.pwn(68) : error 029: invalid expression, assumed zero
D:\SA Modding\Scripting\gamemodes\test.pwn(68) : fatal error 107: too many error messages on one line
This is the line:
Код:
if(gPlayerLogged[playerid])
I'm guessing its the same kinda thing since I dont have a new gPlayerLogged or an enum (i dont know if an enum is needed or not.)
Reply
#7

Like i told you, you were copying the code and forgot the variables:
pawn Код:
enum pInfo
{
  pKey[128],
  gPlayerLogged,
  // other variables, ..
};
new PlayerInfo[MAX_PLAYERS][pInfo];
I guess you're using modified PEN1/TGF, just use PlayerInfo variables from original The Godfather gamemode.
Reply
#8

Alright. Like I said, I'm just starting so I don't actually have a clue what any of this means really.
Reply
#9

you have to juste to copy the new of every function !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)