Brief help here please
#1

Well I got a little problem here with a snippet of mine

Код:
if(PlayerInfo[targetid][pMale] == 1) { sex = "Male"; }
	else if(PlayerInfo[targetid][pFemale] == 1) { sex = "Female"; }
It gives me these errors
Код:
D:\SAMP Server\gamemodes\Vampires.pwn(841) : error 017: undefined symbol "sex"
D:\SAMP Server\gamemodes\Vampires.pwn(841) : warning 215: expression has no effect
D:\SAMP Server\gamemodes\Vampires.pwn(842) : error 017: undefined symbol "sex"
D:\SAMP Server\gamemodes\Vampires.pwn(842) : warning 215: expression has no effect
Reply
#2

pawn Код:
enum blahblahblah
{
Sex,
}

if(PlayerInfo[targetid][pMale] == 1) { PlayerInfo[targetid][Sex] = "Male"; }
else if(PlayerInfo[targetid][pFemale] == 1) { PlayerInfo[targetid][Sex] = "Female"; }
Reply
#3

Gave me errors as well. Even more to be honest.

Код:
D:\SAMP Server\gamemodes\Vampires.pwn(842) : error 022: must be lvalue (non-constant)
D:\SAMP Server\gamemodes\Vampires.pwn(842) : warning 215: expression has no effect
D:\SAMP Server\gamemodes\Vampires.pwn(843) : error 022: must be lvalue (non-constant)
D:\SAMP Server\gamemodes\Vampires.pwn(843) : warning 215: expression has no effect
D:\SAMP Server\gamemodes\Vampires.pwn(844) : warning 219: local variable "atext" shadows a variable at a preceding level
D:\SAMP Server\gamemodes\Vampires.pwn(844) : warning 204: symbol is assigned a value that is never used: "atext"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#4

Could someone please help me, I would appreciate it!
Reply
#5

pawn Код:
enum blahblahblah
{
Sex[8],
}

if(PlayerInfo[targetid][pMale] == 1) { PlayerInfo[targetid][Sex] = "Male"; }
else if(PlayerInfo[targetid][pFemale] == 1) { PlayerInfo[targetid][Sex] = "Female"; }
I forgot to put the length.
Reply
#6

pawn Код:
new pMale[MAX_PLAYERS];
pawn Код:
new pFemale[MAX_PLAYERS];
examples ^

EDIT: Oops, sorry I didn't read above. I'll fix as soon as I come back, pm me through forums later.
Reply
#7

This is quite strange I still seem to get 2 errors, which are:

Код:
D:\SAMP Server\gamemodes\Vampires.pwn(93) : error 010: invalid function or declaration
D:\SAMP Server\gamemodes\Vampires.pwn(94) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
It was a long time I dealt with these things, help is still kinda needed, sorry for being such a burden ;/
Reply
#8

- Removed
Reply
#9

Have you add this?
pawn Код:
PlayerInfo[MAX_PLAYERS] [blahblahblah]

All of them should be like this:
pawn Код:
enum blahblahblah //On top of your script
{
pMale,
Sex[8],
pFemale,
}
new PlayerInfo[MAX_PLAYERS] [blahblahblah];


if(PlayerInfo[targetid][pMale] == 1) { PlayerInfo[targetid][Sex] = "Male"; }//Somewhere you want it
else if(PlayerInfo[targetid][pFemale] == 1) { PlayerInfo[targetid][Sex] = "Female"; }
EDITED again
Reply
#10

Yes I have.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)