13.02.2011, 16:15
pawn Код:
public OnPlayerSpawn(playerid)
{
if(PInfo[playerid][AdminDuty] == 1)
{
label[playerid] = Create3DTextLabel("On-Duty admin, do not attack",0x008080FF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
SetPlayerSkin(playerid, 217);
SetPlayerHealth(playerid, 10000);
GivePlayerWeapon(playerid, WEAPON_MINIGUN, 100000);
}
if(PlayerInfo[playerid][ForHospital] == 1)
{
SetTimerEx( "HospitalTimer2", 1000, 0, "d", playerid );
}
return 1;
}
public HospitalTimer2( playerid )
{
TogglePlayerControllable( playerid, 0 );
SetPlayerPos( playerid, 2309.0232,-1142.1338,1055.1511 );
SetPlayerInterior( playerid, 12 );
SetPlayerFacingAngle( playerid, 359.8549 );
SetPlayerCameraLookAt( playerid, 2309.0232,-1142.1338,1055.1511 );
GameTextForPlayer( playerid, "You are in hospital now, please wait for doctors to cure you", 3000, 6 );
SetTimerEx( "HospitalTimer", 60*1000, 0, "d", playerid );
PInfo[ playerid ][ ForHospital ] = 0;
return 1;
}
I changed the spital check.I moved it at OnPlayerSpawn