Skin Selection
#1

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...
Reply
#2

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)
Reply
#3

Thats how i was working on the past thanks lad!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)