Ich hab ein kleines Problem:
Und zwar stirbt man manchmal nach dem Connecten und landet im Krankenhaus. Wie kann ich das machen, dass man nicht stirbt?
forward tot(playerid);
new Tot[MAX_PLAYERS]; //Krankenhaus
public tot(playerid)
{
SetPlayerPos(playerid,1178.3859,-1324.1239,14.1175);
SetPlayerHealth(playerid,100);
GivePlayerMoney(playerid,-150);
SendClientMessage(playerid,weis,"~~~~~> Krankenhaus <~~~~~");
SendClientMessage(playerid,weis,"Du wurdest entlassen.");
SendClientMessage(playerid,weis,"Kosten der Behandlung 150$");
Tot[playerid] = 0;
if(isPlayerInFrakt(playerid,0)) //Zivi
{
SetPlayerPos(playerid,1641.7704,-2238.1873,13.4986);
SetPlayerSkin(playerid,21);
SetPlayerColor(playerid,weis);
}
if(isPlayerInFrakt(playerid,1)) //LSPD
{
SetPlayerColor(playerid,0x009BFFFF);
if(GetPVarInt(playerid,"Leader")==1)
{
SetPlayerSkin(playerid,283);
SetPVarInt(playerid,"Frakrang",6);
}
else
{
SetPlayerSkin(playerid,281);
}
}
if(isPlayerInFrakt(playerid,2)) //Army
{
SetPlayerColor(playerid,0x00FF00FF);
if(GetPVarInt(playerid,"Leader")==2)
{
SetPlayerSkin(playerid,287);
SetPVarInt(playerid,"Frakrang",6);
}
else
{
SetPlayerSkin(playerid,287);
}
}
if(isPlayerInFrakt(playerid,3)) //Ballas
{
SetPlayerColor(playerid,weis);
if(GetPVarInt(playerid,"Leader")==3)
{
SetPlayerSkin(playerid,103);
}
else
{
SetPlayerSkin(playerid,104);
}
}
if(isPlayerInFrakt(playerid,4)) //Grove Street, GS
{
SetPlayerColor(playerid,weis);
if(GetPVarInt(playerid,"Leader")==4)
{
SetPlayerSkin(playerid,270);
}
else
{
SetPlayerSkin(playerid,269);
}
}
if(isPlayerInFrakt(playerid,5)) //Fahrschule
{
SetPlayerColor(playerid,weis);
if(GetPVarInt(playerid,"Leader")==5)
{
SetPlayerSkin(playerid,171);
}
else
{
SetPlayerSkin(playerid,240);
}
}
SendClientMessage(playerid,weis,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
TogglePlayerControllable(playerid,true);
SetCameraBehindPlayer(playerid);
return 1;
}
// OnPlayerDeath(playerid, killerid, reason)
Tot[playerid] = 1;