29.03.2012, 02:36
(
Последний раз редактировалось Kar; 31.03.2012 в 00:10.
)
This is a critical bug and can be used to avoid class selection. (if the server was just restarted).
SOMETIMES, when you restart the gamemode, and you return. You will encounter this bug.
OnPlayerRequestClass IS NOT called yet. It will call if you use the arrow buttons.
When you click SPAWN, OnPlayerRequestSpawn will execute, obviously, but no OnPlayerRequestClass is called.
This can bug servers that save 'classid' into a global variable.
A temporary fix I made to my server for this.
I have only tested this bug in 0.3e RC5.
Edit: fixed the temp fix
SOMETIMES, when you restart the gamemode, and you return. You will encounter this bug.
OnPlayerRequestClass IS NOT called yet. It will call if you use the arrow buttons.
When you click SPAWN, OnPlayerRequestSpawn will execute, obviously, but no OnPlayerRequestClass is called.
This can bug servers that save 'classid' into a global variable.
A temporary fix I made to my server for this.
pawn Код:
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][pCarModel] = Class_Selection_IDS[0][CS_VehicleModelID]; // = 400 (dummy vehicle)
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
classid++;//so theres no 0 (dummy)
PlayerInfo[playerid][pCarModel] = C_S_IDS[classid][CS_VehicleModelID];//none of these values are equal to the dummy
SetPlayerCameraPos(playerid, 100.0, 100.0, 100.0);
SetPlayerCameraLookAt(playerid, 100.0, 98.0, 102.0, CAMERA_MOVE);
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(PlayerInfo[playerid][pCarModel] == Class_Selection_IDS[0][CS_VehicleModelID])//this is changed under OnPlayerRequestClass
{
GameTextForPlayer(playerid, "~r~Please Select A Vehicle!", 3000, 3);
CallLocalFunction("OnPlayerRequestClass", "ii", playerid, 0);//force onplayerrequestclass so your camera code can be executed
return 0;
}
return 1;
}
Edit: fixed the temp fix