laptop
#10

Код:
CMD:ar(playerid, params[])
{
    if(GetPVarInt(playerid,"AirReconOnline")) return SendClientMessage(playerid,COLOR_RED,"ERROR: You have already set the Air Recon Online!");
    if(gTeam[playerid] != TEAM_Internationalforces) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your team dosent have Satellite!");
    if(gTeam[playerid] == TEAM_Internationalforces)
    {
        if(GetPlayerMoney(playerid) < 90000) return SendClientMessage(playerid,0xFF0000FF,"You dont have money to use Satellite!");
        SendClientMessage(playerid,COLOR_BLUE,"i need air recon online!");
        SendClientMessage(playerid,COLOR_BLUE,"copy that we are coming to your position in 2 sec!");
        SendClientMessage(playerid,COLOR_RED,"You lost $90000 for air recon.");
        GivePlayerMoney(playerid, -90000);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
        TogglePlayerControllable(playerid, 0);
        new Float:x, Float:y, Float:z, Float:a, laptop_objid;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        laptop_objid = CreateObject(19894,
                                    x + (0.5 * floatsin(-a, degrees)),
                                    y + (0.5 * floatcos(-a, degrees)),
                                    z + 0.15, 0.0, 0.0, a);
        SetTimerEx("startairrecon", 2000, false, "iiffff", playerid, laptop_objid, x, y, z, a);
    }
    return 1;
}
public startairrecon(playerid, laptop_objid, Float:x, Float:y, Float:z, Float:a)
{
    SetPVarInt(playerid,"AirReconOnline",true);
    SendClientMessage(playerid,COLOR_BLUE,"We are in your position you can use Satellite!");
    GivePlayerWeapon(playerid, 0, 1);
    DestroyObject(laptop_objid);

    new objid;
    objid = CreateObject(19893,
                         x + (0.4 * floatsin(-a, degrees)),
                         y + (0.4 * floatcos(-a, degrees)),
                         z + 0.16, 0.0, 0.0, a);
                         
    SetPlayerCameraPos(playerid, x, y, z+30.0);
    SetPlayerCameraLookAt(playerid, x, y, z);

    SetTimerEx("endar", 60000, false, "ii", playerid, objid);
    return 1;
}

public endar(playerid, laptop_objid)
{
    DestroyObject(laptop_objid);
    
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    // trigonometry "magic", adjust numbers at will
    x += 0.5 * floatsin(-a, degrees);
    y += 0.5 * floatcos(-a, degrees);
    z += 0.15;
    // optionally you may want to save the object id
    // so you can remove the object afterwards
    CreateObject(19894, x, y, z, 0.0, 0.0, a);
    // presumably you want this too + SetCameraBehindPlayer()
    SetCameraBehindPlayer(playerid);
    DeletePVar(playerid,"AirReconOnline");
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
    TogglePlayerControllable(playerid, 1);
    return 1;
}
Reply


Messages In This Thread
laptop - by GeneralAref - 02.12.2015, 13:33
Re: laptop - by Jay_Dixon - 02.12.2015, 17:28
Re: laptop - by SnG.Scot_MisCuDI - 02.12.2015, 19:13
Re: laptop - by GeneralAref - 03.12.2015, 07:55
Re: laptop - by N0FeaR - 03.12.2015, 14:36
Re: laptop - by GeneralAref - 03.12.2015, 14:58
Re: laptop - by Virtual1ty - 03.12.2015, 16:00
Re: laptop - by GeneralAref - 03.12.2015, 17:06
Re: laptop - by Virtual1ty - 03.12.2015, 18:19
Re: laptop - by GeneralAref - 04.12.2015, 15:03

Forum Jump:


Users browsing this thread: 2 Guest(s)