Guten Tag Community,
da ich in einer Umfrage gefragt habe ob ich ein SF machen soll oder ein GF hab ich mit einem Selfmade angefangen.Ich brauche nun hier hilfe mit dini
und zwar ich habe das so gemacht wenn jemand stirbt soll da ein totenkopf erstellt werden.
So habe ich es gemacht aber wenn der medic /wiederbeleben machen möchte passiert nix.
Ich weis bestimmt das ich mit dini falsch arbeite aber ich möchte sodaso bald auf mysql umsteigen.
Hier der code bitte verbessert ihn:
Onplayerdeath
SetPVarInt(playerid,"Friedhof",1);
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
TotenKopf[playerid] = CreatePickup(1254,1, pX, pY, pZ);
SetPVarInt(playerid,"tx",pX);
SetPVarInt(playerid,"ty",pY);
SetPVarInt(playerid,"tz",pZ);
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
TotenKopf[playerid] = CreatePickup(1254,1, pX, pY, pZ);
SetPVarInt(playerid,"tx",pX);
SetPVarInt(playerid,"ty",pY);
SetPVarInt(playerid,"tz",pZ);
wiederbelben
ocmd:wiederbeleben(playerid,params[])
{
if(isPlayerInFrakt(playerid,3))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"Friedhof")==1 && IsPlayerInRangeOfPoint(i,3.0,GetPVarInt(i,"tx"),GetPVarInt(i,"ty"),GetPVarInt(i,"tz")))
{
new string[128];
new pname[256];
GetPlayerName(i, pname, 256);
format(string, 256, "Du hast %s, wiederbelebt!",pname);
SendClientMessage(playerid, BLAU, string);
GetPlayerName(playerid, pname, 256);
format(string, 256, "Arzt %s hat dich wiederbelebt!",pname);
SendClientMessage(i, BLAU, string);
DestroyPickup(TotenKopf[i]);
SetPVarInt(i,"Friedhof",0);
SetPlayerPos(i,GetPVarInt(i,"tx"),GetPVarInt(i,"ty"),GetPVarInt(i,"tz"));
SetCameraBehindPlayer(i);
SetPVarInt(i,"tx",0.0);
SetPVarInt(i,"ty",0.0);
SetPVarInt(i,"tz",0.0);
new Float:tempheal;
GetPlayerHealth(i,tempheal);
SetPlayerHealth(i,15.0);
return 1;
}
}
}
return 1;
}
{
if(isPlayerInFrakt(playerid,3))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"Friedhof")==1 && IsPlayerInRangeOfPoint(i,3.0,GetPVarInt(i,"tx"),GetPVarInt(i,"ty"),GetPVarInt(i,"tz")))
{
new string[128];
new pname[256];
GetPlayerName(i, pname, 256);
format(string, 256, "Du hast %s, wiederbelebt!",pname);
SendClientMessage(playerid, BLAU, string);
GetPlayerName(playerid, pname, 256);
format(string, 256, "Arzt %s hat dich wiederbelebt!",pname);
SendClientMessage(i, BLAU, string);
DestroyPickup(TotenKopf[i]);
SetPVarInt(i,"Friedhof",0);
SetPlayerPos(i,GetPVarInt(i,"tx"),GetPVarInt(i,"ty"),GetPVarInt(i,"tz"));
SetCameraBehindPlayer(i);
SetPVarInt(i,"tx",0.0);
SetPVarInt(i,"ty",0.0);
SetPVarInt(i,"tz",0.0);
new Float:tempheal;
GetPlayerHealth(i,tempheal);
SetPlayerHealth(i,15.0);
return 1;
}
}
}
return 1;
}