Hey, auf meinem Server, wenn jemand spawnt, spawnt man manchmal und ist sofort wieder tot. Das geht dann ohne Ende lang...
Habe schon was weiß ich alles versucht, aber es passiert immer noch.
Codes:
OnPlayerConnect:
Spawn[playerid][PSpawn] = 1;
Spawn[playerid][Krankenhausspawn] = 0;
//Spawn[playerid][Paintballspawn] = 0;
SetPlayerHealth(playerid,dini_Int(Spielerdatei,"Leben"));
SetPlayerArmour(playerid,dini_Int(Spielerdatei,"Schutzweste"));
OnPlayerDeath:
public OnPlayerDeath(playerid, killerid, reason)
{
new string[128];
if(GetPVarInt(playerid,"Hit") == 1)
{
if(isPlayerInFrak(killerid,9))
{
SetPVarInt(playerid,"Hit",0);
SetPVarInt(playerid,"Hitgeld",0);
GivePlayerMoney(killerid,GetPVarInt(playerid,"Hitgeld"));
}
format(string,sizeof(string),"Du wurdest von %s getötet.\nFalls du grundlos angegriffen wurdest & du Screens hast, kannst du den Killer im Forum melden.",SpielerName(killerid));
SendClientMessage(playerid,Grau,string);
SendClientMessage(playerid,Grau,"Die Forumadresse findest du unter /serverinfo.");
DropPlayerWeapons(playerid);
SetPVarInt(playerid,"Armour",0);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,1080.8970,-1332.7207,30.2853);
SetPlayerCameraPos(playerid,1137.8187,-1322.5009,13.1100);
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,Rot,"===============Krankenhaus===============");
SendClientMessage(playerid,Weiss,"Du bist gestorben, deswegen versuchen die Medics");
SendClientMessage(playerid,Weiss,"dich unlogischerweise wiederzubeleben.");
SendClientMessage(playerid,Weiss,"Bis sie das getan haben, musst du warten.");
SendClientMessage(playerid,Weiss,"Sie brauchen nur 20 Sekunden um dich wiederzubeleben.");
SendClientMessage(playerid,Rot,"==========================================");
SetTimerEx("tottimer",1000*20,false,"d",playerid);
Spawn[playerid][Krankenhausspawn] = 1;
return 1;
}
/*
if(PaintBall[playerid][IPaintball] == 1)
{
new str[128];
PaintBall[killerid][Kills] ++;
PaintBall[playerid][Tode] ++;
format(str,128,"%s hat %s getötet. Er hat nun %d kills und %d Tode.",SpielerName(killerid),SpielerName(playerid),PaintBall[killerid][Kills],PaintBall[killerid][Tode]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))continue;
if(PaintBall[i][IPaintball] == 0)continue;
SendClientMessage(i,Weiss,str);
}
new rand = random(sizeof(PaintballSpawn));
switch(rand)
{
case 1:SetPlayerPos(playerid,-354.6074,2208.4773,42.4844);
case 2:SetPlayerPos(playerid,-381.0569,2206.3672,42.3755);
case 3:SetPlayerPos(playerid,-400.7436,2200.5308,42.4297);
case 4:SetPlayerPos(playerid,-443.3661,2219.8782,42.4297);
case 5:SetPlayerPos(playerid,-457.8464,2222.5994,43.1827);
case 6:SetPlayerPos(playerid,-433.3537,2252.5222,42.4297);
case 7:SetPlayerPos(playerid,-411.0956,2261.3284,42.4297);
case 8:SetPlayerPos(playerid,-376.2642,2266.9880,42.4648);
case 9:SetPlayerPos(playerid,-374.8770,2252.6470,42.4844);
case 10:SetPlayerPos(playerid,-376.7805,2241.8240,42.6185);
}
GivePlayerWeapon(playerid,24,999);
GivePlayerWeapon(playerid,29,999);
Spawn[playerid][Paintballspawn] = 1;
printf("Spieler ist in der Paintballarena gestorben.");
return 1;
}*/
format(string,sizeof(string),"Du wurdest von %s getötet.\nFalls du grundlos angegriffen wurdest & du Screens hast, kannst du den Killer im Forum melden.",SpielerName(killerid));
SendClientMessage(playerid,Grau,string);
SendClientMessage(playerid,Grau,"Die Forumadresse findest du unter /serverinfo.");
DropPlayerWeapons(playerid);
SetPVarInt(playerid,"Armour",0);
SetPVarInt(playerid,"Leben",100);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,1080.8970,-1332.7207,30.2853);
SetPlayerCameraPos(playerid,1137.8187,-1322.5009,13.1100);
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,Rot,"===============Krankenhaus===============");
SendClientMessage(playerid,Weiss,"Du bist gestorben, deswegen versuchen die Medics");
SendClientMessage(playerid,Weiss,"dich unlogischerweise wiederzubeleben.");
SendClientMessage(playerid,Weiss,"Bis sie das getan haben, musst du warten.");
SendClientMessage(playerid,Weiss,"Sie brauchen nur 20 Sekunden um dich wiederzubeleben :)");
SendClientMessage(playerid,Rot,"==========================================");
SetTimerEx("tottimer",1000*20,false,"d",playerid);
Spawn[playerid][Krankenhausspawn] = 1;
return 1;
}
public tottimer(playerid)
{
if(Spawn[playerid][Krankenhausspawn] == 1)
{
SetPlayerPos(playerid,1219.8646,-1323.0664,13.4807);
TogglePlayerControllable(playerid,1);
SetPlayerHealth(playerid,100);
ResetPlayerWeapons(playerid);
GameTextForPlayer(playerid,"~r~Krankenhausrechnung:~r~\n ~g~50$~g~",5000,3);
GivePlayerMoney(playerid,-50);
//Spawn[playerid][Krankenhausspawn] = 0;
}
return 1;
}
OnPlayerSpawn:
SetPlayerHealth(playerid,dini_Int(Spielerdatei,"Leben"));
SetPlayerArmour(playerid,dini_Int(Spielerdatei,"Schutzweste"));
if(Spawn[playerid][Krankenhausspawn] == 1)
{
Spawn[playerid][Krankenhausspawn] = 0;
SetPlayerPos(playerid,1219.8646,-1323.0664,13.4807);
}
if(Spawn[playerid][PSpawn] == 1)
{
x=dini_Float(Spielerdatei,"X");
y=dini_Float(Spielerdatei,"Y");
z=dini_Float(Spielerdatei,"Z");
SetPlayerPos(playerid,x,y,z);
SetPlayerFacingAngle(playerid,dini_Int(Spielerdatei,"Angle"));
SetPlayerInterior(playerid,dini_Int(Spielerdatei,"Interior"));
SetPlayerVirtualWorld(playerid,dini_Int(Spielerdatei,"VW"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe1"),dini_Int(Spielerdatei,"Waffe1Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe2"),dini_Int(Spielerdatei,"Waffe2Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe3"),dini_Int(Spielerdatei,"Waffe3Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe4"),dini_Int(Spielerdatei,"Waffe4Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe5"),dini_Int(Spielerdatei,"Waffe5Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe6"),dini_Int(Spielerdatei,"Waffe6Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe7"),dini_Int(Spielerdatei,"Waffe7Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe8"),dini_Int(Spielerdatei,"Waffe8Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe9"),dini_Int(Spielerdatei,"Waffe8Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe10"),dini_Int(Spielerdatei,"Waffe10Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe11"),dini_Int(Spielerdatei,"Waffe11Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe12"),dini_Int(Spielerdatei,"Waffe12Munition"));
GivePlayerWeapon(playerid,dini_Int(Spielerdatei,"Waffe13"),dini_Int(Spielerdatei,"Waffe13Munition"));
Spawn[playerid][PSpawn] = 0;
}
Weiß jemand vlt was ich falsch gemacht habe?