Skin Selection - 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: Skin Selection (
/showthread.php?tid=499438)
Skin Selection -
vassilis - 08.03.2014
Hello lads, i need a bit help.. well i cant remember how to set a selection menu according to skins
example :
setting the selection camera outside lspd if they want to choose cop skin
medics setting camera and skin selection outside hospital.. etc... Did anyone understand? talking for OnPlayerRequestClass
if i remember well there is something like using
pawn Код:
case 0...x :
SetPlayerPos etc...
Re: Skin Selection -
iggy1 - 08.03.2014
Under
OnPlayerRequestClass check which classid it is and set position/cam pos accordingly.
EG,
pawn Код:
new gSomeCopClassId = 0;
new gSomeHospitalClassId = 0;
public OnGameModeInit()
{
gSomeCopClassId = AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gSomeHospitalClassId = AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
//you could create a function that does the following to tidy your code up
//NOTE: These are not skin ids they are classids
if(classid == gSomeCopClassId)
{
//swap these co-ords/camerapos for LSPD
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
}
else if(classid == gSomeHospitalClassId)
{
//swap these co-ords/camerapos for a hospital
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
}
//...
return 1;
}
This is using classids, there shouldn't be a problem using GetPlayerSkin and check against a skinid if you would rather do that.
ie. replace
pawn Код:
if(classid == gSomeCopClassId)
with
pawn Код:
if(GetPlayerSkinId(playerid) == SOME_COP_SKINID)
Re: Skin Selection -
vassilis - 08.03.2014
Thats how i was working on the past thanks lad!