ForceClassSelection wont work
#1

So yeah, I've placed so it turns you into the class selection on death put wont work.

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    UsedHeal[playerid] = false;
	PlayerInfo[killerid][pKills] ++;
	PlayerInfo[playerid][pDeaths] ++;

	ForceClassSelection(playerid);
	return 1;
}
Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
        TogglePlayerSpectating(playerid, true);
        return 1;
}
Even when I Turn the TogglePlayerSpectating it will still do same shit.
Reply
#2

I tested this, and it gave some odd results. OPRC does get called again, but it gets called twice, the second time about a second later, and I have a bottle in my hand. It DOES send me back though.

P.S. Don't use killerid in an array unless you check whether it's INVALID_PLAYER_ID or not. Suicide will make killerid 65535 which is bigger than [MAX_PLAYERS] so will crash your script (array index out of bounds).
Reply
#3

Thanks for the advice, but I still dont get it what can be ruining it.

Код:
public StartedNewRound()
{
    for(new i = 0; i < MAX_PLAYERS; i++) {
        SpawnPlayer ( i ) ;
        switch ( MapChange )
		{
            case 0:
            {
                SendClientMessage(i,COLOR_GREEN,"Changing the map!");

            }
            case 1:
            {
                SendClientMessage(i,COLOR_GREEN,"Changing the map!");
            }
        }
    }
    return 1;
}
EDIT: Now I am getting other problem. The player camera starts to move up and goes into heaven lol.
Reply
#4

Nevermind, resolved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)