[Pedido] Sistema de spec para admin.
#9

Quote:
Originally Posted by Larceny
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(GetPVarInt(playerid, "isSpectating") == 2)
    {
        SetPlayerInterior(playerid, GetPVarInt(playerid, "specInt"));
        SetPlayerPos(playerid, GetPVarFloat(playerid, "specPosX"), GetPVarFloat(playerid, "specPosY"), GetPVarFloat(playerid, "specPosZ"));

        DeletePVar(playerid, "isSpectating");
        DeletePVar(playerid, "specPosX");
        DeletePVar(playerid, "specPosY");
        DeletePVar(playerid, "specPosZ");
        DeletePVar(playerid, "specInt");
    }
    return 1;
}

CMD:spec(playerid, params[])
{
    new targetid;

    if(sscanf(params, "u", targetid))
    {
        if(GetPVarInt(playerid, "isSpectating"))
        {
            SetPVarInt(playerid, "isSpectating", 2);
            TogglePlayerSpectating(playerid, 0);
            return 1;
        }
        SendClientMessage(playerid, -1, "* /spec [id]");
        return 1;
    }
   
    if(!IsPlayerConnected(targetid) || targetid == INVALID_PLAYER_ID)
        return SendClientMessage(playerid, -1, "* Este jogador nгo estб conectado");
   
    if(!GetPVarInt(playerid, "isSpectating"))
    {
        new Float:fPos[3];
        GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);

        SetPVarFloat(playerid, "specPosX", fPos[0]);
        SetPVarFloat(playerid, "specPosY", fPos[1]);
        SetPVarFloat(playerid, "specPosZ", fPos[2]);
        SetPVarInt(playerid, "specInt", GetPlayerInterior(playerid));
        SetPVarInt(playerid, "isSpectating", 1);

        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, targetid);
    }
    else
    {
        SendClientMessage(playerid, -1, "* Vocк jб estб observando alguйm. [/spec para sair]");
    }
    return 1;
}
nгo consigo sair do spec '-'
Reply


Messages In This Thread
Sistema de spec para admin. - by RafaScripter - 06.01.2013, 16:19
Re: Sistema de spec para admin. - by Lуs - 06.01.2013, 16:22
Re: Sistema de spec para admin. - by HeyHoLetsGo - 06.01.2013, 16:43
Re: Sistema de spec para admin. - by Lуs - 06.01.2013, 16:47
Re: Sistema de spec para admin. - by RafaScripter - 06.01.2013, 16:50
Re: Sistema de spec para admin. - by Equipe - 06.01.2013, 16:58
Re: Sistema de spec para admin. - by Lуs - 06.01.2013, 17:01
Re: Sistema de spec para admin. - by Larceny - 06.01.2013, 17:08
Respuesta: Re: Sistema de spec para admin. - by DKDarkking - 27.05.2015, 18:55

Forum Jump:


Users browsing this thread: 2 Guest(s)