Jump to content

Question

Posted

Hii ^^ .

//---- STOCKS ----//

stock GetPlayerSpeed(playerid) // bottom of your script
{
    new Float:X, Float:Y, Float:Z;
    if(IsPlayerInAnyVehicle(playerid))
    {
        GetVehicleVelocity(GetPlayerVehicleID(playerid), X, Y, Z);
        return floatround(floatmul(floatmul(floatsqroot(floatpower(floatabs(X), 2) + floatpower(floatabs(Y), 2) + floatpower(floatabs(Z), 2)), 100), 1.621371192), floatround_round);
    }
    else
    {
        GetPlayerVelocity(playerid, X, Y, Z);
        return floatround(floatmul(floatmul(floatsqroot(floatpower(floatabs(X), 2) + floatpower(floatabs(Y), 2) + floatpower(floatabs(Z), 2)), 100), 1.621371192), floatround_round);
    }
}

[color=blue]public[/color] OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,2.3,1405.4153,653.1323,10.3989) && PLAYER_STATE_DRIVER)
    {
       if(GetPlayerSpeed(playerid) > 70)
       {
          new str[128];
          format( str , sizeof( str ), ""B"POLITIA: "W"Ai fost prins de radar avand viteza de "B"%d Km/Hour!", GetPlayerSpeed(playerid));
          SendClientMessage( playerid , -1 , str );
          SetPlayerWantedLevel( playerid , GetPlayerWantedLevel(playerid) + 1 );
       }
    }
   return 1;
}

/*Deci , acesta este scriptul . Cand un player depaseste limita " 80 km/h" toti playeri primesc +1 wanted .

Cum fac doar el sa primeasca +1 ?  .*/

daca trec prin zona de radar cu aprox. 127 km/h primesc x3 wanted .

Ar trebui un timer ?

d55bbc6b44.png

7bdea99b11.png

rimmon curv.

3 answers to this question

Recommended Posts

Posted

Incearca sa folosesti acest stock:

stock GetVehicleSpeed ( vehicleid )

{

if ( vehicleid != INVALID_VEHICLE_ID )

{

new

Float:Pos [  3  ] ,

Float:vehiclespeed

;

GetVehicleVelocity ( vehicleid , Pos [ 0 ] , Pos [ 1 ] , Pos [ 2 ] ) ;

vehiclespeed = floatsqroot ( Pos [ 0 ] * Pos [ 0 ] + Pos [ 1 ] * Pos [ 1 ] + Pos [ 2 ] * Pos [ 2 ] ) * 200 ;

return floatround ( vehiclespeed , floatround_round ) ;

}

return INVALID_VEHICLE_ID ;

}

Posted

Incearca sa folosesti acest stock:

stock GetVehicleSpeed ( vehicleid )

{

if ( vehicleid != INVALID_VEHICLE_ID )

{

new

Float:Pos [  3  ] ,

Float:vehiclespeed

;

GetVehicleVelocity ( vehicleid , Pos [ 0 ] , Pos [ 1 ] , Pos [ 2 ] ) ;

vehiclespeed = floatsqroot ( Pos [ 0 ] * Pos [ 0 ] + Pos [ 1 ] * Pos [ 1 ] + Pos [ 2 ] * Pos [ 2 ] ) * 200 ;

return floatround ( vehiclespeed , floatround_round ) ;

}

return INVALID_VEHICLE_ID ;

}

Lam schimbat. Lafel

7bdea99b11.png

rimmon curv.

Posted

Schimba "public"-ul OnPlayerUpdate pe care il ai acum, cu asta:

public OnPlayerUpdate ( playerid )

{

if ( IsPlayerInRangeOfPoint ( playerid , 2.3 , 1405.4153 , 653.1323 , 10.3989 ) && PLAYER_STATE_DRIVER && TimerEx [ playerid ] == 0 )

   

    {

   

if ( GetPlayerSpeed ( playerid ) > 70 )

     

{

     

new

  string [  128  ]

;

          format ( string , sizeof ( string ) , ""B"POLITIA: "W"Ai fost prins de radar avand viteza de "B"%d Km/Hour!" , GetPlayerSpeed ( playerid ) ) ;

         

          SendClientMessage ( playerid , -1 , string ) ;

         

          SetPlayerWantedLevel ( playerid , GetPlayerWantedLevel ( playerid ) + 1 ) ;

         

          TimerEx [ playerid ] = SetTimerEx ( "TimerEx1" , 60000 , true , "i" , playerid ) ;

         

}

}

return ( 1 ) ;

}

Si adauga asta la pe la sfarsitul modului de joc:

forward TimerEx1 ( playerid ) ;

public TimerEx1 ( playerid ) { TimerEx [ playerid ] = 0 ; return ( 1 ) ; }

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.