Hey Leute ,
Ich habe da eine frage unzwahr ich habe den /tv befehl drinn ( damit kann man leute beobachten )
wenn ich z.B am BSN bin und das mache geht alles aber wenn ich TV aus mache werde ich gespawnt , ich will aber das ich dort lande wo ich /tv gemacht habe
Kann mir einer dabei helfen ?
Der befehl :
if(strcmp(cmd, "/tv", true) == 0 || strcmp(cmd, "/recon", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pSupporter] > 0)
{
if(WatchingTV[playerid] < 1)
{
GetPlayerPos(playerid, Unspec[playerid][Coords][0],Unspec[playerid][Coords][1],Unspec[playerid][Coords][2]);
}
}
if(Spectate[playerid] == 255 && PlayerInfo[playerid][pLocal] != 255 || Spectate[playerid] == 255 && PlayerInfo[playerid][pAdmin] > 0)
{
GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
PlayerInfo[playerid][pLocal] = 255;
gTeam[playerid] = 0;
}
tmp = strtok(cmdtext, idx);
if(strcmp("off", tmp, true, strlen(tmp)) == 0)
{
if(WatchingTV[playerid] > 0)
{
WatchingTV[playerid] = 0;
Spectate[playerid] = 253;
GameTextForPlayer(playerid, "~w~ TV~n~~r~ Aus", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Mit dem Befehl schaltest du den Fernseher aus [Einschalten mit /tv [ID]!");
return 1;
}
}
if(PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pSupporter] > 0)
{
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
Spectate[playerid] = giveplayerid;
new Float:health;
GetPlayerHealth(Spectate[playerid], health);
GetPlayerName(Spectate[playerid], giveplayer, sizeof(giveplayer));
new cash = GetPlayerMoney(Spectate[playerid]);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "Recon: (%d) %s $%d H:%.0f",Spectate[playerid],giveplayer,cash,health);
}
else
{
format(string, sizeof(string), "UAV: (%d) %s",Spectate[playerid],giveplayer);
}
SendClientMessage(playerid, COLOR_GREEN, string);
WatchingTV[playerid] = 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Ziel ist nicht verfügbar.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Du bist nicht befugt!");
return 1;
}
}
return 1;
}