Addplayer Class errors
#1

So in the start of GM i have this
Код:
public OnGameModeInit()
{
	// Player Classes In the Startup of the Gamemode Player Class Choose
	SetGameModeText("Freeroam/Roleplay By Two");
    AddPlayerClass(1, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
	return 1;
    AddPlayerClass(1, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
	return 1;
    AddPlayerClass(2, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
	return 1;
    AddPlayerClass(3, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
I got like 90 more player classes added but im allways getting lots of errors because of this

Код:
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(45) : warning 225: unreachable code
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(47) : warning 225: unreachable code
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(49) : warning 225: unreachable code
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(51) : warning 225: unreachable code
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(53) : warning 225: unreachable code
Like 90 more of this I would like to know how to fix it.

Next error is
Код:
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(250) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(270) : warning 202: number of arguments does not match definition
Any1 here knows how to fix it?
Reply
#2

Try removing the return 1; after each of your Player Classes and see if that helps
Reply
#3

pawn Код:
public OnGameModeInit()
{
    // Player Classes In the Startup of the Gamemode Player Class Choose
    SetGameModeText("Freeroam/Roleplay By Two");
    AddPlayerClass(1, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    return 1;
    AddPlayerClass(1, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    return 1;
    AddPlayerClass(2, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    return 1;
    AddPlayerClass(3, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
What are you doing?
pawn Код:
public OnGameModeInit()
{
    // Player Classes In the Startup of the Gamemode Player Class Choose
    SetGameModeText("Freeroam/Roleplay By Two");
    AddPlayerClass(1, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(1, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(2, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(3, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
//more code
//this is the end now
return 1; // this will end this "OnGameModeInIt" callback and returns true value (1)
}
only use return 1; at the END of the callbacks/functions.
Reply
#4

dont put return at every line

pawn Код:
// Player Classes In the Startup of the Gamemode Player Class Choose
    SetGameModeText("Freeroam/Roleplay By Two");
    AddPlayerClass(1, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(1, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(2, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(3, 1462.1404,-1027.1700,23.8281,177.7844, 0, 0, 0, 0, 0, 0);
    return 1;
}

and show line 250 and 270
Reply
#5

Yeah Sorry I kinda knew i shouldnt put return in the end But i wasnt exactly seeing that because i was copypasting lol So Now i fixed like 100 errors and I got only 2 now.

Код:
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(152) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\gamemodes\two.pwn(172) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Line 202 its on return 0 but this was on default it came when I did new file.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}
Reply
#6

your not using any cmd then use this

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;

}
Reply
#7

Quote:
Originally Posted by Xoomer
Посмотреть сообщение
your not using any cmd then use this

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;

}
Still says the same thing :/
Reply
#8

Are you sure that the line is from there?I mean the warning line.
Reply
#9

Quote:
Originally Posted by Necip
Посмотреть сообщение
Are you sure that the line is from there?I mean the warning line.
It says warning 202 so i guess its from the line 202?? Im not seeing anything wrong i fixed all the other stuff its a new gamemode and its basicly empty
Reply
#10

Can you put all of your gamemode on pastebin so I can see it?It may be from other line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)