Undefined symbol playerid
#1

This never happened to me before.

Quote:

public NewNames()
{
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
for(new q = 0;q < MAX_PLAYERS;q++)
{
if(IsPlayerConnected(q))
{
new Float1x;
new Float1y;
new Float1z;
new Float2x;
new Float2y;
new Float2z;
if(IsPlayerConnected(i) && IsPlayerConnected(q))
{
GetPlayerPos(i,p1x,p1y,p1z);
GetPlayerPos(q,p2x,p2y,p2z);
if(GetPointDistanceToPointExMorph(p1x,p1y,p1z,p2x, p2y,p2z) < pdistance)
{
if (NameOff[playerid] == 1)
{
ShowPlayerNameTagForPlayer(i,q,0);
}
}
else
{
ShowPlayerNameTagForPlayer(i,q,1);
}
}
}
}
}
}
}

Playerid is an undefined symbol
Reply
#2

pawn Код:
if (NameOff[playerid] == 1)
Change the playerid in that line to i or q according to your code.
Reply
#3

pawn Код:
public NewNames()
should be

pawn Код:
public NewNames(playerid)

and forward should be
pawn Код:
forward NewNames(playerid);
hope this helped.
Reply
#4

Quote:
Originally Posted by -Alive
pawn Код:
public NewNames()
should be

pawn Код:
public NewNames(playerid)

and forward should be
pawn Код:
forward NewNames(playerid);
hope this helped.
Hello
I Got This Problem But With My Timers Should I Add Playerid In The Function? Or Should I Do Something else?

- (Jeff)
Reply
#5

Quote:
Originally Posted by FUNExtreme
pawn Код:
if (NameOff[playerid] == 1)
Change the playerid in that line to i or q according to your code.
This -.-'
Reply
#6

Quote:
Originally Posted by dice7
Quote:
Originally Posted by FUNExtreme
pawn Код:
if (NameOff[playerid] == 1)
Change the playerid in that line to i or q according to your code.
This -.-'
?

Код:
public WSHJAILCLOSE()
{
  //MoveStreamObject (WSHJAILGATE,1690.070923, -2022.385620, 13.330789,1.5);
  SetPlayerPos(playerid, 276.0656,1868.8894,8.7578);
  SetCameraBehindPlayer(playerid);
	return 1;
}
Whats the prob?
Reply
#7

plz help this is urgent
Reply
#8

Quote:

public WSHJAILCLOSE()
{
//MoveStreamObject (WSHJAILGATE,1690.070923, -2022.385620, 13.330789,1.5);
SetPlayerPos(playerid, 276.0656,1868.8894,8.757;
SetCameraBehindPlayer(playerid);
return 1;
}

if you are defining the public function and using the "SetCameraBehindPlayer(playerid);" you should also put "playerid" here:
pawn Код:
public WSHJAILCLOSE()
so now it will be:
pawn Код:
public WSHJAILCLOSE(playerid)
and also
pawn Код:
forward WSHJAILCLOSE(playerid);
Reply
#9

Whoops, i thought you were the topic opener

And you need to use SetTimerEx for passing variables from a function to another
https://sampwiki.blast.hk/wiki/SetTimerEx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)