Guten Tag Community,
ich und mein Freund haben versucht ein Tod system zu machen. Wenn der Spieler stirbt soll ein Pickup erstellt werden. Wenn ein Medic zum Pickup geht und /wiederbeleben eingibt wird der spieler revived. Unser problem der Pickup wird nicht erstellt, /wiederbeleben funktioniert nicht
if(PlayerInfo[playerid][pTot] == 1 && FirstSpawn[playerid] == 0)
{
Clear5Text(playerid);
Clear5Text(playerid);
SendClientMessage(playerid, COLOR_LIGHTRED, "Durch deine schweren Verletzungen liegst du im Koma");
TogglePlayerControllable(playerid, 0);
ResetPlayerWeapons(playerid);
GetPlayerPos(playerid,PlayerInfo[playerid][pTx],PlayerInfo[playerid][pTy],PlayerInfo[playerid][pTz]);
CreatePickup(1254,1,PlayerInfo[playerid][pTx],PlayerInfo[playerid][pTy],PlayerInfo[playerid][pTz],-1);
SetPlayerHealth(playerid, 100);
SetPlayerPos(playerid,1162.871704, -1339.109619, 14.297291);
SetPlayerCameraPos(playerid, 1223.379028, -1333.354126, 33.809105);
SetPlayerCameraLookAt(playerid, 1178.824829, -1325.804077, 13.284119);
GameTextForPlayer(playerid, "~w~IN BEHANDLUNG ~n~~r~ DAUER CA. 60 SEKUNDEN", 15000, 3);
SetPlayerInterior(playerid, 0);
if(PlayerInfo[playerid][pJailed] == 2)
{
PlayerInfo[playerid][pTot] = 0;
SpawnPlayer(playerid);
}
return 1;
}
if(strcmp(cmd, "/wiederbeleben", true) == 0 || strcmp(cmd, "/rea", true) == 0 || strcmp(cmd, "/reanimieren", true) == 0)
{
if(IsPlayerConnected(playerid))
{//cmd erstellt von InternetInk
if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pTot] == 1 && IsPlayerInRangeOfPoint(playerid,5.0,PlayerInfo[i][pTx],PlayerInfo[i][pTy],PlayerInfo[i][pTz]))
{
new pname[256];
GetPlayerName(i, pname, 256);
format(string, 256, "Du hast %s, wiederbelebt!",pname);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
GetPlayerName(playerid, pname, 256);
format(string, 256, "Arzt %s hat dich wiederbelebt!",pname);
SendClientMessage(i, COLOR_LIGHTGREEN, string);
PlayerInfo[i][pTot] = 0;
pIstTot[i] = 0;// <3 den cmd
SetPlayerInterior(i,GetPlayerInterior(playerid));
SetPlayerPos(i,PlayerInfo[i][pTx],PlayerInfo[i][pTy],PlayerInfo[i][pTz]);
SetCameraBehindPlayer(i);
DestroyPickup(TotenKopf[i][0]);
TogglePlayerControllable(i,1);
PlayerInfo[i][pTx] = 0.0;
PlayerInfo[i][pTy] = 0.0;
PlayerInfo[i][pTz] = 0.0;
new Float:tempheal;
GetPlayerHealth(i,tempheal);
SetPlayerHealth(i,15.0);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du bist kein Arzt!");
}
}
return 1;
}