Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new string[255];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(KickPlayer[i]==1) { Kick(i); }
- else if(KickPlayer[i]==2) { Ban(i); }
- //if(GetPlayerPing(i) >= 500 && PlayerInfo[i][pAdmin] < 1) { Kick(i); }
- if(Spectate[i] < 253 && Spectate[i] != 255)
- {
- FreezePlayer(i);
- new targetid = Spectate[i];
- if(IsPlayerConnected(targetid))
- {
- TogglePlayerSpectating(i, 1);
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- new Float:health;
- new name[MAX_PLAYER_NAME];
- GetPlayerName(targetid, name, sizeof(name));
- GetPlayerHealth(targetid, health);
- format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~r~Name: ~y~%s~r~(%d)~n~~r~Leben: ~y~%.1f",name,targetid,health);
- GameTextForPlayer(i, string, 2500, 3);
- }
- if(IsPlayerInAnyVehicle(targetid))
- {
- new carid = GetPlayerVehicleID(targetid);
- PlayerSpectateVehicle(i, carid);
- }
- else
- {
- PlayerSpectatePlayer(i, targetid);
- }
- if(GetPlayerInterior(targetid) == 0)
- {
- SetPlayerInterior(i,0);
- }
- else if(GetPlayerInterior(targetid) > 0)
- {
- SetPlayerInterior(i,GetPlayerInterior(targetid));
- }
- }//Targetid connected
- }
- if(Spectate[i] == 253)
- {
- UnFreezePlayer(i);
- TogglePlayerSpectating(i, 0);
- SetPlayerInterior(i,Unspec[i][sPint]);
- PlayerInfo[i][pInt] = Unspec[i][sPint];
- PlayerInfo[i][pLocal] = Unspec[i][sLocal];
- Unspec[i][sLocal] = 255;
- SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pModel], Unspec[i][sPx], Unspec[i][sPy], Unspec[i][sPz]-1.0, 1.0, -1, -1, -1, -1, -1, -1);
- gTeam[i] = PlayerInfo[i][pTeam];
- SetPlayerToTeamColor(i);
- MedicBill[i] = 0;
- if(PlayerInfo[i][pDonateRank] > 0)
- {
- SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pModel], Unspec[i][Coords][0], Unspec[i][Coords][1], Unspec[i][Coords][2], 10.0, -1, -1, -1, -1, -1, -1);
- SpawnPlayer(i);
- SetCameraBehindPlayer(i);
- }
- else
- {
- SpawnPlayer(i);
- }
- Spectate[i] = 255;
- }
- if(Spectate[i] == 254)
- {
- UnFreezePlayer(i);
- SetPlayerInterior(i,Unspec[i][sPint]);
- PlayerInfo[i][pInt] = Unspec[i][sPint];
- PlayerInfo[i][pLocal] = Unspec[i][sLocal];
- SetPlayerPos(i, Unspec[i][sPx], Unspec[i][sPy], Unspec[i][sPz]);
- Spectate[i] = 255;
- }
- if(Spectate[i] == 256)
- {
- SetPlayerToTeamColor(i);
- Spectate[i] = 255;
- }
- if(Spectate[i] == 257)
- {
- Spectate[i] = 254;
- }
- }
- }
- ocmd:tv(playerid, params[])
- {
- new Zeit, pID, Grund[128], sendername[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME], string[500], oldtime;
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht eingeloggt!");
- if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pSupporter] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Du bist kein admin!");
- if(WatchingTV[playerid] > 0 && sscanf(params, "u", pID))
- {
- WatchingTV[playerid] = 0;
- Spectate[playerid] = 253;
- PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, 0x007DE0FF, "spec aus");
- return 1;
- }
- if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /tv [Spieler ID]");
- {
- if(!IsPlayerConnected(pID))
- {
- format(string, sizeof(string), "Spielerid %d wurde nicht gefunden!",pID);
- SendClientMessage(playerid, 0xFF0000FF, string);
- return 1;
- }
- if(PlayerInfo[pID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Du kannst diesen Befehl nicht an diesen Administrator verwenden.");
- new Float:health;
- GetPlayerHealth(pID, health);
- new cash = GetPlayerMoney(pID);
- if (PlayerInfo[playerid][pAdmin] >= 1)
- {
- format(string, sizeof(string), "spec: {BEBEBE}Du spectatest nun %s(%d) | Geld: %d$ | Leben: %.0f",Spielername(pID),pID,cash,health);
- SendClientMessage(playerid, 0x007DE0FF, string);
- printf("[SPECTATE] Teammitglied %s spectetet nun %s. (%d-%d-%d)", Spielername(playerid),Spielername(pID));
- Spectate[playerid] = pID;
- WatchingTV[playerid] = 1;
- if(IsPlayerInAnyVehicle(pID))
- {
- new carid = GetPlayerVehicleID(pID);
- PlayerSpectateVehicle(playerid, carid);
- }
- else
- {
- PlayerSpectatePlayer(playerid, pID);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement