laptop
#7

Something like this?
PHP код:
forward startairrecon(playeridlaptop_objidFloat:xFloat:yFloat:zFloat:a);
forward endar(playeridlaptop_objid);
CMD:ar(playeridparams[])
{
    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);
        new 
Float:xFloat:yFloat:zFloat:alaptop_objid;
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playerida);
        
laptop_objid CreateObject(19894,
                                    
+ (0.5 floatsin(-adegrees)),
                                    
+ (0.5 floatcos(-adegrees)),
                                    
0.150.00.0a);
        
SetTimerEx("startairrecon"2000false"iiffff"playeridlaptop_objidxyza);
    }
    return 
1;
}
public 
startairrecon(playeridlaptop_objidFloat:xFloat:yFloat:zFloat:a)
{
    
SetPVarInt(playerid,"AirReconOnline",true); 
    
SendClientMessage(playerid,COLOR_BLUE,"We are in your position you can use Satellite!");
    if (
IsValidObject(laptop_objid)) DestroyObject(laptop_objid);
    new 
objid;
    
objid CreateObject(19893,
                         
+ (0.5 floatsin(-adegrees)),
                         
+ (0.5 floatcos(-adegrees)),
                         
0.150.00.0a);
    
SetPlayerCameraPos(playeridxyz+30.0);
    
SetPlayerCameraLookAt(playeridxyz);
    
SetTimerEx("endar"60000false"ii"playeridobjid);
    return 
1;
}
public 
endar(playeridlaptop_objid)
{
    if (
IsValidObject(laptop_objid)) DestroyObject(laptop_objid);
    new 
Float:xFloat:yFloat:zFloat:aobj;
    
GetPlayerPos(playeridxyz);
    
GetPlayerFacingAngle(playerida);
    
// trigonometry "magic", adjust numbers at will
    
+= 0.5 floatsin(-adegrees);
    
+= 0.5 floatcos(-adegrees);
    
+= 0.15;
    
// optionally you may want to save the object id
    // so you can remove the object afterwards
    
CreateObject(19894xyz0.00.0a);
    
// presumably you want this too + SetCameraBehindPlayer()
    
TogglePlayerControllable(playerid1); 
    return 
1;

Does what you asked, adjust to your needs.
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)