20.02.2011, 18:41
(
Last edited by Mean; 21/02/2011 at 06:07 PM.
)
Quote:
<bump>
Hey guys I have a simple request. I need a script that allows me to place an emergency flare at my coordinates and I need that flare to burn. The flare ID is 18728. It's a particle object for those who don't know. I need a command like "/placeflare" to put it where I am standing and let it burn for a minute, or the ammount of time I decide...the second would be nice. I would type "/placeflare 3" for 3 minutes. |
pawn Code:
forward flaretime( );
new flareobj;
pawn Code:
CMD:placeflare( playerid, params[ ] ) // ZCMD
{
if( !strlen( params ) )
return SendClientMessage( playerid, 0xAAAAAA, "USE: /placeflare <time( IN MINUTES )>" );
new Float:x, Float:y, Float:z;
GetPlayerPos( playerid, x, y, z );
flareobj = CreateObject( 18728, x, y, z, 0.0, 0.0, 0.0 );
SetTimer( "flaretime", params * 60000, 0 );
new string[ 128 ];
format( string, sizeof string, "You have put a flare for %d minutes", params );
return SendClientMessage( playerid, 0xAAAAAA, string );
}
pawn Code:
public flaretime( )
{
return DestroyObject( flareobj );
}