ForceClassSelection wont work - 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: ForceClassSelection wont work (
/showthread.php?tid=427760)
ForceClassSelection wont work -
Squirrel - 03.04.2013
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.
Re: ForceClassSelection wont work -
MP2 - 03.04.2013
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).
Re: ForceClassSelection wont work -
Squirrel - 03.04.2013
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.
Re: ForceClassSelection wont work -
Squirrel - 03.04.2013
Nevermind, resolved.