OnPlayerRequestClass - 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: OnPlayerRequestClass (
/showthread.php?tid=426453)
OnPlayerRequestClass -
Avi Raj - 29.03.2013
Hey,
i have this code :-
Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,1040.1804,1305.4464,10.8203); //replace this with your GuySelectSkin coordinates
SetPlayerFacingAngle(playerid,357.2109); //replace this with your GuySelectSkin coordinates (EG. 48.908131) you will pick the 48 and put on FacingAngle
SetPlayerCameraLookAt(playerid,1040.1804,1305.4464,10.8203); //This is where the camera will look at. Make sure copy the correct coordinates the Example of this is GuySelectSkin
SetPlayerCameraPos(playerid,1040.1804,1305.4464,10.8203);
switch(classid) // Switching between the classids
{
case 0..1:
{
SetPlayerTeam(playerid, Trucker); // Setting players team
GameTextForPlayer(playerid, "~w~Trucker", 1000, 3); // Screen msg for player to show what team
}
case 2:
{
SetPlayerTeam(playerid, BusDriver); // Same as above
GameTextForPlayer(playerid, "~y~Bus Driver", 1000, 3); // Same as above
}
case 3:
{
SetPlayerTeam(playerid, Police); // Same as above
GameTextForPlayer(playerid, "~b~Police", 1000, 3); // Same as above
}
}
return 1;
}
IM Not able to See Player Skin.
My OnGameModeInIt :-
Код:
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("San Andreas Truckers");
AddPlayerClass(202,-1552.6648,-2741.6511,48.5468,138.6175,0,0,0,0,0,0); // Trucker
AddPlayerClass(161,1061.6696,1231.4233,10.8275,1.3874,0,0,0,0,0,0); // Trucker
return 1;
}
Help.
Re: OnPlayerRequestClass -
Apenmeeuw - 29.03.2013
Its because you have the campos at the same place as the lookat...
Do it like this:
pawn Код:
SetPlayerPos(playerid, yourcoords);
SetPlayerCameraPos(playerid, coords somewhere near the playerpos);
SetPlayerCameraLookAt(playerid, same coords as setplayerpos);
Hope i helped you