SA-MP Forums Archive
Getting 4 Problems on 1 Strmid Line - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Getting 4 Problems on 1 Strmid Line (/showthread.php?tid=87482)



Getting 4 Problems on 1 Strmid Line - DaRkM - 20.07.2009

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



Re: Getting 4 Problems on 1 Strmid Line - Correlli - 20.07.2009

Do you have PlayerInfo variable defined?


Re: Getting 4 Problems on 1 Strmid Line - DaRkM - 20.07.2009

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.


Re: Getting 4 Problems on 1 Strmid Line - Correlli - 20.07.2009

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];



Re: Getting 4 Problems on 1 Strmid Line - MadeMan - 20.07.2009

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.


Re: Getting 4 Problems on 1 Strmid Line - DaRkM - 20.07.2009

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


Re: Getting 4 Problems on 1 Strmid Line - Correlli - 20.07.2009

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.


Re: Getting 4 Problems on 1 Strmid Line - DaRkM - 20.07.2009

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


Re: Getting 4 Problems on 1 Strmid Line - James_Alex - 20.07.2009

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