Camera before class selection.
#10

pawn Code:
new bool:beenspectating[MAX_PLAYERS];

forward spawnplayer(playerid);
public spawnplayer(playerid)
{
    beenspectating[playerid] = true;

    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);

    SpawnPlayer(playerid);
    return 1;
}

public OnPlayerConnect(playerid)
{
    beenspectating[playerid] = false;
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    if(beenspectating[playerid])
    {
        return 1;
    }
    else
    {
        SpawnPlayer(playerid);
        TogglePlayerSpectating(playerid, 1);

        // SetPlayerCameraPos, SetPlayerCameraLookAt, etc.

        SetTimerEx("spawnplayer", 5000, false, "i", playerid);
        return 0;
    }
}
Should work. I scripted that in very short time so it might have bugs. I tested if it works, and it did.
Reply


Messages In This Thread
Camera before class selection. - by TheKingWillem - 14.07.2010, 12:30
Re: Camera before class selection. - by Pghpunkid - 14.07.2010, 12:55
Re: Camera before class selection. - by ViruZZzZ_ChiLLL - 14.07.2010, 13:00
Re: Camera before class selection. - by Finn - 14.07.2010, 13:20
Re: Camera before class selection. - by TheKingWillem - 14.07.2010, 13:52
Re: Camera before class selection. - by ViruZZzZ_ChiLLL - 14.07.2010, 13:55
Re: Camera before class selection. - by TheKingWillem - 14.07.2010, 14:00
Re: Camera before class selection. - by ViruZZzZ_ChiLLL - 14.07.2010, 14:08
Re: Camera before class selection. - by TheKingWillem - 14.07.2010, 14:11
Re: Camera before class selection. - by Finn - 14.07.2010, 14:25

Forum Jump:


Users browsing this thread: 2 Guest(s)