Whats Wrong Here?
#1

What is wrong?

Код:
public OnPlayerRequestClass(playerid, classid)
{
	{
	SetPlayerPos(playerid, 222.1653,1823.0802,6.4141);
	SetPlayerFacingAngle(playerid, 269.1334);
	SetPlayerCameraPos(playerid, 224.1104,1823.0507,6.4141);
	SetPlayerCameraLookAt(playerid, 222.1653,1823.0802,6.4141);
	return 1;
	}
	
	{
  gClass[playerid] = classid;
  return 1;
	}
	
	
}
I Do this and i get an error that there is something wrong with the }

Error:

Код:
D:\Documents and Settings\victor\Desktop\SAMP Server\pawno\A51.pwn(112) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#2

You can't just open a bracket and put some code in it and then close it just like that.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  SetPlayerPos(playerid, 222.1653, 1823.0802, 6.4141);
  SetPlayerFacingAngle(playerid, 269.1334);
  SetPlayerCameraPos(playerid, 224.1104, 1823.0507, 6.4141);
  SetPlayerCameraLookAt(playerid, 222.1653, 1823.0802, 6.4141);
  gClass[playerid] = classid;
  return 1;
}
This is correct.
Reply
#3

You have two brackets ( { ) before you start the code.Delete one. And you have two brackets ( } ) after return.
So final code looks
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 222.1653,1823.0802,6.4141);
    SetPlayerFacingAngle(playerid, 269.1334);
    SetPlayerCameraPos(playerid, 224.1104,1823.0507,6.4141);
    SetPlayerCameraLookAt(playerid, 222.1653,1823.0802,6.4141);

    gClass[playerid] = classid;
    return 1;
}
EDIT: Don, we was writing in same time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)