Change player class on cmd
#5

Alright, I have this now:
pawn Код:
CMD:teamchange(playerid, params[])
{
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, true);
    TogglePlayerSpectating(playerid, false);
    SetSpawnInfo(playerid, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    SpawnPlayer(playerid);
    return 1;
}
It sends you instantly to class selection screen and spawns you (doesn't spawn without "SetSpawnInfo"). But how do I make it actually switch to the class ID I want?

EDIT: I tried to do it with Y_Classes:
pawn Код:
CMD:teamc(playerid, params[])
{
    Class_ReturnToSelection(playerid);
    Class_Goto(playerid, 7);
    SpawnPlayer(playerid);
    return 1;
}
It should go to the class ID "7" and spawn me, but it spawns my current class. Any ideas? Should I probably make a timer for this?

EDIT2: Alright, I did this. Thanks for the help!
pawn Код:
CMD:teamc(playerid, params[])
{
    Class_ReturnToSelection(playerid);
    Class_Goto(playerid, 7);
    SetTimerEx("spawnnow",100,0,"i",playerid);
    return 1;
}


forward spawnnow(playerid);
public spawnnow(playerid)
{
    SpawnPlayer(playerid);
    return 1;
}
Reply


Messages In This Thread
Change player class on cmd - by exclide1 - 24.06.2013, 01:46
Respuesta: Change player class on cmd - by JustBored - 24.06.2013, 02:37
Re: Respuesta: Change player class on cmd - by exclide1 - 24.06.2013, 02:40
Re: Change player class on cmd - by _Khaled_ - 24.06.2013, 02:52
Re: Change player class on cmd - by exclide1 - 24.06.2013, 03:10

Forum Jump:


Users browsing this thread: 1 Guest(s)