Just a little push....
#1

This is my OnPlayerRequestClass part... I want it to skip class selection if the file exists, it get an error in compiling... help WHAT AM I DOING WRONG??

Код:
public OnPlayerRequestClass(playerid, classid)
{
	new File[50];
	format(File, sizeof(File), PFiles, pName(playerid));
	if(fexist(File))
	{
	SetPlayerPos(playerid, PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ]);
	SendClientMessage(playerid, COLOR_RED, "xD");
 	}
	else
	{
 	SetPlayerPos(playerid, -2661.3604, 1932.9404, 225.7578);
	SetPlayerFacingAngle(playerid, 213.0498);

	SetPlayerCameraPos(playerid, -2659.3604, 1906.9404, 226.7578);
	SetPlayerCameraLookAt(playerid, -2661.3604, 1932.9404, 225.7578);
	}
	return 1;
}
Reply
#2

Could you give us the error?
Reply
#3

Post the error and ill help you out.
Reply
#4

Here's the error

Код:
G:\DOCUME~1\Admin\Desktop\GTASER~1\GAMEMO~1\Blank.pwn(178) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
but the row of the error (17 is :

Код:
public OnPlayerRequestClass(playerid, classid)

{
    new File[50];
	format(File, sizeof(File), PFiles, pName(playerid));
	if(fexist(File))
	{
	SetPlayerPos(playerid, PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ]);
	SendClientMessage(playerid, COLOR_RED, "xD");
 	}
	else
	{
 	SetPlayerPos(playerid, -2661.3604, 1932.9404, 225.7578);
	SetPlayerFacingAngle(playerid, 213.0498);

	SetPlayerCameraPos(playerid, -2659.3604, 1906.9404, 226.7578);
	SetPlayerCameraLookAt(playerid, -2661.3604, 1932.9404, 225.7578);
	}
	return 1;
}
//=============================================================================
// ON PLAYER CONNECT
//==============================================================================
public OnPlayerConnect(playerid)
{
    AddMapIconFromFile(ICON_FILE_NAME);
    
    new CString[50];
    format(CString, sizeof(CString), "Player: %s(%d) has joined the fun!", pName(playerid), playerid);
    SendClientMessageToAll(COLOR_GREY, CString);
    
	new File[50];
	format(File, sizeof(File), PFiles, pName(playerid));

	if(fexist(File))
	SetPlayerPos(playerid, PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ]);
	{
		new
			iStr[128];

		format(iStr, sizeof(iStr), ""#CBLUE"Welcome back: "#CDGREEN"%s(%d)\n"#CBLUE"Enter your password to login:", pName(playerid), playerid);
		ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, ""#CBLUE"Login", iStr, "Login", "Leave");
	}
	else // IT SAYS THAT THIS IS THE ERROR (178)
	{
		new
		    iStr[128];

		format(iStr, sizeof(iStr), ""#CBLUE"Welcome: "#CDGREEN"%s(%d)\n"#CBLUE"This account has not been registered! Please enter a password:", pName(playerid), playerid);
		ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, ""#CDGREEN"Register", iStr, "Register", "Leave");
	}
	return 1;
}
//THIS IS THE ERROR(17 is the location of the error
Reply
#5

Lol,

pawn Код:
SetPlayerPos(playerid, PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ]);
    {
        new
            iStr[128];

        format(iStr, sizeof(iStr), ""#CBLUE"Welcome back: "#CDGREEN"%s(%d)\n"#CBLUE"Enter your password to login:", pName(playerid), playerid);
        ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, ""#CBLUE"Login", iStr, "Login", "Leave");
    }
Why is there brackets after the function? and a if statement to it, use getplayer pos instead.
Reply
#6

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
Lol,

pawn Код:
SetPlayerPos(playerid, PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ]);
    {
        new
            iStr[128];

        format(iStr, sizeof(iStr), ""#CBLUE"Welcome back: "#CDGREEN"%s(%d)\n"#CBLUE"Enter your password to login:", pName(playerid), playerid);
        ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, ""#CBLUE"Login", iStr, "Login", "Leave");
    }
Why is there brackets after the function? and a if statement to it, use getplayer pos instead.
where do I need to put that code in ?
Reply
#7

Remove the brackets..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)