Hallöchen,
wenn ein Spieler sich teleportiert, soll für kurze Zeit, solange die Spawnprotection aktiv ist, ein Label erscheinen. Nun ist es aber so, dass es nach dem 2x Porten immer besteht und nicht mehr zerstört wird.
Hier ist die SpawnProtectionInfo von Relevanz.
stock SetSpawnProtection(playerid)
{
SetPlayerHealth(playerid, 99999);
InProtectionMode[playerid] = true;
//Erstellen des Labels für playerid
SpawnProtectionInfo[playerid] = CreateDynamic3DTextLabel("SPAWN PROTECTION", C_RED, 0.0, 0.0, 0.0, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
if(GetPlayerVirtualWorld(playerid) == 0) SetTimerEx("EndSpawnProtection", 3000, false, "i", playerid);
else SetTimerEx("EndGodMode", 3000, false, "i", playerid);
return 1;
}
forward EndSpawnProtection(playerid);
public EndSpawnProtection(playerid)
{
if(0 < PlayerHPandAP[playerid][health] < 100) ReturnPlayerHPandAP(playerid);
else SetPlayerHealth(playerid, 100);
InProtectionMode[playerid] = false;
//Zerstören des Labels als Abbruchbedingung für den Timer
DestroyDynamic3DTextLabel(SpawnProtectionInfo[playerid]);
return 1;
}
stock AddTeleport(playerid, textDE[], textEN[], Float:PedX, Float:PedY, Float:PedZ, Float:PedA, Float:VehX, Float:VehY, Float:VehZ, Float:VehA, cost, bool:buffer, bool:spawnprotect, bool:msgtoall, worldid = 0, interiorid = 0)
{
if(PlayerActionForbidden(playerid)) return 1;
if(buffer) if(BufferCMD(playerid)) return 1;
if(GetPlayerMoney(playerid) >= cost)
{
if(spawnprotect == true)
{
SavePlayerHPandAP(playerid);
SetSpawnProtection(playerid);
}
if(msgtoall == false) return SendLanguageMessage(playerid, C_GOLD, textDE, textEN);
else if(msgtoall == true) return SendLanguageMessageToAll(C_GOLD, textDE, textEN);
GivePlayerMoneyEx(playerid, -cost);
SetPlayerPos(playerid, PedX, PedY, PedZ);
SetPlayerFacingAngle(playerid, PedA);
SetVehiclePos(GetPlayerVehicleID(playerid), VehX, VehY, VehZ);
SetVehicleZAngle(GetPlayerVehicleID(playerid), VehA);
PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
SetPlayerVirtualWorld(playerid, worldid);
SetPlayerInterior(playerid, interiorid);
SetCameraBehindPlayer(playerid);
}
else SendLanguageMessage(playerid, C_RED, "»WARNUNG« Du hast nicht genug Geld!", "»WARNING« You don't have enough money!");
return 1;
}
//==================================================================================================================================================================================================================================
COMMAND:ls(playerid, params[])
{
new stringDE[128],
stringEN[128],
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(stringDE, sizeof(stringDE), "»TELEPORT« {%06x}%s "#C_GOLD_E"hat sich nach Los Santos teleportiert! [/LS]", GetPlayerColor(playerid) >>> 8, pName);
format(stringEN, sizeof(stringEN), "»TELEPORT« {%06x}%s "#C_GOLD_E"has teleported to Los Santos! [/LS]", GetPlayerColor(playerid) >>> 8, pName);
AddTeleport(playerid, stringDE, stringEN, 2492.7268, -1668.3849, 13.3438, WEST, 2492.7268, -1668.3849, 13.3438, WEST, 200, true, true, true, 0, 0);
return 1;
}