Code
dcmd_spec(playerid,params[])
{
new giveplayerid, result[50], string[128];
if(PlayerInfo[playerid][AdminLevel] >= 1)
{
if(sscanf(params,"s",result))
{
SendClientMessage(playerid,COLOR_ORANGE,"NUTZUNG: /spec [playerid]");
SendClientMessage(playerid,COLOR_ORANGE,"FUNKTION: Du kannst einen Spieler beobachten!");
SendClientMessage(playerid,COLOR_YELLOW,"INFO: \"/spec aus\" um wieder in den normalen Spielmodus zu gelangen.");
return 1;
}
if(strcmp(result,"aus",true))
{
TogglePlayerSpectating(playerid,0);
SpawnPlayer(playerid);
}
else if(IsNumeric(result))
{
giveplayerid = strval(result);
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid,giveplayername,sizeof(giveplayername));
format(string,sizeof(string),"INFO: Du beobachtest nun %s[%d].",giveplayername,giveplayerid);
SendClientMessage(playerid,COLOR_YELLOW,string);
SendClientMessage(playerid,COLOR_YELLOW,"INFO: \"/spec aus\" um wieder in den normalen Spielmodus zu gelangen.");
TogglePlayerSpectating(playerid,1);
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(giveplayerid));
SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
if(IsPlayerInAnyVehicle(giveplayerid))
{
PlayerSpectateVehicle(playerid,GetPlayerVehicleID(giveplayerid));
}
else
{
PlayerSpectatePlayer(playerid,giveplayerid);
}
}
else SendInvalidPlayerMessage(playerid,giveplayerid);
}
else
{
SendClientMessage(playerid,COLOR_ORANGE,"NUTZUNG: /spec [playerid]");
SendClientMessage(playerid,COLOR_ORANGE,"FUNKTION: Du kannst einen Spieler beobachten!");
SendClientMessage(playerid,COLOR_YELLOW,"INFO: \"/spec aus\" um wieder in den normalen Spielmodus zu gelangen.");
}
}
else SendInvalidALevelMessage(playerid,1);
return 1;
}
Alles anzeigen
Das ist mein Spectate Kommando.
Wenn ich es mache Spectate Ich mich aber
nur selber.. Bitte helft mir
lg