Hey Leute ,
Ich hab das Problem, wen ich aufhöre zu Spectaten(/spec) stirbt man einfach.
Leider find ich wie immer den fehler im code nicht.
if(strcmp("/spec",cmd,true)==0)
{
logCommand(playerid,cmdtext);
if(IsPlayerAnAdmin(playerid,2)||GetPVarInt(playerid,"FM")==1)
{
tmp = strtok(cmdtext, idx);
if(!tmp[0])return SendClientMessage(playerid, COLOR_GRAD2, "INFO: /spec [playerid]");
new specedplayer = ReturnUser(tmp);
if(specedplayer==INVALID_PLAYER_ID)return ErrorMsg(playerid,"Ungültiger Spieler.");
if(uadmin[specedplayer]==0)
{
if(SpielerInfo[playerid][Admin]<SpielerInfo[specedplayer][Admin])return ErrorMsg(playerid,"Du darfst nur Leute specen, deren Rang kleiner als deiner ist.");
}
WaffenSpeichern(playerid);
new Float:px,Float:py,Float:pz;
GetPlayerPos(playerid,px,py,pz);
LastSpecPos[playerid][0]=px;
LastSpecPos[playerid][1]=py;
LastSpecPos[playerid][2]=pz;
GetPlayerHealth(playerid,LastSpecHeal[playerid]);
LastSpecInt[playerid]=GetPlayerInterior(playerid);
LastSpecVir[playerid]=GetPlayerVirtualWorld(playerid);
SetPVarInt(specedplayer,"specadmin",playerid);
if(!IsPlayerInAnyVehicle(specedplayer))
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid,specedplayer);
SetPlayerInterior(playerid,GetPlayerInterior(specedplayer));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(specedplayer));
spect[playerid]=1;
}
else
{
new vehicleid;
vehicleid=GetPlayerVehicleID(specedplayer);
TogglePlayerSpectating(playerid,1);
PlayerSpectateVehicle(playerid,vehicleid);
SetPlayerInterior(playerid,GetPlayerInterior(specedplayer));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(specedplayer));
spect[playerid]=1;
}
return 1;
}
return 1;
}
Wäre echt cool wen mir einer helfen könnte
Lg
Mr.ElectRoX