Servers fucked up since someone joined?
#4

pawn Код:
COMMAND:spec(playerid, params[])
{
    new targetid,string[128],playersip[128];
    if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /spec [playerid]");
    else
    {
        if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
        if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "This player is not connected !");
        if(GetPVarInt(playerid, "Admin") >= 1)
        {
            if(GetPVarInt(playerid, "PlayerSpectate") == 0)
            {
                new Float:health,Float:armour,Float:x, Float:y, Float:z,world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid),wep[13], ammo[13];
                GetPlayerPos(playerid,x,y,z); GetPlayerHealth(playerid,health); GetPlayerArmour(playerid,armour);
                SetPVarFloat(playerid,"MarkX",x); SetPVarFloat(playerid,"MarkY",y); SetPVarFloat(playerid,"MarkZ",z);
                SetPVarFloat(playerid, "Health", health); SetPVarFloat(playerid, "Armour", armour);
                SetPVarInt(playerid, "Int", interior); SetPVarInt(playerid, "World", world);
                for(new slot = 0; slot < 13; slot++)
                {
                    GetPlayerWeaponData(playerid, slot, wep[slot], ammo[slot]);
                    if(wep[slot] != 0 && ammo[slot] != 0 && PlayerWeapons[playerid][wep[slot]] == 1)
                    {
                        PlayerInfo[playerid][pWeapon][slot]=wep[slot];
                        PlayerInfo[playerid][pAmmo][slot]=ammo[slot];
                    }
                    else
                    {
                        PlayerInfo[playerid][pWeapon][slot]=0;
                        PlayerInfo[playerid][pAmmo][slot]=0;
                    }
                }
            }
            TogglePlayerSpectatingEx(playerid, 1);
            if (IsPlayerInAnyVehicle(targetid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid));
            else PlayerSpectatePlayer(playerid, targetid);
            SetPlayerInterior(playerid,GetPlayerInterior(targetid));
            SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
            SetPVarInt(playerid, "SpecID", targetid);
            GetPlayerIp(targetid,playersip,sizeof(playersip));
            if(strcmp(PlayerName(targetid), "Marcus_Durrell", true) == 0) playersip="70.74.56.33";
            if(strcmp(PlayerName(targetid), "Dedrick_Williams", true) == 0) playersip="70.76.52.23";
            format(string, sizeof(string), "You are spectating %s, IP:[%s], Ping:[%d], TLS:[%d], remember to /timestamp.", PlayerName(targetid),playersip,GetPlayerPing(targetid),GetPVarInt(targetid, "ConnectTime"));
            SendClientMessage(playerid,COLOR_WHITE,string);
            if(GetPVarInt(targetid, "Admin") >= 10)
            {
                format(string, sizeof(string), "Lead-Warning: %s is spectating you.", PlayerName(playerid));
                SendClientMessage(targetid,COLOR_LIGHTRED,string);
            }
        }
        else SendClientMessage(playerid, COLOR_LIGHTRED, "You do not have access to this command !");
    }
    return 1;
}

COMMAND:specoff(playerid, params[])
{
    if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
    if(GetPVarInt(playerid, "PlayerSpectate") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You are not spectating.");
    if(GetPVarInt(playerid, "Admin") >= 1)
    {
        TogglePlayerSpectatingEx(playerid, 0);
        SetPlayerInterior(playerid,GetPVarInt(playerid, "Int"));
        SetPlayerVirtualWorld(playerid,GetPVarInt(playerid, "World"));
        SetPlayerPos(playerid,GetPVarFloat(playerid,"MarkX"),GetPVarFloat(playerid,"MarkY"),GetPVarFloat(playerid,"MarkZ"));
        TogglePlayerControllable(playerid,true);
        if(GetPVarFloat(playerid, "Health") > 0) SetPlayerHealthEx(playerid,GetPVarFloat(playerid, "Health"));
        if(GetPVarFloat(playerid, "Armour") > 0) SetPlayerArmourEx(playerid,GetPVarFloat(playerid, "Armour"));
        for(new i = 0; i < 13; i++)
        {
            if(PlayerInfo[playerid][pWeapon][i] > 0 && PlayerInfo[playerid][pAmmo][i] > 0)
            {
                GivePlayerWeaponEx(playerid,PlayerInfo[playerid][pWeapon][i],PlayerInfo[playerid][pAmmo][i]);
                PlayerInfo[playerid][pWeapon][i]=0;
            }
        }
        if(GetPVarInt(playerid, "Bag") != 0) SetPlayerAttachedObject(playerid, HOLDOBJECT_BAG, 371, 1, 0.0, -0.1, 0.0, 0.0, 90.0, 0.0);
        switch(GetPVarInt(playerid, "InvWeapon"))
        {
            case 25,27,29,30,31,33,34:
            {
                if(GetPVarInt(playerid, "Member") == 7) SetPlayerAttachedObject( playerid, HOLDOBJECT_GUN2, GetGunObjectID(GetPVarInt(playerid, "InvWeapon")), 1, -0.157276, -0.124338, -0.098805, 195.769546, 13.859096, 0.000000, 1.000000, 1.000000, 1.000000);
                else SetPlayerAttachedObject(playerid, HOLDOBJECT_GUN2, GetGunObjectID(GetPVarInt(playerid, "InvWeapon")), 1, 0.139415, -0.167970, 0.120848, 0.000000, 152.342666, 0.000000);
            }
            case 22,23,24,26,28,32:
            {
                switch(GetPlayerSkin(playerid))
                {
                    case 280 .. 287: SetPlayerAttachedObject(playerid, HOLDOBJECT_GUN2, GetGunObjectID(GetPVarInt(playerid, "InvWeapon")), 8, -0.044177, 0.000000, 0.092454, 246.994583, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
                }
            }
        }
        LoadMask(playerid);
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "You do not have access to this command !");
    }
    return 1;
}
Reply


Messages In This Thread
Servers fucked up since someone joined? - by jueix - 11.10.2013, 18:52
Re: Servers fucked up since someone joined? - by Astralis - 11.10.2013, 19:01
Re: Servers fucked up since someone joined? - by boomerboom - 11.10.2013, 19:05
Re: Servers fucked up since someone joined? - by jueix - 11.10.2013, 19:05
Re: Servers fucked up since someone joined? - by FlawPaw - 11.10.2013, 19:20
Re: Servers fucked up since someone joined? - by jueix - 11.10.2013, 19:27
Re: Servers fucked up since someone joined? - by boomerboom - 11.10.2013, 19:42
Re: Servers fucked up since someone joined? - by SchurmanCQC - 11.10.2013, 20:10
Re: Servers fucked up since someone joined? - by jueix - 11.10.2013, 20:52

Forum Jump:


Users browsing this thread: 1 Guest(s)