if(PlayerInfo[playerid][pSpec] == 1){ for(new x = 0; x < MAX_PLAYERS; x++) { TogglePlayerSpectating(x, true); PlayerSpectatePlayer(x, true); }}
CMD:spec(playerid, params[]) { if(gTeam[playerid] == FIRST_TEAM & SECOND_TEAM) return MSG(playerid, COLOR_RED, \"Hiba: Nem használhatod ezt a parancsot, mivel részt veszel a warban!\"); if(sscanf(params,\"u\", id)) return MSG(playerid, -1, \"Használat: /spec <JátékosNév/ID>\");if(id == INVALID_PLAYER_ID) return MSG(playerid, COLOR_RED, \"Hiba: Nincs ilyen játékos!\"); if(id == playerid) return MSG(playerid, COLOR_RED, \"Hiba: Magadat nem specelheted!\"); PlayerInfo[playerid][pSpecID] = id;TogglePlayerSpectating(playerid, true); PlayerSpectatePlayer(playerid, id);SetPlayerInterior(playerid, GetPlayerInterior( id )); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld( id )); PlayerInfo[playerid][pSpec] = 1; return ( 1 );}CMD:specoff( playerid ) { if(gTeam[playerid] != SPEC_TEAM) return MSG(playerid, COLOR_RED, \"Hiba: Nem használhatod ezt a parancsot, mivel részt veszel a warban!\"); if(gTeam[playerid] == SPEC_TEAM && ServerInfo[AutoSpec] == true) return MSG(playerid, COLOR_RED, \"Hiba: Nem használhatod ezt a parancsot, mivel az autospec be van kapcsolva.\"); TogglePlayerSpectating(playerid, false);PlayerInfo[playerid][pSpecID] = INVALID_PLAYER_ID;SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); PlayerInfo[playerid][pSpec] = 0;SpawnPlayer( playerid );return ( 1 );}
PlayerInfo[id][pSpecID] = playerid;
if(PlayerInfo[playerid][pSpecID] != INVALID_PLAYER_ID){TogglePlayerSpectating(PlayerInfo[playerid][pSpecID],true);PlayerSpectatePlayer(PlayerInfo[playerid][pSpecID],playerid,SPECTATE_MODE_NORMAL);}
for(new i = 0; i < MAX_PLAYERS; i++){if(PlayerInfo[pSpecID] == playerid) { PlayerInfo[pSpecID] = INVALID_PLAYER_ID; }}
public OnPlayerDeath(playerid, killerid, reason){new max = GetMaxPlayers();for(new i; i < max; i++){ // Ha valaki (i) követte a játékost (playerid) if(PlayerInfo[pSpecID] == playerid) { // Ha tudjuk ki ölte meg a játékost, akkor... if(killerid != INVALID_PLAYER_ID) { // a valaki (i) kövesse a a gyilkosát. (killerid) SetPlayerInterior(i, GetPlayerInterior( killerid )); SetPlayerVirtualWorld(i, GetPlayerVirtualWorld( killerid )); PlayerSpectatePlayer(i, killerid); } else { // a valaki (i) kövessen valaki mást, ha ismeretlen a gyilkos. // Ezt rátok bízom. } }}return;}
public OnPlayerSpawn(playerid){new max = GetMaxPlayers();for(new i; i < max; i++){ if(IsPlayerConnected(i) && PlayerInfo[i][pSpecID] == playerid) { SetPlayerInterior(i, GetPlayerInterior( playerid )); SetPlayerVirtualWorld(i, GetPlayerVirtualWorld( playerid )); PlayerSpectatePlayer(i, playerid); }}return 1;}