06.01.2013, 01:47
I need a function, that a text appears on the screen when a police vehicle have the /siren on command. This text on the screen should only be flashing when the players are near that vehicle. Please help
if (strcmp("/siren", cmdtext, true, 6) == 0)
{
new
Float:Coord[ 3 ];
GetPlayerPos( playerid, Coord[ 0 ], Coord[ 1 ], Coord[ 2 ] );
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( IsPlayerConnected( i ) )
{
if( IsPlayerInRangeOfPoint( i, 20.0, Coord[ 0 ], Coord[ 1 ], Coord[ 2 ] ) )
{
GameTextForPlayer(playerid, "~r~]~b~]", 3000, 1);
}
}
}
return 1;
}
if i get it rigth you need script like this:
pawn Код:
|
GameTextForPlayer(playerid, "~r~]~b~]", 3000, 1);
Thosen't this just make the stars pop up on the player typing the /siren command? Shouldn't it be like this?
pawn Код:
|
if (strcmp("/siren", cmdtext, true, 6) == 0)
{
if( IsPlayerInAnyVehicle( playerid ) ) // in any vehicle
{
new
Float:Coord[ 3 ];
GetPlayerPos( playerid, Coord[ 0 ], Coord[ 1 ], Coord[ 2 ] );
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( IsPlayerConnected( i ) )
{
if( IsPlayerInRangeOfPoint( i, 20.0, Coord[ 0 ], Coord[ 1 ], Coord[ 2 ] ) )
{
GameTextForPlayer( i, "~r~]~b~]", 3000, 1 );
}
}
}
}
return 1;
}