public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 3142.5554,-1499.8295,32.1060); SetPlayerFacingAngle(playerid, 5.1827); SetPlayerCameraLookAt(playerid, 3142.5554,-1499.8295,32.1060); SetPlayerCameraPos(playerid, 3142.5554,-1499.8295,32.1060); switch(classid) // Switching between the classids { case 0..1/* The first classid is of the cops*/: { SetPlayerTeam(playerid, Cops); // Setting players team GameTextForPlayer(playerid, "~b~Cops", 1000, 3); // Screen msg for player to show what team } case 2..3/* The second classid is of the criminals*/: { SetPlayerTeam(playerid, Robbers); // Same as above GameTextForPlayer(playerid, "~r~Robbers", 1000, 3); // Same as above } } return 1; }
{ SetPlayerTeam(playerid, Cops); // Setting players team GameTextForPlayer(playerid, "~b~Cops", 1000, 3); // Screen msg for player to show what team AddPlayerClass(280,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(281,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(282,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(283,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(284,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(285,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(286,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(287,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(288,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(289,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); AddPlayerClass(290,1743.1095,-1860.4247,13.5788,0.0026,0,0,0,0,0,0); }
You need AddPlayerClass lines under your gamemode, or no skins will be available to you.
https://sampwiki.blast.hk/wiki/AddPlayerClass If you already have those, try setting the camera pos BEFORE setting the camera lookat pos. |
SetPlayerPos(playerid, 3142.5554,-1499.8295,32.1060);
SetPlayerFacingAngle(playerid, 5.1827);
SetPlayerCameraLookAt(playerid, 3142.5554,-1499.8295,32.1060);
SetPlayerCameraPos(playerid, 3142.5554,-1499.8295,32.1060);