13.03.2013, 05:30
sometimes this code is called more then one time, i need that code calls one time
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
if( GetPlayerState( playerid ) == PLAYER_STATE_PASSENGER )
{
if( GetVehicleModel( playerDB[ playerid ][ masina ] ) == 420 )
{
foreach( Player, i )
{
if( playerDB[ i ][ darbas ] == Taxi )
{
if( GetPlayerState( i ) == PLAYER_STATE_DRIVER )
{
new msg[ 51 ], Float:zP[ 3 ];
GetPlayerPos( playerid, zP[ 0 ], zP[ 1 ], zP[ 2 ] );
new const sumoketaSuma = (( floatround ( floatabs ( zP[ 0 ] - playerDB[ playerid ][ PaskPoz ][ 0 ] ) ) + floatround( floatabs( zP[ 1 ] - playerDB[ playerid ][ PaskPoz ][ 1 ] )) + floatround( floatabs( zP[ 2 ] - playerDB[ playerid ][ PaskPoz ][ 2 ] ))) /3 ) /5;
GivePlayerMoneyA( playerid, -sumoketaSuma );
GivePlayerMoneyA( i, sumoketaSuma );
format( msg, 39, "Taksometras Jums įmuљė %d Lt." ,sumoketaSuma );
SendClientMessage( playerid, 0xFF0000FF, msg );
format( msg, 51, "Keleivis iљlipo, taksometras įmuљė %d Lt." ,sumoketaSuma );
SendClientMessage( i, 0xFF0000FF ,msg );
}
}
}
}
}