Hey Community,
Irgendwas stimmt nicht mit meinem Totenkopf und dem 3DTextLabel. Könntet ihr mal drüber blicken? Er wird erstellt aber verschwindet dann iwie sofort
Oben im Script
new TodesPickup[MAX_PLAYERS];
new Text3D:Todes3DText[MAX_PLAYERS];
forward CheckKH();
OnGameModeIniti
SetTimer("CheckKH", 1000,1);
OnPlayerDeath
SetPVarInt(playerid,"Krankenhaus",175);
GivePlayerMoney(playerid,-600);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
TodesPickup[playerid] = CreatePickup(1254, 1, X, Y, Z, 0);
new name[MAX_PLAYERS], tstring[128];
GetPlayerName(playerid,name,sizeof(name));
format(tstring,sizeof(tstring),"%s\nGestorben",name);
Todes3DText[playerid] = Create3DTextLabel(tstring, 0xD2D2D2FF, X, Y, Z, 20.0, 0, 0);
public CheckKH()
public CheckKH()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"Krankenhaus") == 0)
{
TogglePlayerControllable(i,1);
SetPVarInt(i,"Krankenhaus",-1);
SetCameraBehindPlayer(i);
DestroyPickup(TodesPickup[i]);
Delete3DTextLabel(Todes3DText[i]);
SetPVarInt(i,"Krankenhaus",-1);
switch(pInfo[i][Fraktion])
{
case 0:{
SetPlayerPos(i,noobspawn);
}
case 1:{
SetPlayerPos(i,lspdspawn);
}
case 2:{
SetPlayerPos(i,lsvspawn);
}
case 3:{
SetPlayerPos(i,medicspawn);
}
}
}
if(GetPVarInt(i,"Krankenhaus") > 0) SetPVarInt(i,"Krankenhaus",GetPVarInt(i,"Krankenhaus")-1);
}
return 1;
}
#Edit: OnPlayerSpawn
if(GetPVarInt(playerid,"Krankenhaus") > 0 )
{
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid,1165.7139, -1332.1963, 15.9905);
SetPlayerFacingAngle(playerid,90);
SetPlayerCameraPos(playerid, 1217.9348, -1363.9851, 51.3236);
SetPlayerCameraLookAt(playerid, 1217.1332, -1363.3783, 50.7735);
}