Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Strange problem about P.Classes

$
0
0
Hello everyone! I have a problem with my gamemode.

Everytime I log-in it spawns me instead of requesting class (choosing teams). I have added gTeams, and added Classes under GameModeInit but still nothing.

Code:

forward SetPlayerTeamFromClass(playerid, classid);
  public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    return 1;
}
public SetPlayerTeamFromClass(playerid, classid)
{
        if(classid == 0)
    {
        gTeam[playerid] = NORMAL;
        GameTextForPlayer(playerid,"~w~normal",3000,5); // This will show up an Text , when you select your class
                SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
                SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
                SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
                SetPlayerFacingAngle(playerid,122.4500);
                SetPlayerColor(playerid,0xA000FFFF); // Teamcolor
    }
else if(classid == 1)
    {
        gTeam[playerid] = POLICE_OFFICER;
        GameTextForPlayer(playerid,"~w~officer",3000,5);
                SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
                SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
                SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
                SetPlayerFacingAngle(playerid,252.4717);
                SetPlayerColor(playerid,0x55FF00FF);
    }
}

AddPlayerClass(217, 401.6212,2532.2688,16.5452,175.4787, 27, 100, 31, 50, 0, 0);
        AddPlayerClass(247, 401.6212,2532.2688,16.5452,175.4787, 27, 100, 31, 50, 0, 0);
        AddPlayerClass(254, 401.6212,2532.2688,16.5452,175.4787, 27, 100, 31, 50, 0, 0);
        AddPlayerClass(111, 401.6212,2532.2688,16.5452,175.4787, 27, 100, 31, 50, 0, 0);

I have removed SpawnPlayer after login/register. But it still won't display select classes, I have worked on gamemode my own and this is first time i'm facing something like this, thanks :)

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>