#9

Quote:
Originally Posted by ratxrat
Посмотреть сообщение
Код:
  if(!IsPointInRangeOfPoint(pos[6],pos[7],pos[8],pos[6],pos[7],pos[9],1.0)){fScale=1.0;}
forget this "{ }" ?
The } Is Closing from Loop xD .. So the { is not need again ..

Let make it short

PHP код:
public CheckRemoteGun(playerid)
{
    new 
Keys,ud,lr;
    
GetPlayerKeys(playerid,Keys,ud,lr);
    if(
Keys==KEY_FIRE)
    {
        new 
Float:pos[12];
        const 
Float:fScale=0.0;
        
GetPlayerCameraPos(playerid,pos[0],pos[1],pos[2]);
        
GetPlayerCameraFrontVector(playerid,pos[3],pos[4],pos[5]);
        
pos[6]=pos[0]+floatmul(pos[3],fScale);
        
pos[7]=pos[1]+floatmul(pos[4],fScale);
        
pos[8]=pos[2]+floatmul(pos[5],fScale);
        
MapAndreas_FindZ_For2DCoord(pos[6],pos[7],pos[8]);
        for(new 
i=0;i<=100;i++)
        {
            if(!
IsPlayerInRangeOfPoint(pos[6],pos[7],pos[8],pos[6],pos[7],pos[8],1.0))
            
fScale=1.0;
        }
        
pos[6]=pos[0]+floatmul(pos[3],fScale);
        
pos[7]=pos[1]+floatmul(pos[4],fScale);
        
pos[8]=pos[2]+floatmul(pos[5],fScale);
        if(
IsValidDynamicObject(RGB[playerid]))DestroyDynamicObject(RGB[playerid]);
        
RGB[playerid]= CreateDynamicObject(19300,pos[0],pos[1],pos[2],0.0,0.0,0.0);
        
MoveDynamicObject(RGB[playerid],pos[6],pos[7],pos[8],300);
        
CreateExplosion(pos[6],pos[7],pos[8],2,10.0);
    }
      return 
1;

Check this ^^
Reply


Messages In This Thread
help - by GeneralAref - 24.05.2016, 10:30
Re: help - by Amunra - 24.05.2016, 10:31
Re: help - by GeneralAref - 24.05.2016, 10:33
Re: help - by Dayrion - 24.05.2016, 10:33
Re: help - by oMa37 - 24.05.2016, 10:34
Re: help - by ratxrat - 24.05.2016, 10:34
Re: help - by MBilal - 24.05.2016, 10:35
Re: help - by GeneralAref - 24.05.2016, 10:39
Re: help - by Amunra - 24.05.2016, 10:41
Re: help - by GeneralAref - 24.05.2016, 10:43

Forum Jump:


Users browsing this thread: 3 Guest(s)