SA-MP Forums Archive
warning 209: function "OnPlayerRequestClass" should return a value - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warning 209: function "OnPlayerRequestClass" should return a value (/showthread.php?tid=358877)



warning 209: function "OnPlayerRequestClass" should return a value - _Khaled_ - 12.07.2012

Hello
any help?
Quote:

public OnPlayerRequestClass(playerid, classid)
{
if(gTeam[playerid] == TEAM_CIVIL)
{
AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,944.99,-41.64,1001.77);
SetPlayerFacingAngle(playerid,180.0);
SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
if(gTeam[playerid] == TEAM_COP)
{
AddPlayerClass(267, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,944.99,-41.64,1001.77);
SetPlayerFacingAngle(playerid,180.0);
SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
}

In the gamemode it's fine
It's just screwed up in the quote here

But while compiling
Quote:

D:\SAMP\Server\gamemodes\SERVER.pwn(61) : warning 209: function "OnPlayerRequestClass" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.




Re: warning 209: function "OnPlayerRequestClass" should return a value - Miqueias Barros - 12.07.2012

means that there is equal two callbacks. delete the other callback.


Re: warning 209: function "OnPlayerRequestClass" should return a value - _Khaled_ - 12.07.2012

Quote:
Originally Posted by Miqueias Barros
Посмотреть сообщение
means that there is equal two callbacks. delete the other callback.
Quote the pwn part please


Re: warning 209: function "OnPlayerRequestClass" should return a value - Revo - 12.07.2012

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(gTeam[playerid] == TEAM_CIVIL)
    {
        AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
        SetPlayerInterior(playerid,3);
        SetPlayerPos(playerid,944.99,-41.64,1001.77);
        SetPlayerFacingAngle(playerid,180.0);
        SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
        SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
        SetPlayerTeamFromClass(playerid, classid);
        return 1;
    }
    if(gTeam[playerid] == TEAM_COP)
    {
        AddPlayerClass(267, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
        SetPlayerInterior(playerid,3);
        SetPlayerPos(playerid,944.99,-41.64,1001.77);
        SetPlayerFacingAngle(playerid,180.0);
        SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
        SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
        SetPlayerTeamFromClass(playerid, classid);     
    }
    return 1;
}



Re: warning 209: function "OnPlayerRequestClass" should return a value - Miqueias Barros - 12.07.2012

place the GM in http://pastebin.com/. send link.


Re: warning 209: function "OnPlayerRequestClass" should return a value - _Khaled_ - 12.07.2012

Thanks, done it


Re: warning 209: function "OnPlayerRequestClass" should return a value - _Khaled_ - 12.07.2012

Still guys!
When I do this
Quote:

public OnPlayerRequestClass(playerid, classid)
{
if(gTeam[playerid] == TEAM_CIVIL)
{
AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,944.99,-41.64,1001.77);
SetPlayerFacingAngle(playerid,180.0);
SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
SetPlayerTeamFromClass(playerid, classid);
GameTextForPlayer(playerid,"~w~CIVILIAN",1000,4);
}
if(gTeam[playerid] == TEAM_COP)
{
AddPlayerClass(267, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,944.99,-41.64,1001.77);
SetPlayerFacingAngle(playerid,180.0);
SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
SetPlayerTeamFromClass(playerid, classid);
GameTextForPlayer(playerid,"~b~COP",1000,4);
}
return 1;
}

It doesn't show me the choosing skin position
With no compiling problem