Brauche Hilfe beim SoL Script !!!

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hi,
    Brauche Hilfe beim SoL Script!
    Und Zwar beim Command /tv
    Wenn man /tv macht dan sieht man den Spieler aber wenn man /tv'en Aufhört Spawnt man beim ZiviSpawn oder LSPD Spawn kommt darauf an welche frak man ist
    Bitte Help :)



    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;
    }

  • 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;
    }