21.02.2012, 17:45
That should work perfectly, do exactly the same, don't change a thing.
pawn Код:
new
BoxObject[ MAX_PLAYERS ],
BoxVariable[ MAX_PLAYERS ]
;
dcmd_vbox( playerid, params[] )
{
#pragma unused params
if( Vip[ playerid ] < 1 )
return SendClientMessage( playerid, COLOR_CERVENA, " [!] Only Vips can do that !" );
if( BoxVariable[ playerid ] )
return SendClientMessage( playerid, COLOR_CERVENA, " You can not spawn two boxes !" );
new
Float:x,
Float:y,
Float:z
;
GetPlayerPos( playerid, x, y, z );
BoxObject[ playerid ] = CreateObject( 1685, x, y+2.0, z, 0.0, 0.0, 0.0 );
BoxVariable[playerid] = 1;
return 1;
}
dcmd_vrbox( playerid, params[] )
{
#pragma unused params
if( Vip[ playerid ] < 1 )
return SendClientMessage( playerid, COLOR_CERVENA, " [!] Only Vips can do that !" );
if( !BoxVariable[ playerid ] )
return SendClientMessage( playerid, COLOR_CERVENA, "You must spawn a box first to remove it !" );
DestroyObject(BoxObject[ playerid ]);
BoxVariable[playerid] = 0;
return 1;
}