18.12.2011, 05:06
You mean using TogglePlayerSpectating? If so, where would I put that function? With such short time between OnPlayerDeath and OnPlayerSpawn, isn't it pretty pointless (or could I use a timer)?
---
By the way, this is what I'm talking about:
This is the code under OnPlayerSpawn now:
EDIT: BLAH. I forgot to remove "return 0;" one second...
EDIT 2: Okay, the code above is accurate. However, the whole OnPlayerSpawn function isn't being called now...
EDIT 3: Now after removing the code from OnPlayerSpawn, and placing it back under OnPlayerRequestClass, OnPlayerSpawn is still not being called.
---
By the way, this is what I'm talking about:
This is the code under OnPlayerSpawn now:
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid, "JustDied") == 1)
{
ClearChat(playerid);
OOCEnabled[playerid] = 0;
SendClientMessage(playerid, COLOR_LRED, "You have been transported to the hospital and can't remember what happened to you.");
SetPlayerCameraLookAt(playerid, -2327.4072, 1357.9125, 334.0528);
SetPlayerVirtualWorld(playerid, randomEx(30, 500));
defer HospitalTimer(playerid);
SetPVarInt(playerid, "INHOSP", 1);
DeletePVar(playerid, "JustDied");
}
TextDrawShowForPlayer(playerid, TimeTD);
TextDrawShowForPlayer(playerid, CompleteDate);
TextDrawShowForPlayer(playerid, ServerVersionTD);
PreloadAnimLib(playerid, "BOMBER");
PreloadAnimLib(playerid, "RAPPING");
PreloadAnimLib(playerid, "SHOP");
PreloadAnimLib(playerid, "BEACH");
PreloadAnimLib(playerid, "SMOKING");
PreloadAnimLib(playerid, "ON_LOOKERS");
PreloadAnimLib(playerid, "DEALER");
PreloadAnimLib(playerid, "CRACK");
PreloadAnimLib(playerid, "CARRY");
PreloadAnimLib(playerid, "COP_AMBIENT");
PreloadAnimLib(playerid, "PARK");
PreloadAnimLib(playerid, "INT_HOUSE");
PreloadAnimLib(playerid, "FOOD");
PreloadAnimLib(playerid, "GANGS");
PreloadAnimLib(playerid, "PED");
PreloadAnimLib(playerid, "FAT");
return 1;
}
EDIT 2: Okay, the code above is accurate. However, the whole OnPlayerSpawn function isn't being called now...
EDIT 3: Now after removing the code from OnPlayerSpawn, and placing it back under OnPlayerRequestClass, OnPlayerSpawn is still not being called.